From 2740f17e0ec361349c43ec7fcabd3ede3939b513 Mon Sep 17 00:00:00 2001 From: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Date: Tue, 11 Jun 2024 16:51:07 +0100 Subject: [PATCH 01/62] Feature/fix unit tests (#1090) * Update worktype * fix test case --- ...loud_task_management_worktype_unit_test.go | 12 ----------- ...syscloud_task_management_worktype_utils.go | 21 +++++++++++-------- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_unit_test.go b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_unit_test.go index 0881d4f42..fd10b5a50 100644 --- a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_unit_test.go +++ b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_unit_test.go @@ -502,18 +502,6 @@ func TestUnitResourceWorktypeUpdate(t *testing.T) { taskProxy.updateTaskManagementWorktypeAttr = func(ctx context.Context, p *taskManagementWorktypeProxy, id string, update *platformclientv2.Worktypeupdate) (*platformclientv2.Worktype, *platformclientv2.APIResponse, error) { assert.Equal(t, tId, id) assert.Equal(t, wt.name, *update.Name, "wt.Name check failed in create createTaskManagementWorktypeAttr") - assert.Equal(t, wt.description, *update.Description, "wt.Description check failed in create createTaskManagementWorktypeAttr") - assert.Equal(t, wt.defaultWorkbinId, *update.DefaultWorkbinId, "wt.defaultWorkbinId check failed in create createTaskManagementWorktypeAttr") - assert.Equal(t, wt.defaultDurationS, *update.DefaultDurationSeconds, "wt.defaultDurationS check failed in create createTaskManagementWorktypeAttr") - assert.Equal(t, wt.defaultExpirationS, *update.DefaultExpirationSeconds, "wt.defaultExpirationS check failed in create createTaskManagementWorktypeAttr") - assert.Equal(t, wt.defaultDueDurationS, *update.DefaultDueDurationSeconds, "wt.defaultDueDurationS check failed in create createTaskManagementWorktypeAttr") - assert.Equal(t, wt.defaultPriority, *update.DefaultPriority, "wt.defaultPriority check failed in create createTaskManagementWorktypeAttr") - assert.Equal(t, wt.defaultTtlS, *update.DefaultTtlSeconds, "wt.defaultTtlS check failed in create createTaskManagementWorktypeAttr") - assert.Equal(t, wt.defaultLanguageId, *update.DefaultLanguageId, "wt.defaultLanguageId check failed in create createTaskManagementWorktypeAttr") - assert.Equal(t, wt.defaultQueueId, *update.DefaultQueueId, "wt.defaultQueueId check failed in create createTaskManagementWorktypeAttr") - assert.ElementsMatch(t, wt.defaultSkillIds, *update.DefaultSkillIds, "wt.defaultSkillIds check failed in create createTaskManagementWorktypeAttr") - assert.Equal(t, wt.assignmentEnabled, *update.AssignmentEnabled, "wt.assignmentEnabled check failed in create createTaskManagementWorktypeAttr") - assert.Equal(t, wt.schemaVersion, *update.SchemaVersion, "wt.schemaVersion check failed in create createTaskManagementWorktypeAttr") return &platformclientv2.Worktype{ Id: &tId, diff --git a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go index 679931d83..3dff7cf51 100644 --- a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go +++ b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go @@ -97,10 +97,6 @@ func getWorktypeupdateFromResourceData(d *schema.ResourceData, statuses *[]platf worktype.SetField("SchemaId", platformclientv2.String(d.Get("schema_id").(string))) } - if d.HasChange("division_id") { - worktype.SetField("DivisionId", platformclientv2.String(d.Get("division_id").(string))) - } - if d.HasChange("default_language_id") { worktype.SetField("DefaultLanguageId", resourcedata.GetNillableValue[string](d, "default_language_id")) } @@ -117,10 +113,6 @@ func getWorktypeupdateFromResourceData(d *schema.ResourceData, statuses *[]platf worktype.SetField("AssignmentEnabled", platformclientv2.Bool(d.Get("assignment_enabled").(bool))) } - if d.HasChange("default_status_name") { - worktype.SetField("DefaultStatusId", getStatusIdFromName(d.Get("default_status_name").(string), statuses)) - } - if d.HasChange("schema_version") { worktype.SetField("SchemaVersion", resourcedata.GetNillableValue[int](d, "schema_version")) } @@ -141,6 +133,17 @@ func getWorktypeupdateFromResourceData(d *schema.ResourceData, statuses *[]platf return worktype } +// getWorktypeupdateFromResourceData maps data from schema ResourceData object to a platformclientv2.Worktypeupdate +func getWorktypeupdateFromResourceDataStatus(d *schema.ResourceData, statuses *[]platformclientv2.Workitemstatus) platformclientv2.Worktypeupdate { + + worktype := platformclientv2.Worktypeupdate{} + worktype.SetField("Name", platformclientv2.String(d.Get("name").(string))) + if d.HasChange("default_status_name") { + worktype.SetField("DefaultStatusId", getStatusIdFromName(d.Get("default_status_name").(string), statuses)) + } + return worktype +} + // getStatusFromName gets a platformclientv2.Workitemstatus from a *[]platformclientv2.Workitemstatu by name func getStatusFromName(statusName string, statuses *[]platformclientv2.Workitemstatus) *platformclientv2.Workitemstatus { if statuses == nil { @@ -458,7 +461,7 @@ func updateDefaultStatusName(ctx context.Context, proxy *taskManagementWorktypeP return fmt.Errorf("failed to get task management worktype: %s", err) } - taskManagementWorktype := getWorktypeupdateFromResourceData(d, worktype.Statuses) + taskManagementWorktype := getWorktypeupdateFromResourceDataStatus(d, worktype.Statuses) _, resp, err = proxy.updateTaskManagementWorktype(ctx, *worktype.Id, &taskManagementWorktype) if err != nil { return fmt.Errorf("failed to update worktype's default status name %s %v", err, resp) From c98593f6c6bee3be3d1baff36a35a47dc7d44a4a Mon Sep 17 00:00:00 2001 From: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Date: Tue, 11 Jun 2024 16:57:08 +0100 Subject: [PATCH 02/62] Merging dev to main for v1.40.0 II (#1091) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 (#1008) * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.1 to 0.19.2. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.1...v0.19.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * ran go generate --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * DEVTOOLING-352 - provider oauth credential rate limit exceeded (#1004) * Testing something * Adding retry * Fixed retry * Moved functionality to retries package * Fixed inport cycle * Extending sleep * Added retry to AuthorizeSdk * Using with retries * Remving old function * Feat/devtooling 461 - WithRetries errors include improved logging (#1012) * calling diag func * Changed retryable functions to call Diagnostic function * Converted all withRetries errors to have improved wrapper * Made requested Changes * fixing unit test * Bump golang.org/x/net from 0.23.0 to 0.25.0 (#1017) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.25.0. - [Commits](https://github.com/golang/net/compare/v0.23.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix for issue 993 : Changed message_column to optional and add verification logic (#1013) * Changed message_column to optional and add verification logic * applied safer nil value handling * go generate (#1018) * bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1015) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Revert "bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1…" (#1019) This reverts commit 3ff66d472071905b18b4f66f6ee4b3d3725600e7. * bug/devtooling 560 - CX as Code crash when creating phones (#1020) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Made requested Change * feat/devtooling 579 - Improved Logging for Non-API errors (#1021) * Adding improved non-api diag errors * Pulling Merged PR * Added improved error * Added more logging * Ran go vet * Updated docs * Bump hashicorp/setup-terraform from 3.1.0 to 3.1.1 (#1024) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bug/devtooling 362 - Evaluation forms incorrectly assigning published attribute (#1022) * Correctly sets published feature * Added functionality to set published field correctly * Fixed docs * Bug/devtooling 444: Custom resolver function for outbound campaign script_id (#1014) * Resolving campaign script_id to default outbound script data source when appropriate * Created constants package * editing scripts proxy so that the datasource catches Default scripts * Finished writing tests for new campaign field custom resolver * Fixed linting errors in campaigns package * implemented caching for campaigns exporter * minor changes to a comment * Add deleteCacheItem func + some refactoring work * Refactoring call to resolveToDataSource function and added unit test * Fixing script data source test * Bump github.com/nyaruka/phonenumbers from 1.3.4 to 1.3.5 (#1026) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.4 to 1.3.5. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.4...v1.3.5) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Devtooling-162: Refactored idp salesforce (#999) * Refactored idp salesforce * Fixing docs * Changed function name * Removed original file * Changed Build Function Call to fix type difference (#1029) * fixing test for published attribute (#1030) * No jira: fixing up a few acceptance tests (#1031) * fixed journey segment update * Adding check to journey segment tests to validate is feature is supported * preventing panic in export helper function * Adding sleep to milestone data source test * Cleaning up fmt.Print statements appearing in export tests * undoing changes to segment resource file * Fix routing queue (#1028) * README update (#1025) * Pre-verify if the tfState is in sync with the exporter (#1027) * Add state comapartors * Upddate review comments * Devtooling-591: Consistency Checker Refactor (#1032) * Moved where consistency checker is created in resources * Cleaned up consitency checker file * Added resource name to message * Conditionally adding name * Made requested changes * Feature/devtooling 589 1 (#1035) * update doc * fix reviews * Fix acceptance tests - TCA and Prod (#1033) * Fix edge,export,script test,Jenkin to run tca&prod * Fix export & integration tests * Fix auth tests Fix auth tests * fix tests * resolve conflicts * move assignregion func, remove commented function modify to return empty string - assignregion func return default region --------- Co-authored-by: Monisha Padmavathi Ragavan * Bug/devtooling 597 - Routing email route test failing (#1039) * Added call to cleanup function * linter * adding hotfix to pr labeler config file (#1042) * bug/DEVTOOLING-436 - Added cleanup function for webdeployments resources (#1038) * Added cleanup function for webdeployments resources * fixing conflict * Made requested changes * Made requested changes * Bump github.com/hashicorp/terraform-plugin-sdk/v2 from 2.33.0 to 2.34.0 (#1047) Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.33.0 to 2.34.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.33.0...v2.34.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bug/devtooling 287 temp disable cchecker (#1037) * removed consistency checker * changed DID number * phoneUpdated * Merging dev to main for v1.38.0 (#1036) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 (#1008) * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.1 to 0.19.2. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.1...v0.19.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * ran go generate --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * DEVTOOLING-352 - provider oauth credential rate limit exceeded (#1004) * Testing something * Adding retry * Fixed retry * Moved functionality to retries package * Fixed inport cycle * Extending sleep * Added retry to AuthorizeSdk * Using with retries * Remving old function * Feat/devtooling 461 - WithRetries errors include improved logging (#1012) * calling diag func * Changed retryable functions to call Diagnostic function * Converted all withRetries errors to have improved wrapper * Made requested Changes * fixing unit test * Bump golang.org/x/net from 0.23.0 to 0.25.0 (#1017) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.25.0. - [Commits](https://github.com/golang/net/compare/v0.23.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix for issue 993 : Changed message_column to optional and add verification logic (#1013) * Changed message_column to optional and add verification logic * applied safer nil value handling * go generate (#1018) * bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1015) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Revert "bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1…" (#1019) This reverts commit 3ff66d472071905b18b4f66f6ee4b3d3725600e7. * bug/devtooling 560 - CX as Code crash when creating phones (#1020) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Made requested Change * feat/devtooling 579 - Improved Logging for Non-API errors (#1021) * Adding improved non-api diag errors * Pulling Merged PR * Added improved error * Added more logging * Ran go vet * Updated docs * Bump hashicorp/setup-terraform from 3.1.0 to 3.1.1 (#1024) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bug/devtooling 362 - Evaluation forms incorrectly assigning published attribute (#1022) * Correctly sets published feature * Added functionality to set published field correctly * Fixed docs * Bug/devtooling 444: Custom resolver function for outbound campaign script_id (#1014) * Resolving campaign script_id to default outbound script data source when appropriate * Created constants package * editing scripts proxy so that the datasource catches Default scripts * Finished writing tests for new campaign field custom resolver * Fixed linting errors in campaigns package * implemented caching for campaigns exporter * minor changes to a comment * Add deleteCacheItem func + some refactoring work * Refactoring call to resolveToDataSource function and added unit test * Fixing script data source test * Bump github.com/nyaruka/phonenumbers from 1.3.4 to 1.3.5 (#1026) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.4 to 1.3.5. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.4...v1.3.5) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Devtooling-162: Refactored idp salesforce (#999) * Refactored idp salesforce * Fixing docs * Changed function name * Removed original file * Changed Build Function Call to fix type difference (#1029) * fixing test for published attribute (#1030) * No jira: fixing up a few acceptance tests (#1031) * fixed journey segment update * Adding check to journey segment tests to validate is feature is supported * preventing panic in export helper function * Adding sleep to milestone data source test * Cleaning up fmt.Print statements appearing in export tests * undoing changes to segment resource file * Fix routing queue (#1028) * README update (#1025) * Pre-verify if the tfState is in sync with the exporter (#1027) * Add state comapartors * Upddate review comments * Devtooling-591: Consistency Checker Refactor (#1032) * Moved where consistency checker is created in resources * Cleaned up consitency checker file * Added resource name to message * Conditionally adding name * Made requested changes * Feature/devtooling 589 1 (#1035) * update doc * fix reviews --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * NO-JIRA: Fixing nil pointer in consistency checker (#1041) * Fixed nil pointer in consistency checker * Fixed a few more nil pointers * Fixing nil pointer (#1045) * merged with dev --------- Signed-off-by: dependabot[bot] Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * Fixing up provider docs (#1046) * Fix Export Version problem (#1049) * Logging error in queue create/update instead of failing (#1050) * Refactor/devtooling 395 (#1044) * refactor/DEVTOOLING-395 - adding architect_schedules package * Addressed PR comments * added caching in schedules * Report Generation & testcase fix (#1051) * Report generation generate report generate report * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests * fix tests * fix tests fix tests fix tests * fix tests * fix report * fix report * fix tests fix tests * Bump github.com/hashicorp/terraform-plugin-sdk/v2 from 2.33.0 to 2.34.0 (#1047) Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.33.0 to 2.34.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.33.0...v2.34.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bug/devtooling 287 temp disable cchecker (#1037) * removed consistency checker * changed DID number * phoneUpdated * Merging dev to main for v1.38.0 (#1036) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 (#1008) * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.1 to 0.19.2. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.1...v0.19.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * ran go generate --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * DEVTOOLING-352 - provider oauth credential rate limit exceeded (#1004) * Testing something * Adding retry * Fixed retry * Moved functionality to retries package * Fixed inport cycle * Extending sleep * Added retry to AuthorizeSdk * Using with retries * Remving old function * Feat/devtooling 461 - WithRetries errors include improved logging (#1012) * calling diag func * Changed retryable functions to call Diagnostic function * Converted all withRetries errors to have improved wrapper * Made requested Changes * fixing unit test * Bump golang.org/x/net from 0.23.0 to 0.25.0 (#1017) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.25.0. - [Commits](https://github.com/golang/net/compare/v0.23.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix for issue 993 : Changed message_column to optional and add verification logic (#1013) * Changed message_column to optional and add verification logic * applied safer nil value handling * go generate (#1018) * bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1015) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Revert "bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1…" (#1019) This reverts commit 3ff66d472071905b18b4f66f6ee4b3d3725600e7. * bug/devtooling 560 - CX as Code crash when creating phones (#1020) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Made requested Change * feat/devtooling 579 - Improved Logging for Non-API errors (#1021) * Adding improved non-api diag errors * Pulling Merged PR * Added improved error * Added more logging * Ran go vet * Updated docs * Bump hashicorp/setup-terraform from 3.1.0 to 3.1.1 (#1024) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bug/devtooling 362 - Evaluation forms incorrectly assigning published attribute (#1022) * Correctly sets published feature * Added functionality to set published field correctly * Fixed docs * Bug/devtooling 444: Custom resolver function for outbound campaign script_id (#1014) * Resolving campaign script_id to default outbound script data source when appropriate * Created constants package * editing scripts proxy so that the datasource catches Default scripts * Finished writing tests for new campaign field custom resolver * Fixed linting errors in campaigns package * implemented caching for campaigns exporter * minor changes to a comment * Add deleteCacheItem func + some refactoring work * Refactoring call to resolveToDataSource function and added unit test * Fixing script data source test * Bump github.com/nyaruka/phonenumbers from 1.3.4 to 1.3.5 (#1026) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.4 to 1.3.5. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.4...v1.3.5) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Devtooling-162: Refactored idp salesforce (#999) * Refactored idp salesforce * Fixing docs * Changed function name * Removed original file * Changed Build Function Call to fix type difference (#1029) * fixing test for published attribute (#1030) * No jira: fixing up a few acceptance tests (#1031) * fixed journey segment update * Adding check to journey segment tests to validate is feature is supported * preventing panic in export helper function * Adding sleep to milestone data source test * Cleaning up fmt.Print statements appearing in export tests * undoing changes to segment resource file * Fix routing queue (#1028) * README update (#1025) * Pre-verify if the tfState is in sync with the exporter (#1027) * Add state comapartors * Upddate review comments * Devtooling-591: Consistency Checker Refactor (#1032) * Moved where consistency checker is created in resources * Cleaned up consitency checker file * Added resource name to message * Conditionally adding name * Made requested changes * Feature/devtooling 589 1 (#1035) * update doc * fix reviews --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * NO-JIRA: Fixing nil pointer in consistency checker (#1041) * Fixed nil pointer in consistency checker * Fixed a few more nil pointers * Fixing nil pointer (#1045) * merged with dev --------- Signed-off-by: dependabot[bot] Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * Fixing up provider docs (#1046) * fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests --------- Signed-off-by: dependabot[bot] Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * Add extra check for dependency resolution (#1052) * Devtooling 604: Infinite loop retrieving knowledge documents (#1053) * DEVTOOLING-282 * Adding log message indicating we're hitting the specific scenario for which the integration no longer exist * working around cycling dependencies per charliecon recommendation * adding implementation function getIntegrationByIdFn * Export integration credential only if it matches the expected format - DEVTOOLING-310 * infite loop bugfix --------- Co-authored-by: Will <37446330+williamjeuniaux@users.noreply.github.com> * Feat/COBROWSE-2404 add cobrowse config field (#1054) * made changes similar to what Mateusz did for other fields * updated version * mod and sum fix --------- Co-authored-by: ivan * No jira: Fixing dev with go generate & go mod tidy (#1057) * Fixed go.mod + removed refs to old sdk version * Small refactoring + go generate * DEVTOOLING-592: Changed team members logic (#1055) * Changed team members logic * moved function * Updated docs * Updated docs * Updated docs * Updated docs * Rand go generate * Bump github.com/nyaruka/phonenumbers from 1.3.5 to 1.3.6 (#1056) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.5 to 1.3.6. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.5...v1.3.6) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Feat/devtooling-477: Site Outbound Routes Resource (#1048) * Moving outbound routes to own package * Continued with outbound routes * Finished outboudn routes resource * Ran linter and added exporter * Added api to doc * Added caching * Fixed small bug * Made requested changes * Fixed go version * No jira: fix dev (#1059) * removed ref to old sdk * logging outbound route export error instead of failing * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.2 to 0.19.3 (#1062) Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.2 to 0.19.3. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.2...v0.19.3) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Cache for Data Sources (#1064) * Cache for Data Sources * fix context issue during actual run * DEVTOOLING-603: Media recording poilicies missing from export (#1063) * Caling api manually instead of using sdk * Small change to data source * Bump golang.org/x/net from 0.25.0 to 0.26.0 (#1072) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.25.0 to 0.26.0. - [Commits](https://github.com/golang/net/compare/v0.25.0...v0.26.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.3 to 0.19.4 (#1073) Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.3 to 0.19.4. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.3...v0.19.4) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Feat/devtooling 610 (#1065) * added data source for routing email route * added data source files * changes for name to pattern * updated docs * conflicts resolved * comments resolved for feat/DEVTOOLING-610 * Fixing Tests By removing unsupported arguments (#1070) * Fixing test (#1074) * Refactor/devtooling 156 (#1060) * idp_adfs refactoring * made changes for the getalladfs func * error handling changes * changes done according to unrefractor resource * changes return type * did changes for test idp_adfs * bug fixes * resolved comments * resolved comments * resolved comments * Bug/devtooling 584 (#1071) * Cache for Data Sources * fix context issue during actual run * pushing changes * removed debugging logger * addressed PR changes * updated note * resolved merge conflicts --------- Co-authored-by: HemanthDogiparthi12 Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * fix api call strategy (#1075) * [JM-1457]: Add resource for journey views (#1067) * Merging dev to main for v1.39.0 (#1061) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 (#1008) * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.1 to 0.19.2. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.1...v0.19.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * ran go generate --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * DEVTOOLING-352 - provider oauth credential rate limit exceeded (#1004) * Testing something * Adding retry * Fixed retry * Moved functionality to retries package * Fixed inport cycle * Extending sleep * Added retry to AuthorizeSdk * Using with retries * Remving old function * Feat/devtooling 461 - WithRetries errors include improved logging (#1012) * calling diag func * Changed retryable functions to call Diagnostic function * Converted all withRetries errors to have improved wrapper * Made requested Changes * fixing unit test * Bump golang.org/x/net from 0.23.0 to 0.25.0 (#1017) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.25.0. - [Commits](https://github.com/golang/net/compare/v0.23.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix for issue 993 : Changed message_column to optional and add verification logic (#1013) * Changed message_column to optional and add verification logic * applied safer nil value handling * go generate (#1018) * bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1015) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Revert "bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1…" (#1019) This reverts commit 3ff66d472071905b18b4f66f6ee4b3d3725600e7. * bug/devtooling 560 - CX as Code crash when creating phones (#1020) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Made requested Change * feat/devtooling 579 - Improved Logging for Non-API errors (#1021) * Adding improved non-api diag errors * Pulling Merged PR * Added improved error * Added more logging * Ran go vet * Updated docs * Bump hashicorp/setup-terraform from 3.1.0 to 3.1.1 (#1024) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bug/devtooling 362 - Evaluation forms incorrectly assigning published attribute (#1022) * Correctly sets published feature * Added functionality to set published field correctly * Fixed docs * Bug/devtooling 444: Custom resolver function for outbound campaign script_id (#1014) * Resolving campaign script_id to default outbound script data source when appropriate * Created constants package * editing scripts proxy so that the datasource catches Default scripts * Finished writing tests for new campaign field custom resolver * Fixed linting errors in campaigns package * implemented caching for campaigns exporter * minor changes to a comment * Add deleteCacheItem func + some refactoring work * Refactoring call to resolveToDataSource function and added unit test * Fixing script data source test * Bump github.com/nyaruka/phonenumbers from 1.3.4 to 1.3.5 (#1026) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.4 to 1.3.5. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.4...v1.3.5) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Devtooling-162: Refactored idp salesforce (#999) * Refactored idp salesforce * Fixing docs * Changed function name * Removed original file * Changed Build Function Call to fix type difference (#1029) * fixing test for published attribute (#1030) * No jira: fixing up a few acceptance tests (#1031) * fixed journey segment update * Adding check to journey segment tests to validate is feature is supported * preventing panic in export helper function * Adding sleep to milestone data source test * Cleaning up fmt.Print statements appearing in export tests * undoing changes to segment resource file * Fix routing queue (#1028) * README update (#1025) * Pre-verify if the tfState is in sync with the exporter (#1027) * Add state comapartors * Upddate review comments * Devtooling-591: Consistency Checker Refactor (#1032) * Moved where consistency checker is created in resources * Cleaned up consitency checker file * Added resource name to message * Conditionally adding name * Made requested changes * Feature/devtooling 589 1 (#1035) * update doc * fix reviews * Fix acceptance tests - TCA and Prod (#1033) * Fix edge,export,script test,Jenkin to run tca&prod * Fix export & integration tests * Fix auth tests Fix auth tests * fix tests * resolve conflicts * move assignregion func, remove commented function modify to return empty string - assignregion func return default region --------- Co-authored-by: Monisha Padmavathi Ragavan * Bug/devtooling 597 - Routing email route test failing (#1039) * Added call to cleanup function * linter * adding hotfix to pr labeler config file (#1042) * bug/DEVTOOLING-436 - Added cleanup function for webdeployments resources (#1038) * Added cleanup function for webdeployments resources * fixing conflict * Made requested changes * Made requested changes * Bump github.com/hashicorp/terraform-plugin-sdk/v2 from 2.33.0 to 2.34.0 (#1047) Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.33.0 to 2.34.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.33.0...v2.34.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bug/devtooling 287 temp disable cchecker (#1037) * removed consistency checker * changed DID number * phoneUpdated * Merging dev to main for v1.38.0 (#1036) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to rou… * Fixes #1078 (#1079) * Coverage Report and fixing tests (#1080) * Report generation generate report generate report * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests * fix tests * fix tests fix tests fix tests * fix tests * fix report * fix report * fix tests fix tests * Bump github.com/hashicorp/terraform-plugin-sdk/v2 from 2.33.0 to 2.34.0 (#1047) Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.33.0 to 2.34.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.33.0...v2.34.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bug/devtooling 287 temp disable cchecker (#1037) * removed consistency checker * changed DID number * phoneUpdated * Merging dev to main for v1.38.0 (#1036) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 (#1008) * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.1 to 0.19.2. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.1...v0.19.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * ran go generate --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * DEVTOOLING-352 - provider oauth credential rate limit exceeded (#1004) * Testing something * Adding retry * Fixed retry * Moved functionality to retries package * Fixed inport cycle * Extending sleep * Added retry to AuthorizeSdk * Using with retries * Remving old function * Feat/devtooling 461 - WithRetries errors include improved logging (#1012) * calling diag func * Changed retryable functions to call Diagnostic function * Converted all withRetries errors to have improved wrapper * Made requested Changes * fixing unit test * Bump golang.org/x/net from 0.23.0 to 0.25.0 (#1017) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.25.0. - [Commits](https://github.com/golang/net/compare/v0.23.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix for issue 993 : Changed message_column to optional and add verification logic (#1013) * Changed message_column to optional and add verification logic * applied safer nil value handling * go generate (#1018) * bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1015) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Revert "bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1…" (#1019) This reverts commit 3ff66d472071905b18b4f66f6ee4b3d3725600e7. * bug/devtooling 560 - CX as Code crash when creating phones (#1020) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Made requested Change * feat/devtooling 579 - Improved Logging for Non-API errors (#1021) * Adding improved non-api diag errors * Pulling Merged PR * Added improved error * Added more logging * Ran go vet * Updated docs * Bump hashicorp/setup-terraform from 3.1.0 to 3.1.1 (#1024) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bug/devtooling 362 - Evaluation forms incorrectly assigning published attribute (#1022) * Correctly sets published feature * Added functionality to set published field correctly * Fixed docs * Bug/devtooling 444: Custom resolver function for outbound campaign script_id (#1014) * Resolving campaign script_id to default outbound script data source when appropriate * Created constants package * editing scripts proxy so that the datasource catches Default scripts * Finished writing tests for new campaign field custom resolver * Fixed linting errors in campaigns package * implemented caching for campaigns exporter * minor changes to a comment * Add deleteCacheItem func + some refactoring work * Refactoring call to resolveToDataSource function and added unit test * Fixing script data source test * Bump github.com/nyaruka/phonenumbers from 1.3.4 to 1.3.5 (#1026) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.4 to 1.3.5. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.4...v1.3.5) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Devtooling-162: Refactored idp salesforce (#999) * Refactored idp salesforce * Fixing docs * Changed function name * Removed original file * Changed Build Function Call to fix type difference (#1029) * fixing test for published attribute (#1030) * No jira: fixing up a few acceptance tests (#1031) * fixed journey segment update * Adding check to journey segment tests to validate is feature is supported * preventing panic in export helper function * Adding sleep to milestone data source test * Cleaning up fmt.Print statements appearing in export tests * undoing changes to segment resource file * Fix routing queue (#1028) * README update (#1025) * Pre-verify if the tfState is in sync with the exporter (#1027) * Add state comapartors * Upddate review comments * Devtooling-591: Consistency Checker Refactor (#1032) * Moved where consistency checker is created in resources * Cleaned up consitency checker file * Added resource name to message * Conditionally adding name * Made requested changes * Feature/devtooling 589 1 (#1035) * update doc * fix reviews --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * NO-JIRA: Fixing nil pointer in consistency checker (#1041) * Fixed nil pointer in consistency checker * Fixed a few more nil pointers * Fixing nil pointer (#1045) * merged with dev --------- Signed-off-by: dependabot[bot] Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * Fixing up provider docs (#1046) * fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * Package wise coverage report * Package wise coverage report * fix tests * fix tests * fix tests * fix tests * fix tests * fix tests * Modify coverage report to list all data * Display coverage report, data in same page * fix newly added tests * fix newly added tests * fix user tests * fix failing tests * Cache for Data Sources (#1064) * Cache for Data Sources * fix context issue during actual run * fix tests Fix failing tests fix tests * Add didpool for phoneresource * fix tests * fix tests * modify logging modify logging modify logging modify logging --------- Signed-off-by: dependabot[bot] Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * fixing go vet warnings/errors (#1081) * refactored idp_okta resource (#1069) * refactored idp_okta resource * updated the docs * comments resolved * comments resolved * ran go generate * updated docs and bug fix * fix update issues for workType (#1076) * fix update issues for workType * Delete genesyscloud/task_management_worktype/WorkType.go * Fix caching issue (#1082) * Fix caching issue * fix docs * Feature/fix unit tests (#1090) * Update worktype * fix test case --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> Co-authored-by: sureshperiyappan <61573777+sureshperiyappan@users.noreply.github.com> Co-authored-by: willjeuniaux-genesys <153622483+willjeuniaux-genesys@users.noreply.github.com> Co-authored-by: Will <37446330+williamjeuniaux@users.noreply.github.com> Co-authored-by: Ivan Mikhalchenko Co-authored-by: ivan Co-authored-by: shrutisuryawanshigenesys Co-authored-by: HemanthDogiparthi12 Co-authored-by: Majharul Islam Rafat Co-authored-by: Mohammed Islam --- ...loud_task_management_worktype_unit_test.go | 12 ----------- ...syscloud_task_management_worktype_utils.go | 21 +++++++++++-------- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_unit_test.go b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_unit_test.go index 0881d4f42..fd10b5a50 100644 --- a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_unit_test.go +++ b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_unit_test.go @@ -502,18 +502,6 @@ func TestUnitResourceWorktypeUpdate(t *testing.T) { taskProxy.updateTaskManagementWorktypeAttr = func(ctx context.Context, p *taskManagementWorktypeProxy, id string, update *platformclientv2.Worktypeupdate) (*platformclientv2.Worktype, *platformclientv2.APIResponse, error) { assert.Equal(t, tId, id) assert.Equal(t, wt.name, *update.Name, "wt.Name check failed in create createTaskManagementWorktypeAttr") - assert.Equal(t, wt.description, *update.Description, "wt.Description check failed in create createTaskManagementWorktypeAttr") - assert.Equal(t, wt.defaultWorkbinId, *update.DefaultWorkbinId, "wt.defaultWorkbinId check failed in create createTaskManagementWorktypeAttr") - assert.Equal(t, wt.defaultDurationS, *update.DefaultDurationSeconds, "wt.defaultDurationS check failed in create createTaskManagementWorktypeAttr") - assert.Equal(t, wt.defaultExpirationS, *update.DefaultExpirationSeconds, "wt.defaultExpirationS check failed in create createTaskManagementWorktypeAttr") - assert.Equal(t, wt.defaultDueDurationS, *update.DefaultDueDurationSeconds, "wt.defaultDueDurationS check failed in create createTaskManagementWorktypeAttr") - assert.Equal(t, wt.defaultPriority, *update.DefaultPriority, "wt.defaultPriority check failed in create createTaskManagementWorktypeAttr") - assert.Equal(t, wt.defaultTtlS, *update.DefaultTtlSeconds, "wt.defaultTtlS check failed in create createTaskManagementWorktypeAttr") - assert.Equal(t, wt.defaultLanguageId, *update.DefaultLanguageId, "wt.defaultLanguageId check failed in create createTaskManagementWorktypeAttr") - assert.Equal(t, wt.defaultQueueId, *update.DefaultQueueId, "wt.defaultQueueId check failed in create createTaskManagementWorktypeAttr") - assert.ElementsMatch(t, wt.defaultSkillIds, *update.DefaultSkillIds, "wt.defaultSkillIds check failed in create createTaskManagementWorktypeAttr") - assert.Equal(t, wt.assignmentEnabled, *update.AssignmentEnabled, "wt.assignmentEnabled check failed in create createTaskManagementWorktypeAttr") - assert.Equal(t, wt.schemaVersion, *update.SchemaVersion, "wt.schemaVersion check failed in create createTaskManagementWorktypeAttr") return &platformclientv2.Worktype{ Id: &tId, diff --git a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go index 679931d83..3dff7cf51 100644 --- a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go +++ b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go @@ -97,10 +97,6 @@ func getWorktypeupdateFromResourceData(d *schema.ResourceData, statuses *[]platf worktype.SetField("SchemaId", platformclientv2.String(d.Get("schema_id").(string))) } - if d.HasChange("division_id") { - worktype.SetField("DivisionId", platformclientv2.String(d.Get("division_id").(string))) - } - if d.HasChange("default_language_id") { worktype.SetField("DefaultLanguageId", resourcedata.GetNillableValue[string](d, "default_language_id")) } @@ -117,10 +113,6 @@ func getWorktypeupdateFromResourceData(d *schema.ResourceData, statuses *[]platf worktype.SetField("AssignmentEnabled", platformclientv2.Bool(d.Get("assignment_enabled").(bool))) } - if d.HasChange("default_status_name") { - worktype.SetField("DefaultStatusId", getStatusIdFromName(d.Get("default_status_name").(string), statuses)) - } - if d.HasChange("schema_version") { worktype.SetField("SchemaVersion", resourcedata.GetNillableValue[int](d, "schema_version")) } @@ -141,6 +133,17 @@ func getWorktypeupdateFromResourceData(d *schema.ResourceData, statuses *[]platf return worktype } +// getWorktypeupdateFromResourceData maps data from schema ResourceData object to a platformclientv2.Worktypeupdate +func getWorktypeupdateFromResourceDataStatus(d *schema.ResourceData, statuses *[]platformclientv2.Workitemstatus) platformclientv2.Worktypeupdate { + + worktype := platformclientv2.Worktypeupdate{} + worktype.SetField("Name", platformclientv2.String(d.Get("name").(string))) + if d.HasChange("default_status_name") { + worktype.SetField("DefaultStatusId", getStatusIdFromName(d.Get("default_status_name").(string), statuses)) + } + return worktype +} + // getStatusFromName gets a platformclientv2.Workitemstatus from a *[]platformclientv2.Workitemstatu by name func getStatusFromName(statusName string, statuses *[]platformclientv2.Workitemstatus) *platformclientv2.Workitemstatus { if statuses == nil { @@ -458,7 +461,7 @@ func updateDefaultStatusName(ctx context.Context, proxy *taskManagementWorktypeP return fmt.Errorf("failed to get task management worktype: %s", err) } - taskManagementWorktype := getWorktypeupdateFromResourceData(d, worktype.Statuses) + taskManagementWorktype := getWorktypeupdateFromResourceDataStatus(d, worktype.Statuses) _, resp, err = proxy.updateTaskManagementWorktype(ctx, *worktype.Id, &taskManagementWorktype) if err != nil { return fmt.Errorf("failed to update worktype's default status name %s %v", err, resp) From 4c1819b37aa09435a4d92d21686f1baa750a864d Mon Sep 17 00:00:00 2001 From: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Date: Tue, 11 Jun 2024 17:12:20 +0100 Subject: [PATCH 03/62] Specifying version 2 in the goreleaser file to fix build (#1092) --- .goreleaser.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.goreleaser.yml b/.goreleaser.yml index 61d0792ec..18e0e8f68 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,5 +1,7 @@ # Visit https://goreleaser.com for documentation on how to customize this # behavior. +version: 2 + before: hooks: # this is just an example and not a requirement for provider building/publishing From acc941fd373803f6346f68e75114c0c95ac1922c Mon Sep 17 00:00:00 2001 From: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Date: Tue, 11 Jun 2024 17:18:04 +0100 Subject: [PATCH 04/62] No jira goreleaser v2 (#1093) * Specifying version 2 in the goreleaser file to fix build * removed skip line --- .goreleaser.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 18e0e8f68..ae44a24cd 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -58,8 +58,6 @@ signs: release: draft: true changelog: - # Defaults to false. - skip: 'false' use: github sort: asc abbrev: -1 From fa84028c1d3e361be2e59d0fe5e99e7729b979d0 Mon Sep 17 00:00:00 2001 From: Majharul Islam Rafat Date: Thu, 13 Jun 2024 08:43:39 -0400 Subject: [PATCH 05/62] [JM-1457]: Set element to nil if not given (#1098) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 (#1008) * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.1 to 0.19.2. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.1...v0.19.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * ran go generate --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * DEVTOOLING-352 - provider oauth credential rate limit exceeded (#1004) * Testing something * Adding retry * Fixed retry * Moved functionality to retries package * Fixed inport cycle * Extending sleep * Added retry to AuthorizeSdk * Using with retries * Remving old function * Feat/devtooling 461 - WithRetries errors include improved logging (#1012) * calling diag func * Changed retryable functions to call Diagnostic function * Converted all withRetries errors to have improved wrapper * Made requested Changes * fixing unit test * Bump golang.org/x/net from 0.23.0 to 0.25.0 (#1017) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.25.0. - [Commits](https://github.com/golang/net/compare/v0.23.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix for issue 993 : Changed message_column to optional and add verification logic (#1013) * Changed message_column to optional and add verification logic * applied safer nil value handling * go generate (#1018) * bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1015) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Revert "bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1…" (#1019) This reverts commit 3ff66d472071905b18b4f66f6ee4b3d3725600e7. * bug/devtooling 560 - CX as Code crash when creating phones (#1020) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Made requested Change * feat/devtooling 579 - Improved Logging for Non-API errors (#1021) * Adding improved non-api diag errors * Pulling Merged PR * Added improved error * Added more logging * Ran go vet * Updated docs * Bump hashicorp/setup-terraform from 3.1.0 to 3.1.1 (#1024) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bug/devtooling 362 - Evaluation forms incorrectly assigning published attribute (#1022) * Correctly sets published feature * Added functionality to set published field correctly * Fixed docs * Bug/devtooling 444: Custom resolver function for outbound campaign script_id (#1014) * Resolving campaign script_id to default outbound script data source when appropriate * Created constants package * editing scripts proxy so that the datasource catches Default scripts * Finished writing tests for new campaign field custom resolver * Fixed linting errors in campaigns package * implemented caching for campaigns exporter * minor changes to a comment * Add deleteCacheItem func + some refactoring work * Refactoring call to resolveToDataSource function and added unit test * Fixing script data source test * Bump github.com/nyaruka/phonenumbers from 1.3.4 to 1.3.5 (#1026) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.4 to 1.3.5. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.4...v1.3.5) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Devtooling-162: Refactored idp salesforce (#999) * Refactored idp salesforce * Fixing docs * Changed function name * Removed original file * Changed Build Function Call to fix type difference (#1029) * fixing test for published attribute (#1030) * No jira: fixing up a few acceptance tests (#1031) * fixed journey segment update * Adding check to journey segment tests to validate is feature is supported * preventing panic in export helper function * Adding sleep to milestone data source test * Cleaning up fmt.Print statements appearing in export tests * undoing changes to segment resource file * Fix routing queue (#1028) * README update (#1025) * Pre-verify if the tfState is in sync with the exporter (#1027) * Add state comapartors * Upddate review comments * Devtooling-591: Consistency Checker Refactor (#1032) * Moved where consistency checker is created in resources * Cleaned up consitency checker file * Added resource name to message * Conditionally adding name * Made requested changes * Feature/devtooling 589 1 (#1035) * update doc * fix reviews * Fix acceptance tests - TCA and Prod (#1033) * Fix edge,export,script test,Jenkin to run tca&prod * Fix export & integration tests * Fix auth tests Fix auth tests * fix tests * resolve conflicts * move assignregion func, remove commented function modify to return empty string - assignregion func return default region --------- Co-authored-by: Monisha Padmavathi Ragavan * Bug/devtooling 597 - Routing email route test failing (#1039) * Added call to cleanup function * linter * adding hotfix to pr labeler config file (#1042) * bug/DEVTOOLING-436 - Added cleanup function for webdeployments resources (#1038) * Added cleanup function for webdeployments resources * fixing conflict * Made requested changes * Made requested changes * Bump github.com/hashicorp/terraform-plugin-sdk/v2 from 2.33.0 to 2.34.0 (#1047) Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.33.0 to 2.34.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.33.0...v2.34.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bug/devtooling 287 temp disable cchecker (#1037) * removed consistency checker * changed DID number * phoneUpdated * Merging dev to main for v1.38.0 (#1036) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 (#1008) * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.1 to 0.19.2. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.1...v0.19.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * ran go generate --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * DEVTOOLING-352 - provider oauth credential rate limit exceeded (#1004) * Testing something * Adding retry * Fixed retry * Moved functionality to retries package * Fixed inport cycle * Extending sleep * Added retry to AuthorizeSdk * Using with retries * Remving old function * Feat/devtooling 461 - WithRetries errors include improved logging (#1012) * calling diag func * Changed retryable functions to call Diagnostic function * Converted all withRetries errors to have improved wrapper * Made requested Changes * fixing unit test * Bump golang.org/x/net from 0.23.0 to 0.25.0 (#1017) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.25.0. - [Commits](https://github.com/golang/net/compare/v0.23.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix for issue 993 : Changed message_column to optional and add verification logic (#1013) * Changed message_column to optional and add verification logic * applied safer nil value handling * go generate (#1018) * bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1015) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Revert "bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1…" (#1019) This reverts commit 3ff66d472071905b18b4f66f6ee4b3d3725600e7. * bug/devtooling 560 - CX as Code crash when creating phones (#1020) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Made requested Change * feat/devtooling 579 - Improved Logging for Non-API errors (#1021) * Adding improved non-api diag errors * Pulling Merged PR * Added improved error * Added more logging * Ran go vet * Updated docs * Bump hashicorp/setup-terraform from 3.1.0 to 3.1.1 (#1024) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bug/devtooling 362 - Evaluation forms incorrectly assigning published attribute (#1022) * Correctly sets published feature * Added functionality to set published field correctly * Fixed docs * Bug/devtooling 444: Custom resolver function for outbound campaign script_id (#1014) * Resolving campaign script_id to default outbound script data source when appropriate * Created constants package * editing scripts proxy so that the datasource catches Default scripts * Finished writing tests for new campaign field custom resolver * Fixed linting errors in campaigns package * implemented caching for campaigns exporter * minor changes to a comment * Add deleteCacheItem func + some refactoring work * Refactoring call to resolveToDataSource function and added unit test * Fixing script data source test * Bump github.com/nyaruka/phonenumbers from 1.3.4 to 1.3.5 (#1026) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.4 to 1.3.5. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.4...v1.3.5) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Devtooling-162: Refactored idp salesforce (#999) * Refactored idp salesforce * Fixing docs * Changed function name * Removed original file * Changed Build Function Call to fix type difference (#1029) * fixing test for published attribute (#1030) * No jira: fixing up a few acceptance tests (#1031) * fixed journey segment update * Adding check to journey segment tests to validate is feature is supported * preventing panic in export helper function * Adding sleep to milestone data source test * Cleaning up fmt.Print statements appearing in export tests * undoing changes to segment resource file * Fix routing queue (#1028) * README update (#1025) * Pre-verify if the tfState is in sync with the exporter (#1027) * Add state comapartors * Upddate review comments * Devtooling-591: Consistency Checker Refactor (#1032) * Moved where consistency checker is created in resources * Cleaned up consitency checker file * Added resource name to message * Conditionally adding name * Made requested changes * Feature/devtooling 589 1 (#1035) * update doc * fix reviews --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * NO-JIRA: Fixing nil pointer in consistency checker (#1041) * Fixed nil pointer in consistency checker * Fixed a few more nil pointers * Fixing nil pointer (#1045) * merged with dev --------- Signed-off-by: dependabot[bot] Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * Fixing up provider docs (#1046) * Fix Export Version problem (#1049) * Logging error in queue create/update instead of failing (#1050) * Refactor/devtooling 395 (#1044) * refactor/DEVTOOLING-395 - adding architect_schedules package * Addressed PR comments * added caching in schedules * Report Generation & testcase fix (#1051) * Report generation generate report generate report * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests * fix tests * fix tests fix tests fix tests * fix tests * fix report * fix report * fix tests fix tests * Bump github.com/hashicorp/terraform-plugin-sdk/v2 from 2.33.0 to 2.34.0 (#1047) Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.33.0 to 2.34.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.33.0...v2.34.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bug/devtooling 287 temp disable cchecker (#1037) * removed consistency checker * changed DID number * phoneUpdated * Merging dev to main for v1.38.0 (#1036) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 (#1008) * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.1 to 0.19.2. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.1...v0.19.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * ran go generate --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * DEVTOOLING-352 - provider oauth credential rate limit exceeded (#1004) * Testing something * Adding retry * Fixed retry * Moved functionality to retries package * Fixed inport cycle * Extending sleep * Added retry to AuthorizeSdk * Using with retries * Remving old function * Feat/devtooling 461 - WithRetries errors include improved logging (#1012) * calling diag func * Changed retryable functions to call Diagnostic function * Converted all withRetries errors to have improved wrapper * Made requested Changes * fixing unit test * Bump golang.org/x/net from 0.23.0 to 0.25.0 (#1017) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.25.0. - [Commits](https://github.com/golang/net/compare/v0.23.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix for issue 993 : Changed message_column to optional and add verification logic (#1013) * Changed message_column to optional and add verification logic * applied safer nil value handling * go generate (#1018) * bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1015) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Revert "bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1…" (#1019) This reverts commit 3ff66d472071905b18b4f66f6ee4b3d3725600e7. * bug/devtooling 560 - CX as Code crash when creating phones (#1020) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Made requested Change * feat/devtooling 579 - Improved Logging for Non-API errors (#1021) * Adding improved non-api diag errors * Pulling Merged PR * Added improved error * Added more logging * Ran go vet * Updated docs * Bump hashicorp/setup-terraform from 3.1.0 to 3.1.1 (#1024) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bug/devtooling 362 - Evaluation forms incorrectly assigning published attribute (#1022) * Correctly sets published feature * Added functionality to set published field correctly * Fixed docs * Bug/devtooling 444: Custom resolver function for outbound campaign script_id (#1014) * Resolving campaign script_id to default outbound script data source when appropriate * Created constants package * editing scripts proxy so that the datasource catches Default scripts * Finished writing tests for new campaign field custom resolver * Fixed linting errors in campaigns package * implemented caching for campaigns exporter * minor changes to a comment * Add deleteCacheItem func + some refactoring work * Refactoring call to resolveToDataSource function and added unit test * Fixing script data source test * Bump github.com/nyaruka/phonenumbers from 1.3.4 to 1.3.5 (#1026) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.4 to 1.3.5. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.4...v1.3.5) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Devtooling-162: Refactored idp salesforce (#999) * Refactored idp salesforce * Fixing docs * Changed function name * Removed original file * Changed Build Function Call to fix type difference (#1029) * fixing test for published attribute (#1030) * No jira: fixing up a few acceptance tests (#1031) * fixed journey segment update * Adding check to journey segment tests to validate is feature is supported * preventing panic in export helper function * Adding sleep to milestone data source test * Cleaning up fmt.Print statements appearing in export tests * undoing changes to segment resource file * Fix routing queue (#1028) * README update (#1025) * Pre-verify if the tfState is in sync with the exporter (#1027) * Add state comapartors * Upddate review comments * Devtooling-591: Consistency Checker Refactor (#1032) * Moved where consistency checker is created in resources * Cleaned up consitency checker file * Added resource name to message * Conditionally adding name * Made requested changes * Feature/devtooling 589 1 (#1035) * update doc * fix reviews --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * NO-JIRA: Fixing nil pointer in consistency checker (#1041) * Fixed nil pointer in consistency checker * Fixed a few more nil pointers * Fixing nil pointer (#1045) * merged with dev --------- Signed-off-by: dependabot[bot] Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * Fixing up provider docs (#1046) * fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests --------- Signed-off-by: dependabot[bot] Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * Add extra check for dependency resolution (#1052) * Devtooling 604: Infinite loop retrieving knowledge documents (#1053) * DEVTOOLING-282 * Adding log message indicating we're hitting the specific scenario for which the integration no longer exist * working around cycling dependencies per charliecon recommendation * adding implementation function getIntegrationByIdFn * Export integration credential only if it matches the expected format - DEVTOOLING-310 * infite loop bugfix --------- Co-authored-by: Will <37446330+williamjeuniaux@users.noreply.github.com> * Feat/COBROWSE-2404 add cobrowse config field (#1054) * made changes similar to what Mateusz did for other fields * updated version * mod and sum fix --------- Co-authored-by: ivan * No jira: Fixing dev with go generate & go mod tidy (#1057) * Fixed go.mod + removed refs to old sdk version * Small refactoring + go generate * DEVTOOLING-592: Changed team members logic (#1055) * Changed team members logic * moved function * Updated docs * Updated docs * Updated docs * Updated docs * Rand go generate * Bump github.com/nyaruka/phonenumbers from 1.3.5 to 1.3.6 (#1056) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.5 to 1.3.6. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.5...v1.3.6) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Feat/devtooling-477: Site Outbound Routes Resource (#1048) * Moving outbound routes to own package * Continued with outbound routes * Finished outboudn routes resource * Ran linter and added exporter * Added api to doc * Added caching * Fixed small bug * Made requested changes * Fixed go version * No jira: fix dev (#1059) * removed ref to old sdk * logging outbound route export error instead of failing * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.2 to 0.19.3 (#1062) Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.2 to 0.19.3. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.2...v0.19.3) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [JM-1457]: Add resource for journey views * [JM-1457]: import journey view as variable in main.go * Cache for Data Sources (#1064) * Cache for Data Sources * fix context issue during actual run * DEVTOOLING-603: Media recording poilicies missing from export (#1063) * Caling api manually instead of using sdk * Small change to data source * Bump golang.org/x/net from 0.25.0 to 0.26.0 (#1072) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.25.0 to 0.26.0. - [Commits](https://github.com/golang/net/compare/v0.25.0...v0.26.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.3 to 0.19.4 (#1073) Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.3 to 0.19.4. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.3...v0.19.4) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [JM-1457]: Remove print statements * Feat/devtooling 610 (#1065) * added data source for routing email route * added data source files * changes for name to pattern * updated docs * conflicts resolved * comments resolved for feat/DEVTOOLING-610 * Fixing Tests By removing unsupported arguments (#1070) * [JM-1457]: Refactor code * Fixing test (#1074) * Refactor/devtooling 156 (#1060) * idp_adfs refactoring * made changes for the getalladfs func * error handling changes * changes done according to unrefractor resource * changes return type * did changes for test idp_adfs * bug fixes * resolved comments * resolved comments * resolved comments * Bug/devtooling 584 (#1071) * Cache for Data Sources * fix context issue during actual run * pushing changes * removed debugging logger * addressed PR changes * updated note * resolved merge conflicts --------- Co-authored-by: HemanthDogiparthi12 Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * Remove default values from optional fields * [JM-1457]: Refactor and generate the doc * Remove default value from eventCountType * fix api call strategy (#1075) * [JM-1457]: Add resource for journey views (#1067) * Merging dev to main for v1.39.0 (#1061) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 (#1008) * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.1 to 0.19.2. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.1...v0.19.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * ran go generate --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * DEVTOOLING-352 - provider oauth credential rate limit exceeded (#1004) * Testing something * Adding retry * Fixed retry * Moved functionality to retries package * Fixed inport cycle * Extending sleep * Added retry to AuthorizeSdk * Using with retries * Remving old function * Feat/devtooling 461 - WithRetries errors include improved logging (#1012) * calling diag func * Changed retryable functions to call Diagnostic function * Converted all withRetries errors to have improved wrapper * Made requested Changes * fixing unit test * Bump golang.org/x/net from 0.23.0 to 0.25.0 (#1017) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.25.0. - [Commits](https://github.com/golang/net/compare/v0.23.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix for issue 993 : Changed message_column to optional and add verification logic (#1013) * Changed message_column to optional and add verification logic * applied safer nil value handling * go generate (#1018) * bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1015) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Revert "bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1…" (#1019) This reverts commit 3ff66d472071905b18b4f66f6ee4b3d3725600e7. * bug/devtooling 560 - CX as Code crash when creating phones (#1020) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Made requested Change * feat/devtooling 579 - Improved Logging for Non-API errors (#1021) * Adding improved non-api diag errors * Pulling Merged PR * Added improved error * Added more logging * Ran go vet * Updated docs * Bump hashicorp/setup-terraform from 3.1.0 to 3.1.1 (#1024) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bug/devtooling 362 - Evaluation forms incorrectly assigning published attribute (#1022) * Correctly sets published feature * Added functionality to set published field correctly * Fixed docs * Bug/devtooling 444: Custom resolver function for outbound campaign script_id (#1014) * Resolving campaign script_id to default outbound script data source when appropriate * Created constants package * editing scripts proxy so that the datasource catches Default scripts * Finished writing tests for new campaign field custom resolver * Fixed linting errors in campaigns package * implemented caching for campaigns exporter * minor changes to a comment * Add deleteCacheItem func + some refactoring work * Refactoring call to resolveToDataSource function and added unit test * Fixing script data source test * Bump github.com/nyaruka/phonenumbers from 1.3.4 to 1.3.5 (#1026) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.4 to 1.3.5. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.4...v1.3.5) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Devtooling-162: Refactored idp salesforce (#999) * Refactored idp salesforce * Fixing docs * Changed function name * Removed original file * Changed Build Function Call to fix type difference (#1029) * fixing test for published attribute (#1030) * No jira: fixing up a few acceptance tests (#1031) * fixed journey segment update * Adding check to journey segment tests to validate is feature is supported * preventing panic in export helper function * Adding sleep to milestone data source test * Cleaning up fmt.Print statements appearing in export tests * undoing changes to segment resource file * Fix routing queue (#1028) * README update (#1025) * Pre-verify if the tfState is in sync with the exporter (#1027) * Add state comapartors * Upddate review comments * Devtooling-591: Consistency Checker Refactor (#1032) * Moved where consistency checker is created in resources * Cleaned up consitency checker file * Added resource name to message * Conditionally adding name * Made requested changes * Feature/devtooling 589 1 (#1035) * update doc * fix reviews * Fix acceptance tests - TCA and Prod (#1033) * Fix edge,export,script test,Jenkin to run tca&prod * Fix export & integration tests * Fix auth tests Fix auth tests * fix tests * resolve conflicts * move assignregion func, remove commented function modify to return empty string - assignregion func return default region --------- Co-authored-by: Monisha Padmavathi Ragavan * Bug/devtooling 597 - Routing email route test failing (#1039) * Added call to cleanup function * linter * adding hotfix to pr labeler config file (#1042) * bug/DEVTOOLING-436 - Added cleanup function for webdeployments resources (#1038) * Added cleanup function for webdeployments resources * fixing conflict * Made requested changes * Made requested changes * Bump github.com/hashicorp/terraform-plugin-sdk/v2 from 2.33.0 to 2.34.0 (#1047) Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.33.0 to 2.34.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.33.0...v2.34.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bug/devtooling 287 temp disable cchecker (#1037) * removed consistency checker * changed DID number * phoneUpdated * Merging dev to main for v1.38.0 (#1036) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to rou… * Fixes #1078 (#1079) * Coverage Report and fixing tests (#1080) * Report generation generate report generate report * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests * fix tests * fix tests fix tests fix tests * fix tests * fix report * fix report * fix tests fix tests * Bump github.com/hashicorp/terraform-plugin-sdk/v2 from 2.33.0 to 2.34.0 (#1047) Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.33.0 to 2.34.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.33.0...v2.34.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bug/devtooling 287 temp disable cchecker (#1037) * removed consistency checker * changed DID number * phoneUpdated * Merging dev to main for v1.38.0 (#1036) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 (#1008) * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.1 to 0.19.2. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.1...v0.19.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * ran go generate --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * DEVTOOLING-352 - provider oauth credential rate limit exceeded (#1004) * Testing something * Adding retry * Fixed retry * Moved functionality to retries package * Fixed inport cycle * Extending sleep * Added retry to AuthorizeSdk * Using with retries * Remving old function * Feat/devtooling 461 - WithRetries errors include improved logging (#1012) * calling diag func * Changed retryable functions to call Diagnostic function * Converted all withRetries errors to have improved wrapper * Made requested Changes * fixing unit test * Bump golang.org/x/net from 0.23.0 to 0.25.0 (#1017) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.25.0. - [Commits](https://github.com/golang/net/compare/v0.23.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix for issue 993 : Changed message_column to optional and add verification logic (#1013) * Changed message_column to optional and add verification logic * applied safer nil value handling * go generate (#1018) * bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1015) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Revert "bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1…" (#1019) This reverts commit 3ff66d472071905b18b4f66f6ee4b3d3725600e7. * bug/devtooling 560 - CX as Code crash when creating phones (#1020) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Made requested Change * feat/devtooling 579 - Improved Logging for Non-API errors (#1021) * Adding improved non-api diag errors * Pulling Merged PR * Added improved error * Added more logging * Ran go vet * Updated docs * Bump hashicorp/setup-terraform from 3.1.0 to 3.1.1 (#1024) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bug/devtooling 362 - Evaluation forms incorrectly assigning published attribute (#1022) * Correctly sets published feature * Added functionality to set published field correctly * Fixed docs * Bug/devtooling 444: Custom resolver function for outbound campaign script_id (#1014) * Resolving campaign script_id to default outbound script data source when appropriate * Created constants package * editing scripts proxy so that the datasource catches Default scripts * Finished writing tests for new campaign field custom resolver * Fixed linting errors in campaigns package * implemented caching for campaigns exporter * minor changes to a comment * Add deleteCacheItem func + some refactoring work * Refactoring call to resolveToDataSource function and added unit test * Fixing script data source test * Bump github.com/nyaruka/phonenumbers from 1.3.4 to 1.3.5 (#1026) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.4 to 1.3.5. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.4...v1.3.5) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Devtooling-162: Refactored idp salesforce (#999) * Refactored idp salesforce * Fixing docs * Changed function name * Removed original file * Changed Build Function Call to fix type difference (#1029) * fixing test for published attribute (#1030) * No jira: fixing up a few acceptance tests (#1031) * fixed journey segment update * Adding check to journey segment tests to validate is feature is supported * preventing panic in export helper function * Adding sleep to milestone data source test * Cleaning up fmt.Print statements appearing in export tests * undoing changes to segment resource file * Fix routing queue (#1028) * README update (#1025) * Pre-verify if the tfState is in sync with the exporter (#1027) * Add state comapartors * Upddate review comments * Devtooling-591: Consistency Checker Refactor (#1032) * Moved where consistency checker is created in resources * Cleaned up consitency checker file * Added resource name to message * Conditionally adding name * Made requested changes * Feature/devtooling 589 1 (#1035) * update doc * fix reviews --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * NO-JIRA: Fixing nil pointer in consistency checker (#1041) * Fixed nil pointer in consistency checker * Fixed a few more nil pointers * Fixing nil pointer (#1045) * merged with dev --------- Signed-off-by: dependabot[bot] Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * Fixing up provider docs (#1046) * fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * Package wise coverage report * Package wise coverage report * fix tests * fix tests * fix tests * fix tests * fix tests * fix tests * Modify coverage report to list all data * Display coverage report, data in same page * fix newly added tests * fix newly added tests * fix user tests * fix failing tests * Cache for Data Sources (#1064) * Cache for Data Sources * fix context issue during actual run * fix tests Fix failing tests fix tests * Add didpool for phoneresource * fix tests * fix tests * modify logging modify logging modify logging modify logging --------- Signed-off-by: dependabot[bot] Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * fixing go vet warnings/errors (#1081) * refactored idp_okta resource (#1069) * refactored idp_okta resource * updated the docs * comments resolved * comments resolved * ran go generate * updated docs and bug fix * fix update issues for workType (#1076) * fix update issues for workType * Delete genesyscloud/task_management_worktype/WorkType.go * Fix caching issue (#1082) * Fix caching issue * fix docs * Feature/fix unit tests (#1090) * Update worktype * fix test case * [JM-1457]: Filter should be nil if not given * Merge with dev * [JM-1457]: Filter should be nil if not given --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: Charlie Conneely Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> Co-authored-by: sureshperiyappan <61573777+sureshperiyappan@users.noreply.github.com> Co-authored-by: willjeuniaux-genesys <153622483+willjeuniaux-genesys@users.noreply.github.com> Co-authored-by: Will <37446330+williamjeuniaux@users.noreply.github.com> Co-authored-by: Ivan Mikhalchenko Co-authored-by: ivan Co-authored-by: Mohammed Islam Co-authored-by: shrutisuryawanshigenesys Co-authored-by: HemanthDogiparthi12 --- ...esource_genesyscloud_journey_views_test.go | 20 +++++++++++++++++++ ...source_genesyscloud_journey_views_utils.go | 9 ++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/genesyscloud/journey_views/resource_genesyscloud_journey_views_test.go b/genesyscloud/journey_views/resource_genesyscloud_journey_views_test.go index ca39fd4c8..5d2153764 100644 --- a/genesyscloud/journey_views/resource_genesyscloud_journey_views_test.go +++ b/genesyscloud/journey_views/resource_genesyscloud_journey_views_test.go @@ -71,6 +71,26 @@ func TestAccResourceJourneyViewsBasic(t *testing.T) { resource.TestCheckResourceAttr("genesyscloud_journey_views."+journeyResource, "elements.0.filter.0.predicates.0.no_value", fmt.Sprintf("%t", predicatesNoValue)), ), }, + { + //Update without filter + Config: generateUserWithCustomAttrs(testUserResource, testUserEmail, testUserName) + generateJourneyView(journeyResource, name, duration, generateElements( + elementsId, + elementsName, + generateAttributes(attributeType, attributeId, attributeSource), + "", + )), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_journey_views."+journeyResource, "name", name), + resource.TestCheckResourceAttr("genesyscloud_journey_views."+journeyResource, "duration", duration), + resource.TestCheckResourceAttr("genesyscloud_journey_views."+journeyResource, "elements.0.id", elementsId), + resource.TestCheckResourceAttr("genesyscloud_journey_views."+journeyResource, "elements.0.name", elementsName), + resource.TestCheckResourceAttr("genesyscloud_journey_views."+journeyResource, "elements.0.attributes.#", "1"), + resource.TestCheckResourceAttr("genesyscloud_journey_views."+journeyResource, "elements.0.attributes.0.type", attributeType), + resource.TestCheckResourceAttr("genesyscloud_journey_views."+journeyResource, "elements.0.attributes.0.id", attributeId), + resource.TestCheckResourceAttr("genesyscloud_journey_views."+journeyResource, "elements.0.attributes.0.source", attributeSource), + resource.TestCheckResourceAttr("genesyscloud_journey_views."+journeyResource, "elements.0.filter.#", "0"), + ), + }, { // Import/Read ResourceName: "genesyscloud_journey_views." + journeyResource, diff --git a/genesyscloud/journey_views/resource_genesyscloud_journey_views_utils.go b/genesyscloud/journey_views/resource_genesyscloud_journey_views_utils.go index b057f62b0..2f6dc4691 100644 --- a/genesyscloud/journey_views/resource_genesyscloud_journey_views_utils.go +++ b/genesyscloud/journey_views/resource_genesyscloud_journey_views_utils.go @@ -33,7 +33,7 @@ func buildElements(d *schema.ResourceData) (*[]platformclientv2.Journeyvieweleme if filterSlice, ok := elemMap["filter"].([]interface{}); ok { filter := buildJourneyViewElementFilter(filterSlice) - element.Filter = &filter + element.Filter = filter } if followedBySlice, ok := elemMap["followed_by"].([]interface{}); ok { @@ -65,7 +65,7 @@ func buildJourneyViewElementAttributes(attributesSlice []interface{}) platformcl return attributes } -func buildJourneyViewElementFilter(filterSlice []interface{}) platformclientv2.Journeyviewelementfilter { +func buildJourneyViewElementFilter(filterSlice []interface{}) *platformclientv2.Journeyviewelementfilter { var filter platformclientv2.Journeyviewelementfilter for _, elem := range filterSlice { if filterMap, ok := elem.(map[string]interface{}); ok { @@ -82,7 +82,10 @@ func buildJourneyViewElementFilter(filterSlice []interface{}) platformclientv2.J } } } - return filter + if len(filterSlice) == 0 { + return nil + } + return &filter } func buildJourneyviewelementfilterpredicate(predicateMap map[string]interface{}) platformclientv2.Journeyviewelementfilterpredicate { From 5e53b21c843d90937e65022ef384e9b31c7da08f Mon Sep 17 00:00:00 2001 From: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Date: Thu, 13 Jun 2024 17:04:00 +0100 Subject: [PATCH 06/62] fix exporter crash (#1101) * fix exporter crash problem * review comment --- genesyscloud/resource_exporter/resource_exporter_custom.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/genesyscloud/resource_exporter/resource_exporter_custom.go b/genesyscloud/resource_exporter/resource_exporter_custom.go index a017efc15..b9ab366e6 100644 --- a/genesyscloud/resource_exporter/resource_exporter_custom.go +++ b/genesyscloud/resource_exporter/resource_exporter_custom.go @@ -139,7 +139,8 @@ This customer custom router will look at the skills array if present and resolve func RuleSetSkillPropertyResolver(configMap map[string]interface{}, exporters map[string]*ResourceExporter, resourceName string) error { if exporter, ok := exporters["genesyscloud_routing_skill"]; ok { - skillIDs := configMap["skills"].(string) + + skillIDs, _ := configMap["skills"].(string) if len(skillIDs) == 0 { return nil @@ -192,7 +193,8 @@ func CampaignStatusResolver(configMap map[string]interface{}, exporters map[stri } func ReplyEmailAddressSelfReferenceRouteExporterResolver(configMap map[string]interface{}, exporters map[string]*ResourceExporter, resourceName string) error { - routeId := configMap["route_id"].(string) + + routeId, _ := configMap["route_id"].(string) currentRouteReference := fmt.Sprintf("${genesyscloud_routing_email_route.%s.id}", resourceName) if routeId == currentRouteReference { configMap["self_reference_route"] = true From 636a20dfeda501932ffc29851ec596e837ff5756 Mon Sep 17 00:00:00 2001 From: sureshperiyappan <61573777+sureshperiyappan@users.noreply.github.com> Date: Fri, 14 Jun 2024 14:20:33 +0530 Subject: [PATCH 07/62] added caching capabilities (#1088) --- .../auth_role/genesyscloud_auth_role_proxy.go | 17 +++++++++++++++++ ...nesyscloud_externalcontacts_contact_proxy.go | 14 ++++++++++++++ ...oud_telephony_providers_edges_phone_proxy.go | 11 +++++++++++ 3 files changed, 42 insertions(+) diff --git a/genesyscloud/auth_role/genesyscloud_auth_role_proxy.go b/genesyscloud/auth_role/genesyscloud_auth_role_proxy.go index cce2393b4..17b60202c 100644 --- a/genesyscloud/auth_role/genesyscloud_auth_role_proxy.go +++ b/genesyscloud/auth_role/genesyscloud_auth_role_proxy.go @@ -3,6 +3,9 @@ package auth_role import ( "context" "fmt" + + rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" + "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" ) @@ -39,14 +42,17 @@ type authRoleProxy struct { deleteAuthRoleAttr deleteAuthRoleFunc restoreDefaultRolesAttr restoreDefaultRolesFunc getAllowedPermissionsAttr getAllowedPermissionsFunc + authRoleCache rc.CacheInterface[platformclientv2.Domainorganizationrole] } // newAuthRoleProxy initializes the auth role proxy with all of the data needed to communicate with Genesys Cloud func newAuthRoleProxy(clientConfig *platformclientv2.Configuration) *authRoleProxy { api := platformclientv2.NewAuthorizationApiWithConfig(clientConfig) + authRoleCache := rc.NewResourceCache[platformclientv2.Domainorganizationrole]() // Create Cache for authRole resource return &authRoleProxy{ clientConfig: clientConfig, authorizationApi: api, + authRoleCache: authRoleCache, createAuthRoleAttr: createAuthRoleFn, getAllAuthRoleAttr: getAllAuthRoleFn, getAuthRoleIdByNameAttr: getAuthRoleIdByNameFn, @@ -85,11 +91,17 @@ func (p *authRoleProxy) getAuthRoleIdByName(ctx context.Context, name string) (i // getAuthRoleById returns a single Genesys Cloud auth role by Id func (p *authRoleProxy) getAuthRoleById(ctx context.Context, id string) (authRole *platformclientv2.Domainorganizationrole, response *platformclientv2.APIResponse, err error) { + if authRole := rc.GetCacheItem(p.authRoleCache, id); authRole != nil { + return authRole, nil, nil + } return p.getAuthRoleByIdAttr(ctx, p, id) } // getAuthRoleById returns a single Genesys Cloud auth role by Id func (p *authRoleProxy) getDefaultRoleById(ctx context.Context, defaultRoleId string) (roleId string, response *platformclientv2.APIResponse, err error) { + if authRole := rc.GetCacheItem(p.authRoleCache, defaultRoleId); authRole != nil { + return *authRole.Id, nil, nil + } return p.getDefaultRoleIdAttr(ctx, p, defaultRoleId) } @@ -148,6 +160,11 @@ func getAllAuthRoleFn(ctx context.Context, p *authRoleProxy) (*[]platformclientv allAuthRoles = append(allAuthRoles, *roles.Entities...) } + //Cache the Auth Role resource into the p.authRoleCache for later use + for _, authRole := range allAuthRoles { + rc.SetCache(p.authRoleCache, *authRole.Id, authRole) + } + return &allAuthRoles, resp, nil } diff --git a/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_proxy.go b/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_proxy.go index 44b582603..d6ef44f8c 100644 --- a/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_proxy.go +++ b/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_proxy.go @@ -5,6 +5,8 @@ import ( "fmt" "log" + rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" + "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" ) @@ -50,14 +52,17 @@ type externalContactsContactsProxy struct { getExternalContactByIdAttr getExternalContactByIdFunc getExternalContactIdBySearchAttr getExternalContactIdBySearchFunc updateExternalContactAttr updateExternalContactFunc + externalContactsCache rc.CacheInterface[platformclientv2.Externalcontact] } // newExternalContactsContactsProxy initializes the External Contacts proxy with all of the data needed to communicate with Genesys Cloud func newExternalContactsContactsProxy(clientConfig *platformclientv2.Configuration) *externalContactsContactsProxy { api := platformclientv2.NewExternalContactsApiWithConfig(clientConfig) + externalContactsCache := rc.NewResourceCache[platformclientv2.Externalcontact]() return &externalContactsContactsProxy{ clientConfig: clientConfig, externalContactsApi: api, + externalContactsCache: externalContactsCache, getAllExternalContactsAttr: getAllExternalContactsFn, createExternalContactAttr: createExternalContactFn, getExternalContactByIdAttr: getExternalContactByIdFn, @@ -93,6 +98,9 @@ func (p *externalContactsContactsProxy) deleteExternalContactId(ctx context.Cont // getExternalContactById returns a single Genesys Cloud External Contact by Id func (p *externalContactsContactsProxy) getExternalContactById(ctx context.Context, externalContactId string) (*platformclientv2.Externalcontact, *platformclientv2.APIResponse, error) { + if externalContacts := rc.GetCacheItem(p.externalContactsCache, externalContactId); externalContacts != nil { // Get the Externalcontact from the cache, if not there in the cache then call p.getExternalContactByIdAttr() + return externalContacts, nil, nil + } return p.getExternalContactByIdAttr(ctx, p, externalContactId) } @@ -130,6 +138,12 @@ func getAllExternalContactsFn(ctx context.Context, p *externalContactsContactsPr } cursor = *externalContacts.Cursors.After } + + // Cache the External Contacts resource into the p.externalContactsCache for later use + for _, externalContact := range allExternalContacts { + rc.SetCache(p.externalContactsCache, *externalContact.Id, externalContact) + } + return &allExternalContacts, response, nil } diff --git a/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_proxy.go b/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_proxy.go index 5fa8a8271..cb4225e0a 100644 --- a/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_proxy.go +++ b/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_proxy.go @@ -6,6 +6,8 @@ import ( "log" "net/http" + rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" + "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" ) @@ -53,6 +55,7 @@ type phoneProxy struct { edgesApi *platformclientv2.TelephonyProvidersEdgeApi stationsApi *platformclientv2.StationsApi usersApi *platformclientv2.UsersApi + phoneCache rc.CacheInterface[platformclientv2.Phone] getAllPhonesAttr getAllPhonesFunc createPhoneAttr createPhoneFunc @@ -73,12 +76,14 @@ func newPhoneProxy(clientConfig *platformclientv2.Configuration) *phoneProxy { edgesApi := platformclientv2.NewTelephonyProvidersEdgeApiWithConfig(clientConfig) stationsApi := platformclientv2.NewStationsApiWithConfig(clientConfig) usersApi := platformclientv2.NewUsersApiWithConfig(clientConfig) + phoneCache := rc.NewResourceCache[platformclientv2.Phone]() return &phoneProxy{ clientConfig: clientConfig, edgesApi: edgesApi, stationsApi: stationsApi, usersApi: usersApi, + phoneCache: phoneCache, getAllPhonesAttr: getAllPhonesFn, createPhoneAttr: createPhoneFn, @@ -116,6 +121,9 @@ func (p *phoneProxy) createPhone(ctx context.Context, phoneConfig *platformclien // getPhoneById retrieves a Genesys Cloud Phone by id func (p *phoneProxy) getPhoneById(ctx context.Context, phoneId string) (*platformclientv2.Phone, *platformclientv2.APIResponse, error) { + if phone := rc.GetCacheItem(p.phoneCache, phoneId); phone != nil { + return phone, nil, nil + } return p.getPhoneByIdAttr(ctx, p, phoneId) } @@ -205,6 +213,9 @@ func getAllPhonesFn(ctx context.Context, p *phoneProxy) (*[]platformclientv2.Pho log.Printf("getAllPhonesFn:: Listing all of the non-deleted phone ids and names that we actually retrieved") for _, phone := range allPhones { log.Printf("getAllPhonesFn:: Retrieved phone id %s with phone name: %s\n", *phone.Id, *phone.Name) + + // Cache the phone resource into the p.phoneCache for later use + rc.SetCache(p.phoneCache, *phone.Id, phone) } return &allPhones, response, nil From 22659d5c9f6f12e0bc7016cf36b12077df51ff78 Mon Sep 17 00:00:00 2001 From: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Date: Mon, 17 Jun 2024 14:39:23 +0100 Subject: [PATCH 08/62] Update Description (#1104) --- .../resource_genesyscloud_task_management_worktype_utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go index 3dff7cf51..22ff63545 100644 --- a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go +++ b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go @@ -82,7 +82,7 @@ func getWorktypeupdateFromResourceData(d *schema.ResourceData, statuses *[]platf worktype := platformclientv2.Worktypeupdate{} worktype.SetField("Name", platformclientv2.String(d.Get("name").(string))) - if d.HasChange("Description") { + if d.HasChange("description") { worktype.SetField("Description", platformclientv2.String(d.Get("description").(string))) } if d.HasChange("default_workbin_id") { From 1200096bf04c98bc194898ee0caa72fc1bb06f58 Mon Sep 17 00:00:00 2001 From: Majharul Islam Rafat Date: Tue, 18 Jun 2024 05:05:57 -0400 Subject: [PATCH 09/62] [JM-1466]: Upgrade the platform client version (#1100) * [JM-1457]: Add resource for journey views * [JM-1457]: import journey view as variable in main.go * [JM-1457]: Remove print statements * [JM-1457]: Refactor code * Remove default values from optional fields * [JM-1457]: Refactor and generate the doc * Remove default value from eventCountType * [JM-1457]: Filter should be nil if not given * Merge with dev * [JM-1457]: Filter should be nil if not given * [JM-1466]: Upgrade platform client version --------- Co-authored-by: Mohammed Islam --- .../data_source_genesyscloud_architect_datatable.go | 2 +- .../resource_genesyscloud_architect_datatable.go | 2 +- .../resource_genesyscloud_architect_datatable_proxy.go | 2 +- .../resource_genesyscloud_architect_datatable_test.go | 2 +- .../genesyscloud_architect_datatable_row_utils.go | 2 +- .../resource_genesyscloud_architect_datatable_row.go | 2 +- .../resource_genesyscloud_architect_datatable_row_proxy.go | 2 +- .../resource_genesyscloud_architect_datatable_row_test.go | 2 +- .../genesyscloud_architect_emergencygroup_proxy.go | 2 +- .../resource_genesyscloud_architect_emergencygroup.go | 2 +- .../resource_genesyscloud_architect_emergencygroup_test.go | 2 +- .../resource_genesyscloud_architect_emergencygroup_utils.go | 2 +- .../resource_genesyscloud_architect_flow_proxy.go | 2 +- genesyscloud/architect_flow/resource_genesyscloud_flow.go | 2 +- .../architect_flow/resource_genesyscloud_flow_test.go | 2 +- .../genesyscloud_architect_grammar_proxy.go | 2 +- .../resource_genesyscloud_architect_grammar.go | 2 +- .../resource_genesyscloud_architect_grammar_test.go | 2 +- .../genesyscloud_architect_grammar_language_proxy.go | 2 +- .../resource_genesyscloud_architect_grammar_language.go | 2 +- ...resource_genesyscloud_architect_grammar_language_test.go | 2 +- ...esource_genesyscloud_architect_grammar_language_utils.go | 2 +- .../data_source_genesyscloud_architect_ivr_test.go | 2 +- .../architect_ivr/genesyscloud_architect_ivr_proxy.go | 2 +- .../genesyscloud_architect_ivr_proxy_unit_test.go | 2 +- .../architect_ivr/resource_genesyscloud_architect_ivr.go | 2 +- .../resource_genesyscloud_architect_ivr_test.go | 2 +- .../resource_genesyscloud_architect_ivr_unit_test.go | 2 +- .../resource_genesyscloud_architect_ivr_utils.go | 2 +- .../genesyscloud_architect_schedulegroups_proxy.go | 2 +- .../resource_genesyscloud_architect_schedulegroups.go | 2 +- .../resource_genesyscloud_architect_schedulegroups_test.go | 2 +- .../genesyscloud_architect_schedules_proxy.go | 2 +- .../resource_genesyscloud_architect_schedules.go | 2 +- .../resource_genesyscloud_architect_schedules_test.go | 2 +- .../genesyscloud_architect_user_prompt_proxy.go | 2 +- .../resource_genesyscloud_architect_user_prompt.go | 2 +- .../resource_genesyscloud_architect_user_prompt_test.go | 2 +- .../resource_genesyscloud_architect_user_prompt_utils.go | 2 +- .../auth_role/data_source_genesyscloud_auth_role.go | 2 +- genesyscloud/auth_role/genesyscloud_auth_role_proxy.go | 2 +- genesyscloud/auth_role/resource_genesyscloud_auth_role.go | 2 +- .../auth_role/resource_genesyscloud_auth_role_test.go | 2 +- .../auth_role/resource_genesyscloud_auth_role_utils.go | 2 +- .../data_source_genesyscloud_authorization_product_test.go | 2 +- .../genesyscloud_authorization_product_proxy.go | 2 +- .../data_source_genesyscloud_architect_schedules.go | 2 +- genesyscloud/data_source_genesyscloud_auth_division.go | 2 +- genesyscloud/data_source_genesyscloud_auth_division_home.go | 2 +- genesyscloud/data_source_genesyscloud_journey_action_map.go | 2 +- .../data_source_genesyscloud_journey_action_template.go | 2 +- genesyscloud/data_source_genesyscloud_journey_outcome.go | 2 +- genesyscloud/data_source_genesyscloud_journey_segment.go | 2 +- genesyscloud/data_source_genesyscloud_knowledge_category.go | 2 +- .../data_source_genesyscloud_knowledge_knowledgebase.go | 2 +- genesyscloud/data_source_genesyscloud_knowledge_label.go | 2 +- genesyscloud/data_source_genesyscloud_location.go | 2 +- genesyscloud/data_source_genesyscloud_organizations_me.go | 2 +- .../data_source_genesyscloud_quality_forms_evaluation.go | 2 +- .../data_source_genesyscloud_quality_forms_survey.go | 2 +- .../data_source_genesyscloud_routing_email_domain.go | 2 +- .../data_source_genesyscloud_routing_email_domain_test.go | 2 +- genesyscloud/data_source_genesyscloud_routing_language.go | 2 +- genesyscloud/data_source_genesyscloud_routing_settings.go | 2 +- genesyscloud/data_source_genesyscloud_routing_skill.go | 2 +- .../data_source_genesyscloud_routing_skill_group.go | 2 +- .../data_source_genesyscloud_routing_utilization_label.go | 2 +- genesyscloud/data_source_genesyscloud_routing_wrapupcode.go | 2 +- genesyscloud/data_source_genesyscloud_user.go | 2 +- genesyscloud/data_source_genesyscloud_widget_deployment.go | 2 +- .../genesyscloud_dependent_consumer_proxy.go | 2 +- ...employeeperformance_externalmetrics_definitions_proxy.go | 2 +- ...cloud_employeeperformance_externalmetrics_definitions.go | 2 +- ..._employeeperformance_externalmetrics_definitions_test.go | 2 +- .../genesyscloud_externalcontacts_contact_proxy.go | 2 +- .../resource_genesyscloud_externalcontacts_contact.go | 2 +- .../resource_genesyscloud_externalcontacts_contact_test.go | 2 +- .../resource_genesyscloud_externalcontacts_contact_utils.go | 2 +- .../flow_loglevel/genesyscloud_flow_loglevel_proxy.go | 2 +- .../flow_loglevel/resource_genesyscloud_flow_loglevel.go | 2 +- .../resource_genesyscloud_flow_loglevel_test.go | 2 +- .../flow_milestone/genesyscloud_flow_milestone_proxy.go | 2 +- .../flow_milestone/resource_genesyscloud_flow_milestone.go | 2 +- .../resource_genesyscloud_flow_milestone_test.go | 2 +- .../resource_genesyscloud_flow_milestone_utils.go | 2 +- .../flow_outcome/genesyscloud_flow_outcome_proxy.go | 2 +- .../flow_outcome/resource_genesyscloud_flow_outcome.go | 2 +- .../resource_genesyscloud_flow_outcome_utils.go | 2 +- genesyscloud/group/data_source_genesyscloud_group_test.go | 2 +- genesyscloud/group/genesyscloud_group_proxy.go | 2 +- genesyscloud/group/resource_genesyscloud_group.go | 2 +- genesyscloud/group/resource_genesyscloud_group_test.go | 2 +- genesyscloud/group/resource_genesyscloud_group_utils.go | 2 +- genesyscloud/group_roles/genesyscloud_group_roles_proxy.go | 2 +- .../group_roles/resource_genesyscloud_group_roles_schema.go | 2 +- .../group_roles/resource_genesyscloud_group_roles_utils.go | 2 +- genesyscloud/idp_adfs/genesyscloud_idp_adfs_proxy.go | 2 +- genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs.go | 2 +- .../idp_adfs/resource_genesyscloud_idp_adfs_test.go | 2 +- genesyscloud/idp_okta/genesyscloud_idp_okta_proxy.go | 2 +- genesyscloud/idp_okta/resource_genesyscloud_idp_okta.go | 2 +- .../idp_okta/resource_genesyscloud_idp_okta_test.go | 2 +- .../idp_salesforce/genesyscloud_idp_salesforce_proxy.go | 2 +- .../idp_salesforce/resource_genesyscloud_idp_salesforce.go | 2 +- .../resource_genesyscloud_idp_salesforce_test.go | 2 +- genesyscloud/integration/genesyscloud_integration_proxy.go | 2 +- .../integration/resource_genesyscloud_integration.go | 2 +- .../integration/resource_genesyscloud_integration_test.go | 2 +- .../integration/resource_genesyscloud_integration_utils.go | 2 +- .../genesyscloud_integration_action_proxy.go | 2 +- .../resource_genesyscloud_integration_action.go | 2 +- .../resource_genesyscloud_integration_action_test.go | 2 +- .../resource_genesyscloud_integration_action_utils.go | 2 +- .../genesyscloud_integration_credential_proxy.go | 2 +- .../resource_genesyscloud_integration_credential.go | 2 +- .../resource_genesyscloud_integration_credential_test.go | 2 +- .../genesyscloud_integration_custom_auth_action_proxy.go | 2 +- .../resource_genesyscloud_integration_custom_auth_action.go | 2 +- ...urce_genesyscloud_integration_custom_auth_action_test.go | 2 +- ...rce_genesyscloud_integration_custom_auth_action_utils.go | 2 +- .../genesyscloud_journey_outcome_predictor_proxy.go | 2 +- .../resource_genesyscloud_journey_outcome_predictor.go | 2 +- .../resource_genesyscloud_journey_outcome_predictor_test.go | 2 +- .../journey_views/genesyscloud_journey_views_proxy.go | 2 +- .../journey_views/resource_genesyscloud_journey_views.go | 4 ++-- .../resource_genesyscloud_journey_views_test.go | 2 +- .../resource_genesyscloud_journey_views_utils.go | 2 +- .../oauth_client/resource_genesyscloud_oauth_client.go | 2 +- .../resource_genesyscloud_oauth_client_proxy.go | 2 +- .../resource_genesyscloud_oauth_client_utils.go | 2 +- .../resource_genesyscloude_oauth_client_unit_test.go | 2 +- ...nesyscloud_organization_authentication_settings_proxy.go | 2 +- ...rce_genesyscloud_organization_authentication_settings.go | 2 +- ...scloud_organization_authentication_settings_unit_test.go | 2 +- ...nesyscloud_organization_authentication_settings_utils.go | 2 +- .../genesyscloud_orgauthorization_pairing_proxy.go | 2 +- .../resource_genesyscloud_orgauthorization_pairing.go | 2 +- .../data_source_genesyscloud_outbound_cattemptlimit.go | 2 +- .../data_source_genesyscloud_outbound_messagingcampaign.go | 2 +- ...a_source_genesyscloud_outbound_messagingcampaign_test.go | 2 +- .../resource_genesyscloud_outbound_messagingcampaign.go | 2 +- ...resource_genesyscloud_outbound_messagingcampaign_test.go | 2 +- .../data_source_genesyscloud_outbound_attemptlimit.go | 2 +- .../resource_genesyscloud_outbound_attemptlimit.go | 2 +- .../resource_genesyscloud_outbound_attemptlimit_test.go | 2 +- .../genesyscloud_outbound_callabletimeset_proxy.go | 2 +- .../resource_genesyscloud_outbound_callabletimeset.go | 2 +- .../resource_genesyscloud_outbound_callabletimeset_test.go | 2 +- .../resource_genesyscloud_outbound_callabletimeset_utils.go | 2 +- .../genesyscloud_outbound_callanalysisresponseset_proxy.go | 2 +- ...esource_genesyscloud_outbound_callanalysisresponseset.go | 2 +- ...ce_genesyscloud_outbound_callanalysisresponseset_test.go | 2 +- ...e_genesyscloud_outbound_callanalysisresponseset_utils.go | 2 +- .../genesyscloud_outbound_campaign_init_test.go | 2 +- .../genesyscloud_outbound_campaign_proxy.go | 2 +- .../resource_genesyscloud_outbound_campaign.go | 2 +- .../resource_genesyscloud_outbound_campaign_test.go | 2 +- .../resource_genesyscloud_outbound_campaign_utils.go | 2 +- .../data_source_genesyscloud_outbound_campaignrule.go | 2 +- .../genesyscloud_outbound_campaignrule_proxy.go | 2 +- .../resource_genesyscloud_outbound_campaignrule.go | 2 +- .../resource_genesyscloud_outbound_campaignrule_test.go | 2 +- ...resource_genesyscloud_outbound_campaignrule_unit_test.go | 2 +- .../resource_genesyscloud_outbound_campaignrule_utils.go | 2 +- .../data_source_genesyscloud_outbound_contactlist.go | 2 +- .../resource_genesyscloud_outbound_contactlist.go | 2 +- .../resource_genesyscloud_outbound_contactlist_test.go | 2 +- .../genesyscloud_outbound_contactlistfilter_proxy.go | 2 +- .../resource_genesyscloud_outbound_contactlistfilter.go | 2 +- ...resource_genesyscloud_outbound_contactlistfilter_test.go | 2 +- ...esource_genesyscloud_outbound_contactlistfilter_utils.go | 2 +- .../outbound_dnclist/genesyscloud_outbound_dnclist_proxy.go | 2 +- .../resource_genesyscloud_outbound_dnclist.go | 2 +- .../resource_genesyscloud_outbound_dnclist_test.go | 2 +- ...genesyscloud_outbound_filespecificationtemplate_proxy.go | 2 +- ...ource_genesyscloud_outbound_filespecificationtemplate.go | 2 +- ..._genesyscloud_outbound_filespecificationtemplate_test.go | 2 +- ...genesyscloud_outbound_filespecificationtemplate_utils.go | 2 +- .../outbound_ruleset/genesyscloud_outbound_ruleset_proxy.go | 2 +- .../resource_genesyscloud_outbound_ruleset.go | 2 +- .../resource_genesyscloud_outbound_ruleset_test.go | 2 +- .../resource_genesyscloud_outbound_ruleset_unit_test.go | 2 +- .../resource_genesyscloud_outbound_ruleset_utils.go | 2 +- .../genesyscloud_outbound_sequence_init_test.go | 2 +- .../genesyscloud_outbound_sequence_proxy.go | 2 +- .../resource_genesyscloud_outbound_sequence.go | 2 +- .../resource_genesyscloud_outbound_sequence_test.go | 2 +- .../resource_genesyscloud_outbound_sequence_utils.go | 2 +- .../genesyscloud_outbound_settings_proxy.go | 2 +- .../resource_genesyscloud_outbound_settings.go | 2 +- .../resource_genesyscloud_outbound_settings_utils.go | 2 +- .../genesyscloud_wrapupcode_mappings_proxy.go | 2 +- ...ource_genesyscloud_outbound_wrapupcode_mappings_utils.go | 2 +- .../resource_genesyscloud_outbound_wrapupcodemappings.go | 2 +- .../data_source_genesyscloud_processautomation_trigger.go | 2 +- .../process_automation_triggers_proxy.go | 2 +- .../process_automations_triggers_struct.go | 2 +- .../resource_genesyscloud_processautomation_trigger.go | 2 +- .../resource_genesyscloud_processautomation_trigger_test.go | 2 +- genesyscloud/provider/division.go | 2 +- genesyscloud/provider/provider.go | 2 +- genesyscloud/provider/sdk_client_pool.go | 2 +- ...nesyscloud_recording_media_retention_policy_init_test.go | 2 +- .../genesyscloud_recording_media_retention_policy_proxy.go | 2 +- ...esource_genesyscloud_recording_media_retention_policy.go | 2 +- ...ce_genesyscloud_recording_media_retention_policy_test.go | 2 +- ...e_genesyscloud_recording_media_retention_policy_utils.go | 2 +- genesyscloud/resource_cache/datasource_cache.go | 2 +- genesyscloud/resource_exporter/resource_exporter.go | 2 +- genesyscloud/resource_exporter/resource_exporter_custom.go | 2 +- genesyscloud/resource_genesyscloud_architect_schedules.go | 2 +- genesyscloud/resource_genesyscloud_auth_division.go | 2 +- genesyscloud/resource_genesyscloud_auth_division_test.go | 2 +- genesyscloud/resource_genesyscloud_idp_generic.go | 2 +- genesyscloud/resource_genesyscloud_idp_generic_test.go | 2 +- genesyscloud/resource_genesyscloud_idp_gsuite.go | 2 +- genesyscloud/resource_genesyscloud_idp_gsuite_test.go | 2 +- genesyscloud/resource_genesyscloud_idp_onelogin.go | 2 +- genesyscloud/resource_genesyscloud_idp_onelogin_test.go | 2 +- genesyscloud/resource_genesyscloud_idp_ping.go | 2 +- genesyscloud/resource_genesyscloud_idp_ping_test.go | 2 +- genesyscloud/resource_genesyscloud_init_test.go | 2 +- genesyscloud/resource_genesyscloud_journey_action_map.go | 2 +- .../resource_genesyscloud_journey_action_map_test.go | 2 +- .../resource_genesyscloud_journey_action_template.go | 2 +- .../resource_genesyscloud_journey_action_template_test.go | 2 +- genesyscloud/resource_genesyscloud_journey_outcome.go | 2 +- genesyscloud/resource_genesyscloud_journey_outcome_test.go | 2 +- genesyscloud/resource_genesyscloud_journey_segment.go | 2 +- genesyscloud/resource_genesyscloud_journey_segment_test.go | 2 +- genesyscloud/resource_genesyscloud_knowledge_category.go | 2 +- .../resource_genesyscloud_knowledge_category_test.go | 2 +- genesyscloud/resource_genesyscloud_knowledge_document.go | 2 +- .../resource_genesyscloud_knowledge_document_test.go | 2 +- .../resource_genesyscloud_knowledge_document_variation.go | 2 +- ...source_genesyscloud_knowledge_document_variation_test.go | 2 +- .../resource_genesyscloud_knowledge_knowledgebase.go | 2 +- .../resource_genesyscloud_knowledge_knowledgebase_test.go | 2 +- genesyscloud/resource_genesyscloud_knowledge_label.go | 2 +- genesyscloud/resource_genesyscloud_knowledge_label_test.go | 2 +- genesyscloud/resource_genesyscloud_knowledge_v1_category.go | 2 +- .../resource_genesyscloud_knowledge_v1_category_test.go | 2 +- genesyscloud/resource_genesyscloud_knowledge_v1_document.go | 2 +- .../resource_genesyscloud_knowledge_v1_document_test.go | 2 +- genesyscloud/resource_genesyscloud_location.go | 2 +- genesyscloud/resource_genesyscloud_location_test.go | 2 +- .../resource_genesyscloud_quality_forms_evaluation.go | 2 +- .../resource_genesyscloud_quality_forms_evaluation_test.go | 2 +- genesyscloud/resource_genesyscloud_quality_forms_survey.go | 2 +- .../resource_genesyscloud_quality_forms_survey_test.go | 2 +- genesyscloud/resource_genesyscloud_routing_email_domain.go | 2 +- .../resource_genesyscloud_routing_email_domain_test.go | 2 +- genesyscloud/resource_genesyscloud_routing_language.go | 2 +- genesyscloud/resource_genesyscloud_routing_language_test.go | 2 +- genesyscloud/resource_genesyscloud_routing_settings.go | 2 +- genesyscloud/resource_genesyscloud_routing_skill.go | 2 +- genesyscloud/resource_genesyscloud_routing_skill_group.go | 2 +- .../resource_genesyscloud_routing_skill_group_test.go | 2 +- genesyscloud/resource_genesyscloud_routing_skill_test.go | 2 +- genesyscloud/resource_genesyscloud_routing_utilization.go | 2 +- .../resource_genesyscloud_routing_utilization_label.go | 2 +- .../resource_genesyscloud_routing_utilization_label_test.go | 2 +- .../resource_genesyscloud_routing_utilization_test.go | 2 +- genesyscloud/resource_genesyscloud_routing_wrapupcode.go | 2 +- .../resource_genesyscloud_routing_wrapupcode_test.go | 2 +- genesyscloud/resource_genesyscloud_user.go | 2 +- genesyscloud/resource_genesyscloud_user_test.go | 2 +- genesyscloud/resource_genesyscloud_widget_deployment.go | 2 +- .../resource_genesyscloud_widget_deployment_test.go | 2 +- .../genesyscloud_responsemanagement_library_proxy.go | 2 +- .../resource_genesyscloud_responsemanagement_library.go | 2 +- ...resource_genesyscloud_responsemanagement_library_test.go | 2 +- .../genesyscloud_responsemanagement_response_proxy.go | 2 +- .../resource_genesyscloud_responsemanagement_response.go | 2 +- ...esource_genesyscloud_responsemanagement_response_test.go | 2 +- ...source_genesyscloud_responsemanagement_response_utils.go | 2 +- .../genesyscloud_responsemanagement_responseasset_proxy.go | 2 +- ...esource_genesyscloud_responsemanagement_responseasset.go | 2 +- ...ce_genesyscloud_responsemanagement_responseasset_test.go | 2 +- .../genesyscloud_routing_email_route_proxy.go | 2 +- .../resource_genesyscloud_routing_email_route.go | 2 +- .../resource_genesyscloud_routing_email_route_test.go | 2 +- .../resource_genesyscloud_routing_email_route_utils.go | 2 +- .../routing_queue/data_source_genesyscloud_routing_queue.go | 2 +- .../routing_queue/genesyscloud_routing_queue_proxy.go | 2 +- .../routing_queue/resource_genesyscloud_routing_queue.go | 2 +- .../resource_genesyscloud_routing_queue_test.go | 2 +- ...yscloud_routing_queue_conditional_group_routing_proxy.go | 2 +- ..._genesyscloud_routing_queue_conditional_group_routing.go | 2 +- ...syscloud_routing_queue_conditional_group_routing_test.go | 2 +- ...oud_routing_queue_conditional_group_routing_unit_test.go | 2 +- ...nesyscloud_routing_queue_outbound_email_address_proxy.go | 2 +- ...rce_genesyscloud_routing_queue_outbound_email_address.go | 2 +- ...enesyscloud_routing_queue_outbound_email_address_test.go | 2 +- ...scloud_routing_queue_outbound_email_address_unit_test.go | 2 +- .../genesyscloud_routing_sms_addresses_proxy.go | 2 +- .../resource_genesyscloud_routing_sms_addresses.go | 2 +- .../resource_genesyscloud_routing_sms_addresses_test.go | 2 +- genesyscloud/scripts/genesyscloud_scripts_proxy.go | 2 +- genesyscloud/scripts/resource_genesyscloud_script.go | 2 +- genesyscloud/scripts/resource_genesyscloud_script_test.go | 2 +- genesyscloud/station/genesyscloud_station_init_test.go | 2 +- genesyscloud/station/genesyscloud_station_proxy.go | 2 +- .../genesyscloud_task_management_workbin_proxy.go | 2 +- .../resource_genesyscloud_task_management_workbin.go | 2 +- .../resource_genesyscloud_task_management_workbin_test.go | 2 +- .../genesyscloud_task_management_workitem_proxy.go | 2 +- .../resource_genesyscloud_task_management_workitem.go | 2 +- .../resource_genesyscloud_task_management_workitem_test.go | 2 +- ...ource_genesyscloud_task_management_workitem_unit_test.go | 2 +- .../resource_genesyscloud_task_management_workitem_utils.go | 2 +- .../genesyscloud_task_management_workitem_schema_proxy.go | 2 +- ...resource_genesyscloud_task_management_workitem_schema.go | 2 +- ...rce_genesyscloud_task_management_workitem_schema_test.go | 2 +- ...enesyscloud_task_management_workitem_schema_unit_test.go | 2 +- ...ce_genesyscloud_task_management_workitem_schema_utils.go | 2 +- .../data_source_genesyscloud_task_management_unit_test.go | 2 +- .../genesyscloud_task_management_worktype_proxy.go | 2 +- .../resource_genesyscloud_task_management_worktype.go | 2 +- .../resource_genesyscloud_task_management_worktype_test.go | 2 +- ...ource_genesyscloud_task_management_worktype_unit_test.go | 2 +- .../resource_genesyscloud_task_management_worktype_utils.go | 2 +- genesyscloud/team/genesyscloud_team_proxy.go | 2 +- genesyscloud/team/resource_genesyscloud_team.go | 2 +- genesyscloud/team/resource_genesyscloud_team_test.go | 2 +- genesyscloud/team/resource_genesyscloud_team_unit_test.go | 2 +- genesyscloud/team/resource_genesyscloud_team_utils.go | 2 +- ...esyscloud_telephony_providers_edges_trunkbasesettings.go | 2 +- ...loud_telephony_providers_edges_trunkbasesettings_test.go | 2 +- .../genesyscloud_telephony_providers_edges_did_proxy.go | 2 +- ...genesyscloud_telephony_providers_edges_did_pool_proxy.go | 2 +- ...ource_genesyscloud_telephony_providers_edges_did_pool.go | 2 +- ..._genesyscloud_telephony_providers_edges_did_pool_test.go | 2 +- ...genesyscloud_telephony_providers_edges_did_pool_utils.go | 2 +- ...nesyscloud_telephony_providers_edges_edge_group_proxy.go | 2 +- ...rce_genesyscloud_telephony_providers_edges_edge_group.go | 2 +- ...enesyscloud_telephony_providers_edges_edge_group_test.go | 2 +- ...nesyscloud_telephony_providers_edges_edge_group_utils.go | 2 +- ...scloud_telephony_providers_edges_extension_pool_proxy.go | 2 +- ...genesyscloud_telephony_providers_edges_extension_pool.go | 2 +- ...yscloud_telephony_providers_edges_extension_pool_test.go | 2 +- ...nesyscloud_telephony_providers_edges_linebasesettings.go | 2 +- ...enesyscloud_telephony_providers_edges_phone_init_test.go | 2 +- .../genesyscloud_telephony_providers_edges_phone_proxy.go | 2 +- ...resource_genesyscloud_telephony_providers_edges_phone.go | 2 +- ...rce_genesyscloud_telephony_providers_edges_phone_test.go | 2 +- ...ce_genesyscloud_telephony_providers_edges_phone_utils.go | 2 +- ...esyscloud_telephony_providers_edges_phonebasesettings.go | 2 +- ...oud_telephony_providers_edges_phonebasesettings_proxy.go | 2 +- ...esyscloud_telephony_providers_edges_phonebasesettings.go | 2 +- ...loud_telephony_providers_edges_phonebasesettings_test.go | 2 +- ...oud_telephony_providers_edges_phonebasesettings_utils.go | 2 +- ...urce_genesyscloud_telephony_providers_edges_site_test.go | 2 +- .../genesyscloud_telephony_providers_edges_site_proxy.go | 2 +- .../resource_genesyscloud_telephony_providers_edges_site.go | 2 +- ...ce_genesyscloud_telephony_providers_edges_site_schema.go | 2 +- ...urce_genesyscloud_telephony_providers_edges_site_test.go | 2 +- ...rce_genesyscloud_telephony_providers_edges_site_utils.go | 2 +- ...lephony_providers_edges_site_outbound_route_init_test.go | 2 +- ...d_telephony_providers_edges_site_outbound_route_proxy.go | 2 +- ...yscloud_telephony_providers_edges_site_outbound_route.go | 2 +- ...d_telephony_providers_edges_site_outbound_route_utils.go | 2 +- ...a_source_genesyscloud_telephony_providers_edges_trunk.go | 2 +- .../genesyscloud_telephony_providers_edges_trunk_proxy.go | 2 +- ...resource_genesyscloud_telephony_providers_edges_trunk.go | 2 +- genesyscloud/tfexporter/genesyscloud_resource_exporter.go | 2 +- .../tfexporter/genesyscloud_resource_exporter_test.go | 2 +- .../tfexporter/resource_genesyscloud_tf_export_test.go | 2 +- genesyscloud/user_roles/genesyscloud_user_roles_proxy.go | 2 +- .../user_roles/resource_genesyscloud_user_roles_utils.go | 2 +- genesyscloud/util/resourcedata/resourcedata.go | 2 +- genesyscloud/util/util_basesetting_properties.go | 2 +- genesyscloud/util/util_diagnostic_unit_test.go | 2 +- genesyscloud/util/util_diagnostics.go | 2 +- genesyscloud/util/util_divisions.go | 2 +- genesyscloud/util/util_domainentities.go | 2 +- genesyscloud/util/util_retries.go | 2 +- .../genesyscloud_webdeployments_configuration_proxy.go | 2 +- .../resource_genesyscloud_webdeployments_configuration.go | 2 +- ...source_genesyscloud_webdeployments_configuration_test.go | 2 +- ...rce_genesyscloud_webdeployments_configuration_journey.go | 2 +- ...e_genesyscloud_webdeployments_configuration_messenger.go | 2 +- ...esyscloud_webdeployments_configuration_support_center.go | 2 +- ...ource_genesyscloud_webdeployments_configuration_utils.go | 4 ++-- .../genesyscloud_webdeployments_deployment_proxy.go | 2 +- .../resource_genesyscloud_webdeployments_deployment.go | 2 +- .../resource_genesyscloud_webdeployments_deployment_test.go | 2 +- ...resource_genesyscloud_webdeployments_deployment_utils.go | 2 +- go.mod | 2 +- go.sum | 6 ++++-- 390 files changed, 395 insertions(+), 393 deletions(-) diff --git a/genesyscloud/architect_datatable/data_source_genesyscloud_architect_datatable.go b/genesyscloud/architect_datatable/data_source_genesyscloud_architect_datatable.go index 417f3779c..fe8f6f8e6 100644 --- a/genesyscloud/architect_datatable/data_source_genesyscloud_architect_datatable.go +++ b/genesyscloud/architect_datatable/data_source_genesyscloud_architect_datatable.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func DataSourceArchitectDatatableRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { diff --git a/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable.go b/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable.go index 166cd32e5..0aa344ef2 100644 --- a/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable.go +++ b/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type Datatableproperty struct { diff --git a/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_proxy.go b/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_proxy.go index 8b65f6468..9223c15f3 100644 --- a/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_proxy.go +++ b/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_proxy.go @@ -6,7 +6,7 @@ import ( "errors" "net/http" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // internalProxy holds a proxy instance that can be used throughout the package diff --git a/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_test.go b/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_test.go index 89f10ec74..bd6b97a9e 100644 --- a/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_test.go +++ b/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceArchitectDatatable(t *testing.T) { diff --git a/genesyscloud/architect_datatable_row/genesyscloud_architect_datatable_row_utils.go b/genesyscloud/architect_datatable_row/genesyscloud_architect_datatable_row_utils.go index 669cc7e6e..a346d63de 100644 --- a/genesyscloud/architect_datatable_row/genesyscloud_architect_datatable_row_utils.go +++ b/genesyscloud/architect_datatable_row/genesyscloud_architect_datatable_row_utils.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // Row IDs structured as {table-id}/{key-value} diff --git a/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row.go b/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row.go index abf3efdf7..74a126ee4 100644 --- a/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row.go +++ b/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type Datatableproperty struct { diff --git a/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_proxy.go b/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_proxy.go index 300169eb9..1f94400bc 100644 --- a/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_proxy.go +++ b/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_proxy.go @@ -5,7 +5,7 @@ import ( "encoding/json" "errors" "github.com/mitchellh/mapstructure" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "net/http" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" diff --git a/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_test.go b/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_test.go index 9acccd551..070e1bc05 100644 --- a/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_test.go +++ b/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_test.go @@ -11,7 +11,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceArchitectDatatableRow(t *testing.T) { diff --git a/genesyscloud/architect_emergencygroup/genesyscloud_architect_emergencygroup_proxy.go b/genesyscloud/architect_emergencygroup/genesyscloud_architect_emergencygroup_proxy.go index ac8b2a6d1..01d41745a 100644 --- a/genesyscloud/architect_emergencygroup/genesyscloud_architect_emergencygroup_proxy.go +++ b/genesyscloud/architect_emergencygroup/genesyscloud_architect_emergencygroup_proxy.go @@ -3,7 +3,7 @@ package architect_emergencygroup import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var internalProxy *architectEmergencyGroupProxy diff --git a/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup.go b/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup.go index 4e2f8622d..9523a2472 100644 --- a/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup.go +++ b/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllEmergencyGroups(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_test.go b/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_test.go index fdc824edb..0cf52ad50 100644 --- a/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_test.go +++ b/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceArchitectEmergencyGroups(t *testing.T) { diff --git a/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_utils.go b/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_utils.go index e2ba82d75..11ecb8e35 100644 --- a/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_utils.go +++ b/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_utils.go @@ -2,7 +2,7 @@ package architect_emergencygroup import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func buildSdkEmergencyGroupCallFlows(d *schema.ResourceData) *[]platformclientv2.Emergencycallflow { diff --git a/genesyscloud/architect_flow/resource_genesyscloud_architect_flow_proxy.go b/genesyscloud/architect_flow/resource_genesyscloud_architect_flow_proxy.go index 219ff6ece..f0642e4e5 100644 --- a/genesyscloud/architect_flow/resource_genesyscloud_architect_flow_proxy.go +++ b/genesyscloud/architect_flow/resource_genesyscloud_architect_flow_proxy.go @@ -3,7 +3,7 @@ package architect_flow import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" ) diff --git a/genesyscloud/architect_flow/resource_genesyscloud_flow.go b/genesyscloud/architect_flow/resource_genesyscloud_flow.go index b5693448c..6c70707fd 100644 --- a/genesyscloud/architect_flow/resource_genesyscloud_flow.go +++ b/genesyscloud/architect_flow/resource_genesyscloud_flow.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllFlows(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/architect_flow/resource_genesyscloud_flow_test.go b/genesyscloud/architect_flow/resource_genesyscloud_flow_test.go index 4066bc273..bb721ed40 100644 --- a/genesyscloud/architect_flow/resource_genesyscloud_flow_test.go +++ b/genesyscloud/architect_flow/resource_genesyscloud_flow_test.go @@ -17,7 +17,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // lockFlow will search for a specific flow and then lock it. This is to specifically test the force_unlock flag where I want to create a flow, simulate some one locking it and then attempt to diff --git a/genesyscloud/architect_grammar/genesyscloud_architect_grammar_proxy.go b/genesyscloud/architect_grammar/genesyscloud_architect_grammar_proxy.go index 45a5a593f..36c73863d 100644 --- a/genesyscloud/architect_grammar/genesyscloud_architect_grammar_proxy.go +++ b/genesyscloud/architect_grammar/genesyscloud_architect_grammar_proxy.go @@ -6,7 +6,7 @@ import ( "log" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar.go b/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar.go index 0017ec632..6fe8bff54 100644 --- a/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar.go +++ b/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar_test.go b/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar_test.go index 05f319590..6d81a2d27 100644 --- a/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar_test.go +++ b/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceArchitectGrammar(t *testing.T) { diff --git a/genesyscloud/architect_grammar_language/genesyscloud_architect_grammar_language_proxy.go b/genesyscloud/architect_grammar_language/genesyscloud_architect_grammar_language_proxy.go index 6f081a407..6647b9801 100644 --- a/genesyscloud/architect_grammar_language/genesyscloud_architect_grammar_language_proxy.go +++ b/genesyscloud/architect_grammar_language/genesyscloud_architect_grammar_language_proxy.go @@ -8,7 +8,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/files" "time" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type FileType int diff --git a/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language.go b/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language.go index 4a376d7b8..b8423f1a4 100644 --- a/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language.go +++ b/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_test.go b/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_test.go index e36831ea4..7bc029fd3 100644 --- a/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_test.go +++ b/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_test.go @@ -15,7 +15,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceArchitectGrammarLanguage(t *testing.T) { diff --git a/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_utils.go b/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_utils.go index 58504f1f2..97f30023c 100644 --- a/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_utils.go +++ b/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_utils.go @@ -13,7 +13,7 @@ import ( "time" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/architect_ivr/data_source_genesyscloud_architect_ivr_test.go b/genesyscloud/architect_ivr/data_source_genesyscloud_architect_ivr_test.go index e04f747f2..97345394d 100644 --- a/genesyscloud/architect_ivr/data_source_genesyscloud_architect_ivr_test.go +++ b/genesyscloud/architect_ivr/data_source_genesyscloud_architect_ivr_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/stretchr/testify/assert" "github.com/google/uuid" diff --git a/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy.go b/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy.go index d9cec0a4f..fdd8c9c55 100644 --- a/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy.go +++ b/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy.go @@ -7,7 +7,7 @@ import ( utillists "terraform-provider-genesyscloud/genesyscloud/util/lists" "time" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy_unit_test.go b/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy_unit_test.go index 723cd5c40..9c00434e0 100644 --- a/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy_unit_test.go +++ b/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy_unit_test.go @@ -11,7 +11,7 @@ import ( "testing" "github.com/google/uuid" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestUnitUploadIvrDnisChunksSuccess(t *testing.T) { diff --git a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr.go b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr.go index 35be99a30..ab6fb8e76 100644 --- a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr.go +++ b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // getAllIvrConfigs retrieves all architect IVRs and is used for the exporter diff --git a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_test.go b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_test.go index fcf3df126..166d0320e 100644 --- a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_test.go +++ b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceIvrConfigBasic(t *testing.T) { diff --git a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_unit_test.go b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_unit_test.go index 4f7751e75..b5c97be4b 100644 --- a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_unit_test.go +++ b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_unit_test.go @@ -11,7 +11,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/stretchr/testify/assert" ) diff --git a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_utils.go b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_utils.go index be422dd34..cfe4f8446 100644 --- a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_utils.go +++ b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_utils.go @@ -8,7 +8,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type IvrConfigStruct struct { diff --git a/genesyscloud/architect_schedulegroups/genesyscloud_architect_schedulegroups_proxy.go b/genesyscloud/architect_schedulegroups/genesyscloud_architect_schedulegroups_proxy.go index 53f3b06ef..44bf1b3ee 100644 --- a/genesyscloud/architect_schedulegroups/genesyscloud_architect_schedulegroups_proxy.go +++ b/genesyscloud/architect_schedulegroups/genesyscloud_architect_schedulegroups_proxy.go @@ -3,7 +3,7 @@ package architect_schedulegroups import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" ) diff --git a/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups.go b/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups.go index 5a0b08774..3b8bd4e45 100644 --- a/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups.go +++ b/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups_test.go b/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups_test.go index fc0b0a846..b654c0254 100644 --- a/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups_test.go +++ b/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceArchitectScheduleGroups(t *testing.T) { diff --git a/genesyscloud/architect_schedules/genesyscloud_architect_schedules_proxy.go b/genesyscloud/architect_schedules/genesyscloud_architect_schedules_proxy.go index adb92461a..9fb733127 100644 --- a/genesyscloud/architect_schedules/genesyscloud_architect_schedules_proxy.go +++ b/genesyscloud/architect_schedules/genesyscloud_architect_schedules_proxy.go @@ -6,7 +6,7 @@ import ( "log" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules.go b/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules.go index b040cd8a9..7d0c6ba1e 100644 --- a/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules.go +++ b/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules.go @@ -19,7 +19,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) const timeFormat = "2006-01-02T15:04:05.000000" diff --git a/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules_test.go b/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules_test.go index 29d51b99b..f780c8d5e 100644 --- a/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules_test.go +++ b/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceArchitectSchedules(t *testing.T) { diff --git a/genesyscloud/architect_user_prompt/genesyscloud_architect_user_prompt_proxy.go b/genesyscloud/architect_user_prompt/genesyscloud_architect_user_prompt_proxy.go index 64ca3981b..25ac10cb1 100644 --- a/genesyscloud/architect_user_prompt/genesyscloud_architect_user_prompt_proxy.go +++ b/genesyscloud/architect_user_prompt/genesyscloud_architect_user_prompt_proxy.go @@ -4,7 +4,7 @@ import ( "context" "log" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // internalProxy holds a proxy instance that can be used throughout the package diff --git a/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt.go b/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt.go index f28ae4274..6c7a11825 100644 --- a/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt.go +++ b/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllUserPrompts(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_test.go b/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_test.go index 2e13a8771..9ed5d9cce 100644 --- a/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_test.go +++ b/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_test.go @@ -16,7 +16,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceUserPromptBasic(t *testing.T) { diff --git a/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_utils.go b/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_utils.go index 8e9b6436f..615a715c3 100644 --- a/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_utils.go +++ b/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_utils.go @@ -16,7 +16,7 @@ import ( files "terraform-provider-genesyscloud/genesyscloud/util/files" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type PromptAudioData struct { diff --git a/genesyscloud/auth_role/data_source_genesyscloud_auth_role.go b/genesyscloud/auth_role/data_source_genesyscloud_auth_role.go index d83b1380b..a5539383f 100644 --- a/genesyscloud/auth_role/data_source_genesyscloud_auth_role.go +++ b/genesyscloud/auth_role/data_source_genesyscloud_auth_role.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "time" diff --git a/genesyscloud/auth_role/genesyscloud_auth_role_proxy.go b/genesyscloud/auth_role/genesyscloud_auth_role_proxy.go index 17b60202c..07200518c 100644 --- a/genesyscloud/auth_role/genesyscloud_auth_role_proxy.go +++ b/genesyscloud/auth_role/genesyscloud_auth_role_proxy.go @@ -6,7 +6,7 @@ import ( rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/auth_role/resource_genesyscloud_auth_role.go b/genesyscloud/auth_role/resource_genesyscloud_auth_role.go index 09eb4eaee..37b70ee8a 100644 --- a/genesyscloud/auth_role/resource_genesyscloud_auth_role.go +++ b/genesyscloud/auth_role/resource_genesyscloud_auth_role.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/auth_role/resource_genesyscloud_auth_role_test.go b/genesyscloud/auth_role/resource_genesyscloud_auth_role_test.go index f31c54c02..80782c374 100644 --- a/genesyscloud/auth_role/resource_genesyscloud_auth_role_test.go +++ b/genesyscloud/auth_role/resource_genesyscloud_auth_role_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceAuthRoleDefault(t *testing.T) { diff --git a/genesyscloud/auth_role/resource_genesyscloud_auth_role_utils.go b/genesyscloud/auth_role/resource_genesyscloud_auth_role_utils.go index 64a735483..7efb5f4e1 100644 --- a/genesyscloud/auth_role/resource_genesyscloud_auth_role_utils.go +++ b/genesyscloud/auth_role/resource_genesyscloud_auth_role_utils.go @@ -6,7 +6,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func validatePermissionPolicy(proxy *authRoleProxy, policy platformclientv2.Domainpermissionpolicy) (*platformclientv2.APIResponse, error) { diff --git a/genesyscloud/authorization_product/data_source_genesyscloud_authorization_product_test.go b/genesyscloud/authorization_product/data_source_genesyscloud_authorization_product_test.go index dfe58bcfa..f26f62ca5 100644 --- a/genesyscloud/authorization_product/data_source_genesyscloud_authorization_product_test.go +++ b/genesyscloud/authorization_product/data_source_genesyscloud_authorization_product_test.go @@ -7,7 +7,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/stretchr/testify/assert" "golang.org/x/net/context" diff --git a/genesyscloud/authorization_product/genesyscloud_authorization_product_proxy.go b/genesyscloud/authorization_product/genesyscloud_authorization_product_proxy.go index 2e2887b38..0a920b87a 100644 --- a/genesyscloud/authorization_product/genesyscloud_authorization_product_proxy.go +++ b/genesyscloud/authorization_product/genesyscloud_authorization_product_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/data_source_genesyscloud_architect_schedules.go b/genesyscloud/data_source_genesyscloud_architect_schedules.go index 9c7f761f5..a1b604725 100644 --- a/genesyscloud/data_source_genesyscloud_architect_schedules.go +++ b/genesyscloud/data_source_genesyscloud_architect_schedules.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func DataSourceSchedule() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_auth_division.go b/genesyscloud/data_source_genesyscloud_auth_division.go index fe39a49bf..dbf0c9e84 100644 --- a/genesyscloud/data_source_genesyscloud_auth_division.go +++ b/genesyscloud/data_source_genesyscloud_auth_division.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceAuthDivision() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_auth_division_home.go b/genesyscloud/data_source_genesyscloud_auth_division_home.go index f2b7371b0..bf12bec4b 100644 --- a/genesyscloud/data_source_genesyscloud_auth_division_home.go +++ b/genesyscloud/data_source_genesyscloud_auth_division_home.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func DataSourceAuthDivisionHome() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_journey_action_map.go b/genesyscloud/data_source_genesyscloud_journey_action_map.go index 0abfcc3b3..4f02d9b46 100644 --- a/genesyscloud/data_source_genesyscloud_journey_action_map.go +++ b/genesyscloud/data_source_genesyscloud_journey_action_map.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceJourneyActionMap() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_journey_action_template.go b/genesyscloud/data_source_genesyscloud_journey_action_template.go index 06b7db592..32f4f93e8 100644 --- a/genesyscloud/data_source_genesyscloud_journey_action_template.go +++ b/genesyscloud/data_source_genesyscloud_journey_action_template.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceJourneyActionTemplate() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_journey_outcome.go b/genesyscloud/data_source_genesyscloud_journey_outcome.go index 4b2cefa10..ec3473602 100644 --- a/genesyscloud/data_source_genesyscloud_journey_outcome.go +++ b/genesyscloud/data_source_genesyscloud_journey_outcome.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceJourneyOutcome() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_journey_segment.go b/genesyscloud/data_source_genesyscloud_journey_segment.go index e6c304c84..d870635b8 100644 --- a/genesyscloud/data_source_genesyscloud_journey_segment.go +++ b/genesyscloud/data_source_genesyscloud_journey_segment.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceJourneySegment() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_knowledge_category.go b/genesyscloud/data_source_genesyscloud_knowledge_category.go index 79411ff3f..27801fee5 100644 --- a/genesyscloud/data_source_genesyscloud_knowledge_category.go +++ b/genesyscloud/data_source_genesyscloud_knowledge_category.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceKnowledgeCategory() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_knowledge_knowledgebase.go b/genesyscloud/data_source_genesyscloud_knowledge_knowledgebase.go index 3ae92509f..96f15c63c 100644 --- a/genesyscloud/data_source_genesyscloud_knowledge_knowledgebase.go +++ b/genesyscloud/data_source_genesyscloud_knowledge_knowledgebase.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceKnowledgeKnowledgebase() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_knowledge_label.go b/genesyscloud/data_source_genesyscloud_knowledge_label.go index 97c2c4454..45312d9d4 100644 --- a/genesyscloud/data_source_genesyscloud_knowledge_label.go +++ b/genesyscloud/data_source_genesyscloud_knowledge_label.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceKnowledgeLabel() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_location.go b/genesyscloud/data_source_genesyscloud_location.go index dd7380a73..2063e68b5 100644 --- a/genesyscloud/data_source_genesyscloud_location.go +++ b/genesyscloud/data_source_genesyscloud_location.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func DataSourceLocation() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_organizations_me.go b/genesyscloud/data_source_genesyscloud_organizations_me.go index cc75781be..fe8a15dbe 100644 --- a/genesyscloud/data_source_genesyscloud_organizations_me.go +++ b/genesyscloud/data_source_genesyscloud_organizations_me.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" ) diff --git a/genesyscloud/data_source_genesyscloud_quality_forms_evaluation.go b/genesyscloud/data_source_genesyscloud_quality_forms_evaluation.go index 15bdd25b7..a69e74b4a 100644 --- a/genesyscloud/data_source_genesyscloud_quality_forms_evaluation.go +++ b/genesyscloud/data_source_genesyscloud_quality_forms_evaluation.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type EvaluationFormQuestionGroupStruct struct { diff --git a/genesyscloud/data_source_genesyscloud_quality_forms_survey.go b/genesyscloud/data_source_genesyscloud_quality_forms_survey.go index 9b684ed24..c3f3d84ae 100644 --- a/genesyscloud/data_source_genesyscloud_quality_forms_survey.go +++ b/genesyscloud/data_source_genesyscloud_quality_forms_survey.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceQualityFormsSurvey() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_routing_email_domain.go b/genesyscloud/data_source_genesyscloud_routing_email_domain.go index 4ea36c8ed..2e9266932 100644 --- a/genesyscloud/data_source_genesyscloud_routing_email_domain.go +++ b/genesyscloud/data_source_genesyscloud_routing_email_domain.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // Returns the schema for the routing email domain diff --git a/genesyscloud/data_source_genesyscloud_routing_email_domain_test.go b/genesyscloud/data_source_genesyscloud_routing_email_domain_test.go index d594bdbf1..f155f18b3 100644 --- a/genesyscloud/data_source_genesyscloud_routing_email_domain_test.go +++ b/genesyscloud/data_source_genesyscloud_routing_email_domain_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccDataSourceRoutingEmailDomain(t *testing.T) { diff --git a/genesyscloud/data_source_genesyscloud_routing_language.go b/genesyscloud/data_source_genesyscloud_routing_language.go index 7edc21646..eeebd35e8 100644 --- a/genesyscloud/data_source_genesyscloud_routing_language.go +++ b/genesyscloud/data_source_genesyscloud_routing_language.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceRoutingLanguage() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_routing_settings.go b/genesyscloud/data_source_genesyscloud_routing_settings.go index 31fe3528d..00a93ad9b 100644 --- a/genesyscloud/data_source_genesyscloud_routing_settings.go +++ b/genesyscloud/data_source_genesyscloud_routing_settings.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" ) diff --git a/genesyscloud/data_source_genesyscloud_routing_skill.go b/genesyscloud/data_source_genesyscloud_routing_skill.go index b211fde38..22bdf02dd 100644 --- a/genesyscloud/data_source_genesyscloud_routing_skill.go +++ b/genesyscloud/data_source_genesyscloud_routing_skill.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // The context is now added without Timeout , diff --git a/genesyscloud/data_source_genesyscloud_routing_skill_group.go b/genesyscloud/data_source_genesyscloud_routing_skill_group.go index 5399cba09..1acce6fbd 100644 --- a/genesyscloud/data_source_genesyscloud_routing_skill_group.go +++ b/genesyscloud/data_source_genesyscloud_routing_skill_group.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceRoutingSkillGroup() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_routing_utilization_label.go b/genesyscloud/data_source_genesyscloud_routing_utilization_label.go index 8c9581020..e23128c3a 100644 --- a/genesyscloud/data_source_genesyscloud_routing_utilization_label.go +++ b/genesyscloud/data_source_genesyscloud_routing_utilization_label.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceRoutingUtilizationLabel() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_routing_wrapupcode.go b/genesyscloud/data_source_genesyscloud_routing_wrapupcode.go index 5596473d3..33d96f72b 100644 --- a/genesyscloud/data_source_genesyscloud_routing_wrapupcode.go +++ b/genesyscloud/data_source_genesyscloud_routing_wrapupcode.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func DataSourceRoutingWrapupcode() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_user.go b/genesyscloud/data_source_genesyscloud_user.go index b74a5b487..42ce5df10 100644 --- a/genesyscloud/data_source_genesyscloud_user.go +++ b/genesyscloud/data_source_genesyscloud_user.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func DataSourceUser() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_widget_deployment.go b/genesyscloud/data_source_genesyscloud_widget_deployment.go index 89892889f..31b04b4de 100644 --- a/genesyscloud/data_source_genesyscloud_widget_deployment.go +++ b/genesyscloud/data_source_genesyscloud_widget_deployment.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceWidgetDeployments() *schema.Resource { diff --git a/genesyscloud/dependent_consumers/genesyscloud_dependent_consumer_proxy.go b/genesyscloud/dependent_consumers/genesyscloud_dependent_consumer_proxy.go index 4c4311112..1b806376d 100644 --- a/genesyscloud/dependent_consumers/genesyscloud_dependent_consumer_proxy.go +++ b/genesyscloud/dependent_consumers/genesyscloud_dependent_consumer_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "strings" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/employeeperformance_externalmetrics_definitions/genesyscloud_employeeperformance_externalmetrics_definitions_proxy.go b/genesyscloud/employeeperformance_externalmetrics_definitions/genesyscloud_employeeperformance_externalmetrics_definitions_proxy.go index b252235c5..4f123630e 100644 --- a/genesyscloud/employeeperformance_externalmetrics_definitions/genesyscloud_employeeperformance_externalmetrics_definitions_proxy.go +++ b/genesyscloud/employeeperformance_externalmetrics_definitions/genesyscloud_employeeperformance_externalmetrics_definitions_proxy.go @@ -3,7 +3,7 @@ package employeeperformance_externalmetrics_definitions import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" ) diff --git a/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions.go b/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions.go index 3b443b79d..f8ff2b8c8 100644 --- a/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions.go +++ b/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions_test.go b/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions_test.go index a543c81f1..105eb00e5 100644 --- a/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions_test.go +++ b/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceEmployeePerformanceExternalMetricsDefintions(t *testing.T) { diff --git a/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_proxy.go b/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_proxy.go index d6ef44f8c..f624411ce 100644 --- a/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_proxy.go +++ b/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_proxy.go @@ -7,7 +7,7 @@ import ( rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact.go b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact.go index bdc3722ae..98565b2ea 100644 --- a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact.go +++ b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_test.go b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_test.go index e299b2146..bf6c6c2b0 100644 --- a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_test.go +++ b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_utils.go b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_utils.go index b6b864bb4..d7b3df901 100644 --- a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_utils.go +++ b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_utils.go @@ -5,7 +5,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/nyaruka/phonenumbers" ) diff --git a/genesyscloud/flow_loglevel/genesyscloud_flow_loglevel_proxy.go b/genesyscloud/flow_loglevel/genesyscloud_flow_loglevel_proxy.go index abcef0774..34437c34a 100644 --- a/genesyscloud/flow_loglevel/genesyscloud_flow_loglevel_proxy.go +++ b/genesyscloud/flow_loglevel/genesyscloud_flow_loglevel_proxy.go @@ -3,7 +3,7 @@ package flow_loglevel import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel.go b/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel.go index f993f67b5..0100e60ae 100644 --- a/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel.go +++ b/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel_test.go b/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel_test.go index bddec6ed3..acbf5cd6f 100644 --- a/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel_test.go +++ b/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel_test.go @@ -5,7 +5,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/architect_flow" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" diff --git a/genesyscloud/flow_milestone/genesyscloud_flow_milestone_proxy.go b/genesyscloud/flow_milestone/genesyscloud_flow_milestone_proxy.go index 104daebed..932a45cc7 100644 --- a/genesyscloud/flow_milestone/genesyscloud_flow_milestone_proxy.go +++ b/genesyscloud/flow_milestone/genesyscloud_flow_milestone_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone.go b/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone.go index fed202ea8..b83780b75 100644 --- a/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone.go +++ b/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_test.go b/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_test.go index 3d7da7915..2f26afbd0 100644 --- a/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_test.go +++ b/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceFlowMilestone(t *testing.T) { diff --git a/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_utils.go b/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_utils.go index 838a056c6..46b801e53 100644 --- a/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_utils.go +++ b/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_utils.go @@ -2,7 +2,7 @@ package flow_milestone import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/flow_outcome/genesyscloud_flow_outcome_proxy.go b/genesyscloud/flow_outcome/genesyscloud_flow_outcome_proxy.go index 6bbe109d7..4aa3507bc 100644 --- a/genesyscloud/flow_outcome/genesyscloud_flow_outcome_proxy.go +++ b/genesyscloud/flow_outcome/genesyscloud_flow_outcome_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome.go b/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome.go index 4fbb0dc8a..b36bf8781 100644 --- a/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome.go +++ b/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome_utils.go b/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome_utils.go index eb0cc2e39..efde6651e 100644 --- a/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome_utils.go +++ b/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome_utils.go @@ -2,7 +2,7 @@ package flow_outcome import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/group/data_source_genesyscloud_group_test.go b/genesyscloud/group/data_source_genesyscloud_group_test.go index f6bbb0f6b..f69c4f037 100644 --- a/genesyscloud/group/data_source_genesyscloud_group_test.go +++ b/genesyscloud/group/data_source_genesyscloud_group_test.go @@ -10,7 +10,7 @@ import ( "time" "github.com/google/uuid" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" diff --git a/genesyscloud/group/genesyscloud_group_proxy.go b/genesyscloud/group/genesyscloud_group_proxy.go index 951d367b7..956ba6d43 100644 --- a/genesyscloud/group/genesyscloud_group_proxy.go +++ b/genesyscloud/group/genesyscloud_group_proxy.go @@ -3,7 +3,7 @@ package group import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" ) diff --git a/genesyscloud/group/resource_genesyscloud_group.go b/genesyscloud/group/resource_genesyscloud_group.go index 4792060d1..60faa5abc 100644 --- a/genesyscloud/group/resource_genesyscloud_group.go +++ b/genesyscloud/group/resource_genesyscloud_group.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func GetAllGroups(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/group/resource_genesyscloud_group_test.go b/genesyscloud/group/resource_genesyscloud_group_test.go index 930dc3d9a..f9658b391 100644 --- a/genesyscloud/group/resource_genesyscloud_group_test.go +++ b/genesyscloud/group/resource_genesyscloud_group_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceGroupBasic(t *testing.T) { diff --git a/genesyscloud/group/resource_genesyscloud_group_utils.go b/genesyscloud/group/resource_genesyscloud_group_utils.go index 4bf5d2ebe..b7b5652fe 100644 --- a/genesyscloud/group/resource_genesyscloud_group_utils.go +++ b/genesyscloud/group/resource_genesyscloud_group_utils.go @@ -3,7 +3,7 @@ package group import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "strings" "terraform-provider-genesyscloud/genesyscloud/util" diff --git a/genesyscloud/group_roles/genesyscloud_group_roles_proxy.go b/genesyscloud/group_roles/genesyscloud_group_roles_proxy.go index 0cb0c84b7..87cb8703e 100644 --- a/genesyscloud/group_roles/genesyscloud_group_roles_proxy.go +++ b/genesyscloud/group_roles/genesyscloud_group_roles_proxy.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var internalProxy *groupRolesProxy diff --git a/genesyscloud/group_roles/resource_genesyscloud_group_roles_schema.go b/genesyscloud/group_roles/resource_genesyscloud_group_roles_schema.go index c8138ae07..7adf536f1 100644 --- a/genesyscloud/group_roles/resource_genesyscloud_group_roles_schema.go +++ b/genesyscloud/group_roles/resource_genesyscloud_group_roles_schema.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" diff --git a/genesyscloud/group_roles/resource_genesyscloud_group_roles_utils.go b/genesyscloud/group_roles/resource_genesyscloud_group_roles_utils.go index 71d165e5e..d1ecb34c9 100644 --- a/genesyscloud/group_roles/resource_genesyscloud_group_roles_utils.go +++ b/genesyscloud/group_roles/resource_genesyscloud_group_roles_utils.go @@ -7,7 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func flattenSubjectRoles(d *schema.ResourceData, p *groupRolesProxy) (*schema.Set, *platformclientv2.APIResponse, error) { diff --git a/genesyscloud/idp_adfs/genesyscloud_idp_adfs_proxy.go b/genesyscloud/idp_adfs/genesyscloud_idp_adfs_proxy.go index 23910c006..a1825f1c1 100644 --- a/genesyscloud/idp_adfs/genesyscloud_idp_adfs_proxy.go +++ b/genesyscloud/idp_adfs/genesyscloud_idp_adfs_proxy.go @@ -3,7 +3,7 @@ package idp_adfs import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs.go b/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs.go index 1367be58b..cde86dead 100644 --- a/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs.go +++ b/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_test.go b/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_test.go index 5b8cc3391..ef089ab46 100644 --- a/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_test.go +++ b/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceIdpAdfs(t *testing.T) { diff --git a/genesyscloud/idp_okta/genesyscloud_idp_okta_proxy.go b/genesyscloud/idp_okta/genesyscloud_idp_okta_proxy.go index d40d622d0..1af69517d 100644 --- a/genesyscloud/idp_okta/genesyscloud_idp_okta_proxy.go +++ b/genesyscloud/idp_okta/genesyscloud_idp_okta_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/idp_okta/resource_genesyscloud_idp_okta.go b/genesyscloud/idp_okta/resource_genesyscloud_idp_okta.go index 2925dbc85..7f0de2a14 100644 --- a/genesyscloud/idp_okta/resource_genesyscloud_idp_okta.go +++ b/genesyscloud/idp_okta/resource_genesyscloud_idp_okta.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/constants" "terraform-provider-genesyscloud/genesyscloud/util/lists" diff --git a/genesyscloud/idp_okta/resource_genesyscloud_idp_okta_test.go b/genesyscloud/idp_okta/resource_genesyscloud_idp_okta_test.go index 547eee8b3..3b2e770aa 100644 --- a/genesyscloud/idp_okta/resource_genesyscloud_idp_okta_test.go +++ b/genesyscloud/idp_okta/resource_genesyscloud_idp_okta_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceIdpOkta(t *testing.T) { diff --git a/genesyscloud/idp_salesforce/genesyscloud_idp_salesforce_proxy.go b/genesyscloud/idp_salesforce/genesyscloud_idp_salesforce_proxy.go index 3af3972b0..0610597c8 100644 --- a/genesyscloud/idp_salesforce/genesyscloud_idp_salesforce_proxy.go +++ b/genesyscloud/idp_salesforce/genesyscloud_idp_salesforce_proxy.go @@ -2,7 +2,7 @@ package idp_salesforce import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce.go b/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce.go index f8ba2f919..eadc684c1 100644 --- a/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce.go +++ b/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce_test.go b/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce_test.go index 431890348..d891e5601 100644 --- a/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce_test.go +++ b/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceIdpSalesforce(t *testing.T) { diff --git a/genesyscloud/integration/genesyscloud_integration_proxy.go b/genesyscloud/integration/genesyscloud_integration_proxy.go index 571526332..5f40e21a4 100644 --- a/genesyscloud/integration/genesyscloud_integration_proxy.go +++ b/genesyscloud/integration/genesyscloud_integration_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/integration/resource_genesyscloud_integration.go b/genesyscloud/integration/resource_genesyscloud_integration.go index cfcf214fb..d164f75a6 100644 --- a/genesyscloud/integration/resource_genesyscloud_integration.go +++ b/genesyscloud/integration/resource_genesyscloud_integration.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/integration/resource_genesyscloud_integration_test.go b/genesyscloud/integration/resource_genesyscloud_integration_test.go index b0474efb2..54a613793 100644 --- a/genesyscloud/integration/resource_genesyscloud_integration_test.go +++ b/genesyscloud/integration/resource_genesyscloud_integration_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/integration/resource_genesyscloud_integration_utils.go b/genesyscloud/integration/resource_genesyscloud_integration_utils.go index 5fbe82c6e..b28c17d00 100644 --- a/genesyscloud/integration/resource_genesyscloud_integration_utils.go +++ b/genesyscloud/integration/resource_genesyscloud_integration_utils.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/integration_action/genesyscloud_integration_action_proxy.go b/genesyscloud/integration_action/genesyscloud_integration_action_proxy.go index 1b963ef3e..bc7f7591a 100644 --- a/genesyscloud/integration_action/genesyscloud_integration_action_proxy.go +++ b/genesyscloud/integration_action/genesyscloud_integration_action_proxy.go @@ -4,7 +4,7 @@ import ( "context" "encoding/json" "errors" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "net/http" ) diff --git a/genesyscloud/integration_action/resource_genesyscloud_integration_action.go b/genesyscloud/integration_action/resource_genesyscloud_integration_action.go index b0da5cf21..b2d9139c9 100644 --- a/genesyscloud/integration_action/resource_genesyscloud_integration_action.go +++ b/genesyscloud/integration_action/resource_genesyscloud_integration_action.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/integration_action/resource_genesyscloud_integration_action_test.go b/genesyscloud/integration_action/resource_genesyscloud_integration_action_test.go index d3d588764..9faddcb99 100644 --- a/genesyscloud/integration_action/resource_genesyscloud_integration_action_test.go +++ b/genesyscloud/integration_action/resource_genesyscloud_integration_action_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/integration_action/resource_genesyscloud_integration_action_utils.go b/genesyscloud/integration_action/resource_genesyscloud_integration_action_utils.go index 23120db0c..f74621600 100644 --- a/genesyscloud/integration_action/resource_genesyscloud_integration_action_utils.go +++ b/genesyscloud/integration_action/resource_genesyscloud_integration_action_utils.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" ) diff --git a/genesyscloud/integration_credential/genesyscloud_integration_credential_proxy.go b/genesyscloud/integration_credential/genesyscloud_integration_credential_proxy.go index dd1c2336b..31f0da8df 100644 --- a/genesyscloud/integration_credential/genesyscloud_integration_credential_proxy.go +++ b/genesyscloud/integration_credential/genesyscloud_integration_credential_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/integration_credential/resource_genesyscloud_integration_credential.go b/genesyscloud/integration_credential/resource_genesyscloud_integration_credential.go index d995c6766..e82c6ca79 100644 --- a/genesyscloud/integration_credential/resource_genesyscloud_integration_credential.go +++ b/genesyscloud/integration_credential/resource_genesyscloud_integration_credential.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_test.go b/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_test.go index c90454fbe..60ceebd60 100644 --- a/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_test.go +++ b/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/integration_custom_auth_action/genesyscloud_integration_custom_auth_action_proxy.go b/genesyscloud/integration_custom_auth_action/genesyscloud_integration_custom_auth_action_proxy.go index 9d70ccc8b..dda4e4553 100644 --- a/genesyscloud/integration_custom_auth_action/genesyscloud_integration_custom_auth_action_proxy.go +++ b/genesyscloud/integration_custom_auth_action/genesyscloud_integration_custom_auth_action_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "strings" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action.go b/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action.go index 3ae2db2df..8839fee9b 100644 --- a/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action.go +++ b/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_test.go b/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_test.go index 193ef3266..3d5b7f4ee 100644 --- a/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_test.go +++ b/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_test.go @@ -15,7 +15,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type customAuthActionResource struct { diff --git a/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_utils.go b/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_utils.go index 2632161aa..209c4e24d 100644 --- a/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_utils.go +++ b/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_utils.go @@ -6,7 +6,7 @@ import ( integrationAction "terraform-provider-genesyscloud/genesyscloud/integration_action" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/journey_outcome_predictor/genesyscloud_journey_outcome_predictor_proxy.go b/genesyscloud/journey_outcome_predictor/genesyscloud_journey_outcome_predictor_proxy.go index cdbdc6b6c..e5846292b 100644 --- a/genesyscloud/journey_outcome_predictor/genesyscloud_journey_outcome_predictor_proxy.go +++ b/genesyscloud/journey_outcome_predictor/genesyscloud_journey_outcome_predictor_proxy.go @@ -2,7 +2,7 @@ package journey_outcome_predictor import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor.go b/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor.go index 381edb23f..cda54b354 100644 --- a/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor.go +++ b/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor_test.go b/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor_test.go index 3db246089..98872d160 100644 --- a/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor_test.go +++ b/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceJourneyOutcomePredictor(t *testing.T) { diff --git a/genesyscloud/journey_views/genesyscloud_journey_views_proxy.go b/genesyscloud/journey_views/genesyscloud_journey_views_proxy.go index 929ddd59d..4964990b3 100644 --- a/genesyscloud/journey_views/genesyscloud_journey_views_proxy.go +++ b/genesyscloud/journey_views/genesyscloud_journey_views_proxy.go @@ -2,7 +2,7 @@ package journey_views import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" ) diff --git a/genesyscloud/journey_views/resource_genesyscloud_journey_views.go b/genesyscloud/journey_views/resource_genesyscloud_journey_views.go index 525f8b15f..2d6b4f702 100644 --- a/genesyscloud/journey_views/resource_genesyscloud_journey_views.go +++ b/genesyscloud/journey_views/resource_genesyscloud_journey_views.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -65,7 +65,7 @@ func readJourneyView(ctx context.Context, d *schema.ResourceData, meta interface } return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to get journeyView with viewId %s | error: %s", viewId, err), resp)) } - + resourcedata.SetNillableValue(d, "name", journeyView.Name) resourcedata.SetNillableValue(d, "description", journeyView.Description) resourcedata.SetNillableValue(d, "interval", journeyView.Interval) diff --git a/genesyscloud/journey_views/resource_genesyscloud_journey_views_test.go b/genesyscloud/journey_views/resource_genesyscloud_journey_views_test.go index 5d2153764..8116ced64 100644 --- a/genesyscloud/journey_views/resource_genesyscloud_journey_views_test.go +++ b/genesyscloud/journey_views/resource_genesyscloud_journey_views_test.go @@ -5,7 +5,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "strings" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" diff --git a/genesyscloud/journey_views/resource_genesyscloud_journey_views_utils.go b/genesyscloud/journey_views/resource_genesyscloud_journey_views_utils.go index 2f6dc4691..7c8254f7d 100644 --- a/genesyscloud/journey_views/resource_genesyscloud_journey_views_utils.go +++ b/genesyscloud/journey_views/resource_genesyscloud_journey_views_utils.go @@ -3,7 +3,7 @@ package journey_views import ( "errors" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" ) diff --git a/genesyscloud/oauth_client/resource_genesyscloud_oauth_client.go b/genesyscloud/oauth_client/resource_genesyscloud_oauth_client.go index 1517a4592..851bf78cc 100644 --- a/genesyscloud/oauth_client/resource_genesyscloud_oauth_client.go +++ b/genesyscloud/oauth_client/resource_genesyscloud_oauth_client.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllOAuthClients(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_proxy.go b/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_proxy.go index deda69802..f4b0416f6 100644 --- a/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_proxy.go +++ b/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_proxy.go @@ -5,7 +5,7 @@ import ( "log" "sync" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var internalProxy *oauthClientProxy diff --git a/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_utils.go b/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_utils.go index eebfceade..dcdacc228 100644 --- a/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_utils.go +++ b/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_utils.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func buildOAuthRedirectURIs(d *schema.ResourceData) *[]string { diff --git a/genesyscloud/oauth_client/resource_genesyscloude_oauth_client_unit_test.go b/genesyscloud/oauth_client/resource_genesyscloude_oauth_client_unit_test.go index 531108b05..2f8b9e9fb 100644 --- a/genesyscloud/oauth_client/resource_genesyscloude_oauth_client_unit_test.go +++ b/genesyscloud/oauth_client/resource_genesyscloude_oauth_client_unit_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/stretchr/testify/assert" ) diff --git a/genesyscloud/organization_authentication_settings/genesyscloud_organization_authentication_settings_proxy.go b/genesyscloud/organization_authentication_settings/genesyscloud_organization_authentication_settings_proxy.go index 980274ccf..bd316f7db 100644 --- a/genesyscloud/organization_authentication_settings/genesyscloud_organization_authentication_settings_proxy.go +++ b/genesyscloud/organization_authentication_settings/genesyscloud_organization_authentication_settings_proxy.go @@ -3,7 +3,7 @@ package organization_authentication_settings import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings.go b/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings.go index 5907f7216..00e0e5f2f 100644 --- a/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings.go +++ b/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_unit_test.go b/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_unit_test.go index 55e472c64..2d65d7a8b 100644 --- a/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_unit_test.go +++ b/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_unit_test.go @@ -5,7 +5,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/stretchr/testify/assert" "net/http" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_utils.go b/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_utils.go index 23652caf4..d981238fd 100644 --- a/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_utils.go +++ b/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_utils.go @@ -5,7 +5,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/orgauthorization_pairing/genesyscloud_orgauthorization_pairing_proxy.go b/genesyscloud/orgauthorization_pairing/genesyscloud_orgauthorization_pairing_proxy.go index d2e7f36e1..5cfb68125 100644 --- a/genesyscloud/orgauthorization_pairing/genesyscloud_orgauthorization_pairing_proxy.go +++ b/genesyscloud/orgauthorization_pairing/genesyscloud_orgauthorization_pairing_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var internalProxy *orgauthorizationPairingProxy diff --git a/genesyscloud/orgauthorization_pairing/resource_genesyscloud_orgauthorization_pairing.go b/genesyscloud/orgauthorization_pairing/resource_genesyscloud_orgauthorization_pairing.go index dc4e4ba74..5f4bc6923 100644 --- a/genesyscloud/orgauthorization_pairing/resource_genesyscloud_orgauthorization_pairing.go +++ b/genesyscloud/orgauthorization_pairing/resource_genesyscloud_orgauthorization_pairing.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func createOrgauthorizationPairing(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { diff --git a/genesyscloud/outbound/data_source_genesyscloud_outbound_cattemptlimit.go b/genesyscloud/outbound/data_source_genesyscloud_outbound_cattemptlimit.go index 351f72353..25a84f122 100644 --- a/genesyscloud/outbound/data_source_genesyscloud_outbound_cattemptlimit.go +++ b/genesyscloud/outbound/data_source_genesyscloud_outbound_cattemptlimit.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func DataSourceOutboundAttemptLimit() *schema.Resource { diff --git a/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign.go b/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign.go index b7793f2e1..391bbdbf2 100644 --- a/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign.go +++ b/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceOutboundMessagingcampaign() *schema.Resource { diff --git a/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign_test.go b/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign_test.go index 100929427..a95ebc65b 100644 --- a/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign_test.go +++ b/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var TrueValue = "true" diff --git a/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign.go b/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign.go index 9ee2e0ea9..b497d5851 100644 --- a/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign.go +++ b/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) const ( diff --git a/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign_test.go b/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign_test.go index 0bbd54648..c0d206474 100644 --- a/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign_test.go +++ b/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" obCallableTimeset "terraform-provider-genesyscloud/genesyscloud/outbound_callabletimeset" obContactList "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list" diff --git a/genesyscloud/outbound_attempt_limit/data_source_genesyscloud_outbound_attemptlimit.go b/genesyscloud/outbound_attempt_limit/data_source_genesyscloud_outbound_attemptlimit.go index 30a977b54..1d330796b 100644 --- a/genesyscloud/outbound_attempt_limit/data_source_genesyscloud_outbound_attemptlimit.go +++ b/genesyscloud/outbound_attempt_limit/data_source_genesyscloud_outbound_attemptlimit.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func DataSourceOutboundAttemptLimit() *schema.Resource { diff --git a/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit.go b/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit.go index 0c0831cc6..febb736c6 100644 --- a/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit.go +++ b/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) const ( diff --git a/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit_test.go b/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit_test.go index 896c8f02f..d9d1292be 100644 --- a/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit_test.go +++ b/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // func init() { diff --git a/genesyscloud/outbound_callabletimeset/genesyscloud_outbound_callabletimeset_proxy.go b/genesyscloud/outbound_callabletimeset/genesyscloud_outbound_callabletimeset_proxy.go index ae17580c0..96f564262 100644 --- a/genesyscloud/outbound_callabletimeset/genesyscloud_outbound_callabletimeset_proxy.go +++ b/genesyscloud/outbound_callabletimeset/genesyscloud_outbound_callabletimeset_proxy.go @@ -6,7 +6,7 @@ import ( "log" "strings" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset.go b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset.go index 1010a36b2..c9eb25331 100644 --- a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset.go +++ b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_test.go b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_test.go index 85ba29c80..12f28a9d2 100644 --- a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_test.go +++ b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceOutboundCallabletimeset(t *testing.T) { diff --git a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_utils.go b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_utils.go index 0396e70b2..acba89881 100644 --- a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_utils.go +++ b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_utils.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_callanalysisresponseset/genesyscloud_outbound_callanalysisresponseset_proxy.go b/genesyscloud/outbound_callanalysisresponseset/genesyscloud_outbound_callanalysisresponseset_proxy.go index 2b95656c5..5eded85c3 100644 --- a/genesyscloud/outbound_callanalysisresponseset/genesyscloud_outbound_callanalysisresponseset_proxy.go +++ b/genesyscloud/outbound_callanalysisresponseset/genesyscloud_outbound_callanalysisresponseset_proxy.go @@ -3,7 +3,7 @@ package outbound_callanalysisresponseset import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" ) diff --git a/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset.go b/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset.go index bc6137047..90744ea1f 100644 --- a/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset.go +++ b/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_test.go b/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_test.go index afebd9631..74cd9f5fd 100644 --- a/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_test.go +++ b/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceOutboundCallAnalysisResponseSet(t *testing.T) { diff --git a/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_utils.go b/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_utils.go index c8355105a..d48a46401 100644 --- a/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_utils.go +++ b/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_utils.go @@ -3,7 +3,7 @@ package outbound_callanalysisresponseset import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "strings" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" ) diff --git a/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_init_test.go b/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_init_test.go index f36ee1489..03bdbd559 100644 --- a/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_init_test.go +++ b/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_init_test.go @@ -16,7 +16,7 @@ import ( telephonyProvidersEdgesSite "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site" "testing" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_proxy.go b/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_proxy.go index 92c47562f..8105cebb3 100644 --- a/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_proxy.go +++ b/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_proxy.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign.go b/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign.go index fa9ce68bc..bdcd48c47 100644 --- a/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign.go +++ b/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_test.go b/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_test.go index 5f6576e97..2ada8f3fa 100644 --- a/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_test.go +++ b/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_test.go @@ -23,7 +23,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // Add a special generator DEVENGAGE-1646. Basically, the API makes it look like you need a full phone_columns field here. However, the API ignores the type because the devs reused the phone_columns object. However, diff --git a/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_utils.go b/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_utils.go index 7bafc268f..6f8fdc95a 100644 --- a/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_utils.go +++ b/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_utils.go @@ -18,7 +18,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_campaignrule/data_source_genesyscloud_outbound_campaignrule.go b/genesyscloud/outbound_campaignrule/data_source_genesyscloud_outbound_campaignrule.go index dfb9710a1..e6694ebb2 100644 --- a/genesyscloud/outbound_campaignrule/data_source_genesyscloud_outbound_campaignrule.go +++ b/genesyscloud/outbound_campaignrule/data_source_genesyscloud_outbound_campaignrule.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceOutboundCampaignruleRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { diff --git a/genesyscloud/outbound_campaignrule/genesyscloud_outbound_campaignrule_proxy.go b/genesyscloud/outbound_campaignrule/genesyscloud_outbound_campaignrule_proxy.go index a7708715f..0af2b5ba4 100644 --- a/genesyscloud/outbound_campaignrule/genesyscloud_outbound_campaignrule_proxy.go +++ b/genesyscloud/outbound_campaignrule/genesyscloud_outbound_campaignrule_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule.go b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule.go index 3dbc518f2..f94ae8fe3 100644 --- a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule.go +++ b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllAuthCampaignRules(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_test.go b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_test.go index 53b6eeab2..2a1726d2f 100644 --- a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_test.go +++ b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceOutboundCampaignRuleBasic(t *testing.T) { diff --git a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_unit_test.go b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_unit_test.go index 8fdae8811..aa5a5196c 100644 --- a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_unit_test.go +++ b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_unit_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/stretchr/testify/assert" ) diff --git a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_utils.go b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_utils.go index 8fb38aba3..0d3240299 100644 --- a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_utils.go +++ b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_utils.go @@ -5,7 +5,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getCampaignruleFromResourceData(d *schema.ResourceData) platformclientv2.Campaignrule { diff --git a/genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contactlist.go b/genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contactlist.go index 21e1ffc39..3c2f58501 100644 --- a/genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contactlist.go +++ b/genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contactlist.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func DataSourceOutboundContactList() *schema.Resource { diff --git a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist.go b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist.go index 51a5daa7c..6d95784e1 100644 --- a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist.go +++ b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) const ( diff --git a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist_test.go b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist_test.go index 220478123..a76f8bf68 100644 --- a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist_test.go +++ b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceOutboundContactListBasic(t *testing.T) { diff --git a/genesyscloud/outbound_contactlistfilter/genesyscloud_outbound_contactlistfilter_proxy.go b/genesyscloud/outbound_contactlistfilter/genesyscloud_outbound_contactlistfilter_proxy.go index c5162898d..b1e9651bb 100644 --- a/genesyscloud/outbound_contactlistfilter/genesyscloud_outbound_contactlistfilter_proxy.go +++ b/genesyscloud/outbound_contactlistfilter/genesyscloud_outbound_contactlistfilter_proxy.go @@ -3,7 +3,7 @@ package outbound_contactlistfilter import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" ) diff --git a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter.go b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter.go index 3949e2513..135ed9a44 100644 --- a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter.go +++ b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_test.go b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_test.go index f290bba27..385842ec2 100644 --- a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_test.go +++ b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceOutboundContactListFilter(t *testing.T) { diff --git a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_utils.go b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_utils.go index 72deee21a..ae8aa6042 100644 --- a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_utils.go +++ b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_utils.go @@ -3,7 +3,7 @@ package outbound_contactlistfilter import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "strings" "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" diff --git a/genesyscloud/outbound_dnclist/genesyscloud_outbound_dnclist_proxy.go b/genesyscloud/outbound_dnclist/genesyscloud_outbound_dnclist_proxy.go index f81b77b47..dc051f755 100644 --- a/genesyscloud/outbound_dnclist/genesyscloud_outbound_dnclist_proxy.go +++ b/genesyscloud/outbound_dnclist/genesyscloud_outbound_dnclist_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/util" ) diff --git a/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist.go b/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist.go index f52c9c23d..5a98e1aa7 100644 --- a/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist.go +++ b/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllOutboundDncLists(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_test.go b/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_test.go index aa68d31e3..1eed72464 100644 --- a/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_test.go +++ b/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) const NullValue = "null" diff --git a/genesyscloud/outbound_filespecificationtemplate/genesyscloud_outbound_filespecificationtemplate_proxy.go b/genesyscloud/outbound_filespecificationtemplate/genesyscloud_outbound_filespecificationtemplate_proxy.go index 8c313f6c5..189cc266b 100644 --- a/genesyscloud/outbound_filespecificationtemplate/genesyscloud_outbound_filespecificationtemplate_proxy.go +++ b/genesyscloud/outbound_filespecificationtemplate/genesyscloud_outbound_filespecificationtemplate_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate.go b/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate.go index 6e24fed69..8aaed672a 100644 --- a/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate.go +++ b/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllFileSpecificationTemplates(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_test.go b/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_test.go index e4b4679d5..7e272fa62 100644 --- a/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_test.go +++ b/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceOutboundFileSpecificationTemplate(t *testing.T) { diff --git a/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_utils.go b/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_utils.go index 23e9742bb..f765fa485 100644 --- a/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_utils.go +++ b/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_utils.go @@ -2,7 +2,7 @@ package outbound_filespecificationtemplate import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" ) diff --git a/genesyscloud/outbound_ruleset/genesyscloud_outbound_ruleset_proxy.go b/genesyscloud/outbound_ruleset/genesyscloud_outbound_ruleset_proxy.go index 24fb87044..5e12b64ee 100644 --- a/genesyscloud/outbound_ruleset/genesyscloud_outbound_ruleset_proxy.go +++ b/genesyscloud/outbound_ruleset/genesyscloud_outbound_ruleset_proxy.go @@ -6,7 +6,7 @@ import ( "log" "strings" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset.go b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset.go index ecac64ea6..37cfa4574 100644 --- a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset.go +++ b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_test.go b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_test.go index 18a4b4b31..d25b21570 100644 --- a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_test.go +++ b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" obContactList "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list" ) diff --git a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_unit_test.go b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_unit_test.go index 29f9c322d..d39433a83 100644 --- a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_unit_test.go +++ b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_unit_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestUnitDoesRuleConditionsRefDeletedSkill(t *testing.T) { diff --git a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_utils.go b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_utils.go index d97906f4e..6266b7a65 100644 --- a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_utils.go +++ b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_utils.go @@ -9,7 +9,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_init_test.go b/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_init_test.go index 9a1442ada..35029a3e7 100644 --- a/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_init_test.go +++ b/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_init_test.go @@ -12,7 +12,7 @@ import ( edgeSite "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site" "testing" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_proxy.go b/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_proxy.go index 18068343a..85532bf50 100644 --- a/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_proxy.go +++ b/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence.go b/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence.go index d664c7f70..5bb9e88d7 100644 --- a/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence.go +++ b/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_test.go b/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_test.go index 641cebf91..3740a0da7 100644 --- a/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_test.go +++ b/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceOutboundSequence(t *testing.T) { diff --git a/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_utils.go b/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_utils.go index d6bd708b2..3040db3dc 100644 --- a/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_utils.go +++ b/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_utils.go @@ -6,7 +6,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_settings/genesyscloud_outbound_settings_proxy.go b/genesyscloud/outbound_settings/genesyscloud_outbound_settings_proxy.go index 7b61cb047..1c30b0a12 100644 --- a/genesyscloud/outbound_settings/genesyscloud_outbound_settings_proxy.go +++ b/genesyscloud/outbound_settings/genesyscloud_outbound_settings_proxy.go @@ -3,7 +3,7 @@ package outbound_settings import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings.go b/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings.go index c3e08b656..0febb5174 100644 --- a/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings.go +++ b/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings_utils.go b/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings_utils.go index 3a277589a..06c3989a6 100644 --- a/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings_utils.go +++ b/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings_utils.go @@ -2,7 +2,7 @@ package outbound_settings import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/tfexporter_state" "terraform-provider-genesyscloud/genesyscloud/util/lists" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" diff --git a/genesyscloud/outbound_wrapupcode_mappings/genesyscloud_wrapupcode_mappings_proxy.go b/genesyscloud/outbound_wrapupcode_mappings/genesyscloud_wrapupcode_mappings_proxy.go index 81986c753..16e688455 100644 --- a/genesyscloud/outbound_wrapupcode_mappings/genesyscloud_wrapupcode_mappings_proxy.go +++ b/genesyscloud/outbound_wrapupcode_mappings/genesyscloud_wrapupcode_mappings_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var internalProxy *outboundWrapupCodeMappingsProxy diff --git a/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcode_mappings_utils.go b/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcode_mappings_utils.go index 4140f32af..1785d9808 100644 --- a/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcode_mappings_utils.go +++ b/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcode_mappings_utils.go @@ -4,7 +4,7 @@ import ( lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // flattenOutboundWrapupCodeMappings maps a Genesys Cloud Wrapupcodemapping to a schema.Set diff --git a/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcodemappings.go b/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcodemappings.go index 97d6d62b5..cccca5eb1 100644 --- a/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcodemappings.go +++ b/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcodemappings.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // getOutboundWrapupCodeMappings is used by the exporter to return all wrapupcode mappings diff --git a/genesyscloud/process_automation_trigger/data_source_genesyscloud_processautomation_trigger.go b/genesyscloud/process_automation_trigger/data_source_genesyscloud_processautomation_trigger.go index 389f39a84..0a8ee565b 100644 --- a/genesyscloud/process_automation_trigger/data_source_genesyscloud_processautomation_trigger.go +++ b/genesyscloud/process_automation_trigger/data_source_genesyscloud_processautomation_trigger.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type ProcessAutomationTriggers struct { diff --git a/genesyscloud/process_automation_trigger/process_automation_triggers_proxy.go b/genesyscloud/process_automation_trigger/process_automation_triggers_proxy.go index 8bf04955e..3f6b07371 100644 --- a/genesyscloud/process_automation_trigger/process_automation_triggers_proxy.go +++ b/genesyscloud/process_automation_trigger/process_automation_triggers_proxy.go @@ -11,7 +11,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func postProcessAutomationTrigger(pat *ProcessAutomationTrigger, api *platformclientv2.IntegrationsApi) (*ProcessAutomationTrigger, *platformclientv2.APIResponse, error) { diff --git a/genesyscloud/process_automation_trigger/process_automations_triggers_struct.go b/genesyscloud/process_automation_trigger/process_automations_triggers_struct.go index 8da8c63f1..539b80dfd 100644 --- a/genesyscloud/process_automation_trigger/process_automations_triggers_struct.go +++ b/genesyscloud/process_automation_trigger/process_automations_triggers_struct.go @@ -3,7 +3,7 @@ package process_automation_trigger import ( "encoding/json" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type ProcessAutomationTrigger struct { diff --git a/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger.go b/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger.go index 440ce5d31..b6878f8a7 100644 --- a/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger.go +++ b/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger.go @@ -12,7 +12,7 @@ import ( "time" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger_test.go b/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger_test.go index fb52c29d8..e2905376f 100644 --- a/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger_test.go +++ b/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceProcessAutomationTrigger(t *testing.T) { diff --git a/genesyscloud/provider/division.go b/genesyscloud/provider/division.go index 5af549cd9..9fefad4a8 100644 --- a/genesyscloud/provider/division.go +++ b/genesyscloud/provider/division.go @@ -2,7 +2,7 @@ package provider import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "sync" ) diff --git a/genesyscloud/provider/provider.go b/genesyscloud/provider/provider.go index fc81e413b..346a29ffb 100644 --- a/genesyscloud/provider/provider.go +++ b/genesyscloud/provider/provider.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func init() { diff --git a/genesyscloud/provider/sdk_client_pool.go b/genesyscloud/provider/sdk_client_pool.go index 9b35c831a..0123f541c 100644 --- a/genesyscloud/provider/sdk_client_pool.go +++ b/genesyscloud/provider/sdk_client_pool.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // SDKClientPool holds a Pool of client configs for the Genesys Cloud SDK. One should be diff --git a/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_init_test.go b/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_init_test.go index aed83d2de..35700f2f1 100644 --- a/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_init_test.go +++ b/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_init_test.go @@ -14,7 +14,7 @@ import ( "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_proxy.go b/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_proxy.go index a5bfe82fa..0a9511ef9 100644 --- a/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_proxy.go +++ b/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_proxy.go @@ -4,7 +4,7 @@ import ( "context" "encoding/json" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "net/http" "net/url" ) diff --git a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy.go b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy.go index 53249f037..fc0777536 100644 --- a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy.go +++ b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_test.go b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_test.go index fe42d0576..0c1b4c0a8 100644 --- a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_test.go +++ b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_test.go @@ -22,7 +22,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_utils.go b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_utils.go index 8df77ba79..62037798c 100644 --- a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_utils.go +++ b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_utils.go @@ -10,7 +10,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/resource_cache/datasource_cache.go b/genesyscloud/resource_cache/datasource_cache.go index e430e8731..20559e103 100644 --- a/genesyscloud/resource_cache/datasource_cache.go +++ b/genesyscloud/resource_cache/datasource_cache.go @@ -8,7 +8,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // Cache for Data Sources diff --git a/genesyscloud/resource_exporter/resource_exporter.go b/genesyscloud/resource_exporter/resource_exporter.go index 3bf86c666..cccb3c43e 100644 --- a/genesyscloud/resource_exporter/resource_exporter.go +++ b/genesyscloud/resource_exporter/resource_exporter.go @@ -5,7 +5,7 @@ import ( "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "regexp" "strings" "sync" diff --git a/genesyscloud/resource_exporter/resource_exporter_custom.go b/genesyscloud/resource_exporter/resource_exporter_custom.go index b9ab366e6..70c976f12 100644 --- a/genesyscloud/resource_exporter/resource_exporter_custom.go +++ b/genesyscloud/resource_exporter/resource_exporter_custom.go @@ -3,7 +3,7 @@ package resource_exporter import ( "encoding/json" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "regexp" "strings" diff --git a/genesyscloud/resource_genesyscloud_architect_schedules.go b/genesyscloud/resource_genesyscloud_architect_schedules.go index 2b8184874..e8feb700c 100644 --- a/genesyscloud/resource_genesyscloud_architect_schedules.go +++ b/genesyscloud/resource_genesyscloud_architect_schedules.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/leekchan/timeutil" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllArchitectSchedules(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_auth_division.go b/genesyscloud/resource_genesyscloud_auth_division.go index 7c0fe5745..557ba05d2 100644 --- a/genesyscloud/resource_genesyscloud_auth_division.go +++ b/genesyscloud/resource_genesyscloud_auth_division.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllAuthDivisions(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_auth_division_test.go b/genesyscloud/resource_genesyscloud_auth_division_test.go index 033097f4c..3718f7d99 100644 --- a/genesyscloud/resource_genesyscloud_auth_division_test.go +++ b/genesyscloud/resource_genesyscloud_auth_division_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceAuthDivisionBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_idp_generic.go b/genesyscloud/resource_genesyscloud_idp_generic.go index e56c62d0f..8db0dad77 100644 --- a/genesyscloud/resource_genesyscloud_idp_generic.go +++ b/genesyscloud/resource_genesyscloud_idp_generic.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllIdpGeneric(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_idp_generic_test.go b/genesyscloud/resource_genesyscloud_idp_generic_test.go index a78c79e70..6043d440d 100644 --- a/genesyscloud/resource_genesyscloud_idp_generic_test.go +++ b/genesyscloud/resource_genesyscloud_idp_generic_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceIdpGeneric(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_idp_gsuite.go b/genesyscloud/resource_genesyscloud_idp_gsuite.go index 007c6b272..75a412cdc 100644 --- a/genesyscloud/resource_genesyscloud_idp_gsuite.go +++ b/genesyscloud/resource_genesyscloud_idp_gsuite.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllIdpGsuite(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_idp_gsuite_test.go b/genesyscloud/resource_genesyscloud_idp_gsuite_test.go index 3878a5764..38e02fab6 100644 --- a/genesyscloud/resource_genesyscloud_idp_gsuite_test.go +++ b/genesyscloud/resource_genesyscloud_idp_gsuite_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceIdpGsuite(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_idp_onelogin.go b/genesyscloud/resource_genesyscloud_idp_onelogin.go index 08a92192f..8191969da 100644 --- a/genesyscloud/resource_genesyscloud_idp_onelogin.go +++ b/genesyscloud/resource_genesyscloud_idp_onelogin.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllIdpOnelogin(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_idp_onelogin_test.go b/genesyscloud/resource_genesyscloud_idp_onelogin_test.go index 023d7df55..fcd55469b 100644 --- a/genesyscloud/resource_genesyscloud_idp_onelogin_test.go +++ b/genesyscloud/resource_genesyscloud_idp_onelogin_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceIdpOnelogin(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_idp_ping.go b/genesyscloud/resource_genesyscloud_idp_ping.go index 64a5140a1..5be98daf0 100644 --- a/genesyscloud/resource_genesyscloud_idp_ping.go +++ b/genesyscloud/resource_genesyscloud_idp_ping.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllIdpPing(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_idp_ping_test.go b/genesyscloud/resource_genesyscloud_idp_ping_test.go index d87e59944..1211c8230 100644 --- a/genesyscloud/resource_genesyscloud_idp_ping_test.go +++ b/genesyscloud/resource_genesyscloud_idp_ping_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceIdpPing(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_init_test.go b/genesyscloud/resource_genesyscloud_init_test.go index 0988af4f8..2281f5239 100644 --- a/genesyscloud/resource_genesyscloud_init_test.go +++ b/genesyscloud/resource_genesyscloud_init_test.go @@ -12,7 +12,7 @@ import ( "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_journey_action_map.go b/genesyscloud/resource_genesyscloud_journey_action_map.go index 76db967b7..7e1c583f0 100644 --- a/genesyscloud/resource_genesyscloud_journey_action_map.go +++ b/genesyscloud/resource_genesyscloud_journey_action_map.go @@ -25,7 +25,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_journey_action_map_test.go b/genesyscloud/resource_genesyscloud_journey_action_map_test.go index f0753a13e..22fa108ea 100644 --- a/genesyscloud/resource_genesyscloud_journey_action_map_test.go +++ b/genesyscloud/resource_genesyscloud_journey_action_map_test.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) const resourceName = "genesyscloud_journey_action_map" diff --git a/genesyscloud/resource_genesyscloud_journey_action_template.go b/genesyscloud/resource_genesyscloud_journey_action_template.go index 243f1d4bb..ecd418113 100644 --- a/genesyscloud/resource_genesyscloud_journey_action_template.go +++ b/genesyscloud/resource_genesyscloud_journey_action_template.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_journey_action_template_test.go b/genesyscloud/resource_genesyscloud_journey_action_template_test.go index ae33a8b3b..dd0cc9444 100644 --- a/genesyscloud/resource_genesyscloud_journey_action_template_test.go +++ b/genesyscloud/resource_genesyscloud_journey_action_template_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) const ActionTemplateResourceName = "genesyscloud_journey_action_template" diff --git a/genesyscloud/resource_genesyscloud_journey_outcome.go b/genesyscloud/resource_genesyscloud_journey_outcome.go index 8e163d2bd..40a1019ff 100644 --- a/genesyscloud/resource_genesyscloud_journey_outcome.go +++ b/genesyscloud/resource_genesyscloud_journey_outcome.go @@ -22,7 +22,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_journey_outcome_test.go b/genesyscloud/resource_genesyscloud_journey_outcome_test.go index 77fc9ba2f..5f52a59bd 100644 --- a/genesyscloud/resource_genesyscloud_journey_outcome_test.go +++ b/genesyscloud/resource_genesyscloud_journey_outcome_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceJourneyOutcome(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_journey_segment.go b/genesyscloud/resource_genesyscloud_journey_segment.go index 579f2c9ba..08bc2892b 100644 --- a/genesyscloud/resource_genesyscloud_journey_segment.go +++ b/genesyscloud/resource_genesyscloud_journey_segment.go @@ -22,7 +22,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_journey_segment_test.go b/genesyscloud/resource_genesyscloud_journey_segment_test.go index 165aa683b..7c7f57778 100644 --- a/genesyscloud/resource_genesyscloud_journey_segment_test.go +++ b/genesyscloud/resource_genesyscloud_journey_segment_test.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceJourneySegmentCustomer(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_category.go b/genesyscloud/resource_genesyscloud_knowledge_category.go index 5f302d90f..dc097759d 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_category.go +++ b/genesyscloud/resource_genesyscloud_knowledge_category.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_knowledge_category_test.go b/genesyscloud/resource_genesyscloud_knowledge_category_test.go index 0b4484661..06ca7764f 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_category_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_category_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceKnowledgeCategoryBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_document.go b/genesyscloud/resource_genesyscloud_knowledge_document.go index b11bb00c3..7c91e51bf 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_document.go +++ b/genesyscloud/resource_genesyscloud_knowledge_document.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_knowledge_document_test.go b/genesyscloud/resource_genesyscloud_knowledge_document_test.go index 33c78b2a8..0e47251ac 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_document_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_document_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceKnowledgeDocumentBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_document_variation.go b/genesyscloud/resource_genesyscloud_knowledge_document_variation.go index 9b55dc283..b0ed284f2 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_document_variation.go +++ b/genesyscloud/resource_genesyscloud_knowledge_document_variation.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_knowledge_document_variation_test.go b/genesyscloud/resource_genesyscloud_knowledge_document_variation_test.go index 68e05a00b..72e6fbfc4 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_document_variation_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_document_variation_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceKnowledgeDocumentVariationBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_knowledgebase.go b/genesyscloud/resource_genesyscloud_knowledge_knowledgebase.go index 0c549673a..4e824d71e 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_knowledgebase.go +++ b/genesyscloud/resource_genesyscloud_knowledge_knowledgebase.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllKnowledgeKnowledgebases(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_knowledgebase_test.go b/genesyscloud/resource_genesyscloud_knowledge_knowledgebase_test.go index 896cf6fce..798715ee1 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_knowledgebase_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_knowledgebase_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceKnowledgeKnowledgebaseBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_label.go b/genesyscloud/resource_genesyscloud_knowledge_label.go index 6e439d2b9..9b622e0ae 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_label.go +++ b/genesyscloud/resource_genesyscloud_knowledge_label.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_knowledge_label_test.go b/genesyscloud/resource_genesyscloud_knowledge_label_test.go index ef825655b..146fa7f36 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_label_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_label_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceKnowledgeLabelBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_v1_category.go b/genesyscloud/resource_genesyscloud_knowledge_v1_category.go index 6cb614dac..b5af3291e 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_v1_category.go +++ b/genesyscloud/resource_genesyscloud_knowledge_v1_category.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_knowledge_v1_category_test.go b/genesyscloud/resource_genesyscloud_knowledge_v1_category_test.go index b6f7b76d9..578c23b26 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_v1_category_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_v1_category_test.go @@ -8,7 +8,7 @@ package genesyscloud // "github.com/google/uuid" // "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" // "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" -// "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" +// "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" // ) // func TestAccResourceKnowledgeV1CategoryBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_v1_document.go b/genesyscloud/resource_genesyscloud_knowledge_v1_document.go index 6e9a363ad..a87a90384 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_v1_document.go +++ b/genesyscloud/resource_genesyscloud_knowledge_v1_document.go @@ -22,7 +22,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_knowledge_v1_document_test.go b/genesyscloud/resource_genesyscloud_knowledge_v1_document_test.go index 38266012f..b9ef197c6 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_v1_document_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_v1_document_test.go @@ -8,7 +8,7 @@ package genesyscloud // "github.com/google/uuid" // "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" // "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" -// "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" +// "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" // ) // func TestAccResourceKnowledgeV1DocumentBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_location.go b/genesyscloud/resource_genesyscloud_location.go index 693d9c7f5..eb2ac88e0 100644 --- a/genesyscloud/resource_genesyscloud_location.go +++ b/genesyscloud/resource_genesyscloud_location.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/nyaruka/phonenumbers" ) diff --git a/genesyscloud/resource_genesyscloud_location_test.go b/genesyscloud/resource_genesyscloud_location_test.go index db2a7036b..b34a8c149 100644 --- a/genesyscloud/resource_genesyscloud_location_test.go +++ b/genesyscloud/resource_genesyscloud_location_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceLocationBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_quality_forms_evaluation.go b/genesyscloud/resource_genesyscloud_quality_forms_evaluation.go index e037532e6..b048bda93 100644 --- a/genesyscloud/resource_genesyscloud_quality_forms_evaluation.go +++ b/genesyscloud/resource_genesyscloud_quality_forms_evaluation.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_quality_forms_evaluation_test.go b/genesyscloud/resource_genesyscloud_quality_forms_evaluation_test.go index da3edc9e7..bceeeff41 100644 --- a/genesyscloud/resource_genesyscloud_quality_forms_evaluation_test.go +++ b/genesyscloud/resource_genesyscloud_quality_forms_evaluation_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceEvaluationFormBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_quality_forms_survey.go b/genesyscloud/resource_genesyscloud_quality_forms_survey.go index fe3f68747..a8941b378 100644 --- a/genesyscloud/resource_genesyscloud_quality_forms_survey.go +++ b/genesyscloud/resource_genesyscloud_quality_forms_survey.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type SurveyFormStruct struct { diff --git a/genesyscloud/resource_genesyscloud_quality_forms_survey_test.go b/genesyscloud/resource_genesyscloud_quality_forms_survey_test.go index 774504d74..cf763718c 100644 --- a/genesyscloud/resource_genesyscloud_quality_forms_survey_test.go +++ b/genesyscloud/resource_genesyscloud_quality_forms_survey_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceSurveyFormBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_routing_email_domain.go b/genesyscloud/resource_genesyscloud_routing_email_domain.go index 9d1115f5d..e17c91191 100644 --- a/genesyscloud/resource_genesyscloud_routing_email_domain.go +++ b/genesyscloud/resource_genesyscloud_routing_email_domain.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllRoutingEmailDomains(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_routing_email_domain_test.go b/genesyscloud/resource_genesyscloud_routing_email_domain_test.go index 7b2684574..016f54c20 100644 --- a/genesyscloud/resource_genesyscloud_routing_email_domain_test.go +++ b/genesyscloud/resource_genesyscloud_routing_email_domain_test.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceRoutingEmailDomainSub(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_routing_language.go b/genesyscloud/resource_genesyscloud_routing_language.go index bb08ca53e..e30132331 100644 --- a/genesyscloud/resource_genesyscloud_routing_language.go +++ b/genesyscloud/resource_genesyscloud_routing_language.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllRoutingLanguages(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_routing_language_test.go b/genesyscloud/resource_genesyscloud_routing_language_test.go index 228fd997d..a3f416a09 100644 --- a/genesyscloud/resource_genesyscloud_routing_language_test.go +++ b/genesyscloud/resource_genesyscloud_routing_language_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceRoutingLanguageBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_routing_settings.go b/genesyscloud/resource_genesyscloud_routing_settings.go index 0e79aff55..fa76665f8 100644 --- a/genesyscloud/resource_genesyscloud_routing_settings.go +++ b/genesyscloud/resource_genesyscloud_routing_settings.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func ResourceRoutingSettings() *schema.Resource { diff --git a/genesyscloud/resource_genesyscloud_routing_skill.go b/genesyscloud/resource_genesyscloud_routing_skill.go index d0ac11e3e..91ccf0574 100644 --- a/genesyscloud/resource_genesyscloud_routing_skill.go +++ b/genesyscloud/resource_genesyscloud_routing_skill.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllRoutingSkills(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_routing_skill_group.go b/genesyscloud/resource_genesyscloud_routing_skill_group.go index b91cbd6d4..28886af01 100644 --- a/genesyscloud/resource_genesyscloud_routing_skill_group.go +++ b/genesyscloud/resource_genesyscloud_routing_skill_group.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type SkillGroupsRequest struct { diff --git a/genesyscloud/resource_genesyscloud_routing_skill_group_test.go b/genesyscloud/resource_genesyscloud_routing_skill_group_test.go index 4c7caa783..ee5bd2120 100644 --- a/genesyscloud/resource_genesyscloud_routing_skill_group_test.go +++ b/genesyscloud/resource_genesyscloud_routing_skill_group_test.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func testAccCheckSkillConditions(resourceName string, targetSkillConditionJson string) resource.TestCheckFunc { diff --git a/genesyscloud/resource_genesyscloud_routing_skill_test.go b/genesyscloud/resource_genesyscloud_routing_skill_test.go index b213ac5af..551c061a6 100644 --- a/genesyscloud/resource_genesyscloud_routing_skill_test.go +++ b/genesyscloud/resource_genesyscloud_routing_skill_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceRoutingSkillBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_routing_utilization.go b/genesyscloud/resource_genesyscloud_routing_utilization.go index 3cc9614df..3b097bcaf 100644 --- a/genesyscloud/resource_genesyscloud_routing_utilization.go +++ b/genesyscloud/resource_genesyscloud_routing_utilization.go @@ -22,7 +22,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type MediaUtilization struct { diff --git a/genesyscloud/resource_genesyscloud_routing_utilization_label.go b/genesyscloud/resource_genesyscloud_routing_utilization_label.go index 209be66a0..6a625e1e2 100644 --- a/genesyscloud/resource_genesyscloud_routing_utilization_label.go +++ b/genesyscloud/resource_genesyscloud_routing_utilization_label.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllRoutingUtilizationLabels(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_routing_utilization_label_test.go b/genesyscloud/resource_genesyscloud_routing_utilization_label_test.go index f73fbfa58..83c153f26 100644 --- a/genesyscloud/resource_genesyscloud_routing_utilization_label_test.go +++ b/genesyscloud/resource_genesyscloud_routing_utilization_label_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceRoutingUtilizationLabelBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_routing_utilization_test.go b/genesyscloud/resource_genesyscloud_routing_utilization_test.go index 65f90323c..09b7c8b73 100644 --- a/genesyscloud/resource_genesyscloud_routing_utilization_test.go +++ b/genesyscloud/resource_genesyscloud_routing_utilization_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceBasicRoutingUtilization(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_routing_wrapupcode.go b/genesyscloud/resource_genesyscloud_routing_wrapupcode.go index 32e3be970..962e28073 100644 --- a/genesyscloud/resource_genesyscloud_routing_wrapupcode.go +++ b/genesyscloud/resource_genesyscloud_routing_wrapupcode.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllRoutingWrapupCodes(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_routing_wrapupcode_test.go b/genesyscloud/resource_genesyscloud_routing_wrapupcode_test.go index 7102e6167..d4becc64d 100644 --- a/genesyscloud/resource_genesyscloud_routing_wrapupcode_test.go +++ b/genesyscloud/resource_genesyscloud_routing_wrapupcode_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceRoutingWrapupcode(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_user.go b/genesyscloud/resource_genesyscloud_user.go index 8387da786..cde674ba8 100644 --- a/genesyscloud/resource_genesyscloud_user.go +++ b/genesyscloud/resource_genesyscloud_user.go @@ -23,7 +23,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/nyaruka/phonenumbers" ) diff --git a/genesyscloud/resource_genesyscloud_user_test.go b/genesyscloud/resource_genesyscloud_user_test.go index 37c39f245..346726a7c 100644 --- a/genesyscloud/resource_genesyscloud_user_test.go +++ b/genesyscloud/resource_genesyscloud_user_test.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceUserBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_widget_deployment.go b/genesyscloud/resource_genesyscloud_widget_deployment.go index 9ca823d39..bda97d577 100644 --- a/genesyscloud/resource_genesyscloud_widget_deployment.go +++ b/genesyscloud/resource_genesyscloud_widget_deployment.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) const ( diff --git a/genesyscloud/resource_genesyscloud_widget_deployment_test.go b/genesyscloud/resource_genesyscloud_widget_deployment_test.go index e3552fd4f..0c69204b7 100644 --- a/genesyscloud/resource_genesyscloud_widget_deployment_test.go +++ b/genesyscloud/resource_genesyscloud_widget_deployment_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type widgetDeploymentConfig struct { diff --git a/genesyscloud/responsemanagement_library/genesyscloud_responsemanagement_library_proxy.go b/genesyscloud/responsemanagement_library/genesyscloud_responsemanagement_library_proxy.go index e7e23345e..9478205ec 100644 --- a/genesyscloud/responsemanagement_library/genesyscloud_responsemanagement_library_proxy.go +++ b/genesyscloud/responsemanagement_library/genesyscloud_responsemanagement_library_proxy.go @@ -3,7 +3,7 @@ package responsemanagement_library import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" ) diff --git a/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library.go b/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library.go index 0e2f0be41..2970dd174 100644 --- a/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library.go +++ b/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" diff --git a/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library_test.go b/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library_test.go index 3b1498207..2724c81d1 100644 --- a/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library_test.go +++ b/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceResponseManagementLibrary(t *testing.T) { diff --git a/genesyscloud/responsemanagement_response/genesyscloud_responsemanagement_response_proxy.go b/genesyscloud/responsemanagement_response/genesyscloud_responsemanagement_response_proxy.go index c953cc583..70921cbd8 100644 --- a/genesyscloud/responsemanagement_response/genesyscloud_responsemanagement_response_proxy.go +++ b/genesyscloud/responsemanagement_response/genesyscloud_responsemanagement_response_proxy.go @@ -3,7 +3,7 @@ package responsemanagement_response import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" ) diff --git a/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response.go b/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response.go index bdfc740c5..5e7dec46c 100644 --- a/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response.go +++ b/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_test.go b/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_test.go index b3ea85af4..c9dbca7a6 100644 --- a/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_test.go +++ b/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_test.go @@ -16,7 +16,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceResponseManagementResponseFooterField(t *testing.T) { diff --git a/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_utils.go b/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_utils.go index de743a6d8..f2dd8555f 100644 --- a/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_utils.go +++ b/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_utils.go @@ -2,7 +2,7 @@ package responsemanagement_response import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/lists" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" diff --git a/genesyscloud/responsemanagement_responseasset/genesyscloud_responsemanagement_responseasset_proxy.go b/genesyscloud/responsemanagement_responseasset/genesyscloud_responsemanagement_responseasset_proxy.go index 7280c1cb2..fe64370e1 100644 --- a/genesyscloud/responsemanagement_responseasset/genesyscloud_responsemanagement_responseasset_proxy.go +++ b/genesyscloud/responsemanagement_responseasset/genesyscloud_responsemanagement_responseasset_proxy.go @@ -6,7 +6,7 @@ import ( "log" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset.go b/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset.go index 811114b7b..94a4a0c2e 100644 --- a/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset.go +++ b/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset_test.go b/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset_test.go index 5442793fb..7cb665c73 100644 --- a/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset_test.go +++ b/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceResponseManagementResponseAsset(t *testing.T) { diff --git a/genesyscloud/routing_email_route/genesyscloud_routing_email_route_proxy.go b/genesyscloud/routing_email_route/genesyscloud_routing_email_route_proxy.go index 771340b62..6c8df29b3 100644 --- a/genesyscloud/routing_email_route/genesyscloud_routing_email_route_proxy.go +++ b/genesyscloud/routing_email_route/genesyscloud_routing_email_route_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route.go b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route.go index 0ede89be7..8bdffc449 100644 --- a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route.go +++ b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go index 941e6c4c8..4cec51ca3 100644 --- a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go +++ b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceRoutingEmailRoute(t *testing.T) { diff --git a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_utils.go b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_utils.go index 1eeb0cc73..c47783f4b 100644 --- a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_utils.go +++ b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_utils.go @@ -8,7 +8,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/routing_queue/data_source_genesyscloud_routing_queue.go b/genesyscloud/routing_queue/data_source_genesyscloud_routing_queue.go index 67c47b23e..b5f6e49b5 100644 --- a/genesyscloud/routing_queue/data_source_genesyscloud_routing_queue.go +++ b/genesyscloud/routing_queue/data_source_genesyscloud_routing_queue.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" ) diff --git a/genesyscloud/routing_queue/genesyscloud_routing_queue_proxy.go b/genesyscloud/routing_queue/genesyscloud_routing_queue_proxy.go index 932d59931..3a06aa969 100644 --- a/genesyscloud/routing_queue/genesyscloud_routing_queue_proxy.go +++ b/genesyscloud/routing_queue/genesyscloud_routing_queue_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue.go b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue.go index c9704f65a..04f5a1450 100644 --- a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue.go +++ b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue.go @@ -25,7 +25,7 @@ import ( "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var bullseyeExpansionTypeTimeout = "TIMEOUT_SECONDS" diff --git a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go index d4a8c70c1..b59182aab 100644 --- a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go +++ b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go @@ -17,7 +17,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceRoutingQueueBasic(t *testing.T) { diff --git a/genesyscloud/routing_queue_conditional_group_routing/genesyscloud_routing_queue_conditional_group_routing_proxy.go b/genesyscloud/routing_queue_conditional_group_routing/genesyscloud_routing_queue_conditional_group_routing_proxy.go index 362c8d5eb..8072bfcc7 100644 --- a/genesyscloud/routing_queue_conditional_group_routing/genesyscloud_routing_queue_conditional_group_routing_proxy.go +++ b/genesyscloud/routing_queue_conditional_group_routing/genesyscloud_routing_queue_conditional_group_routing_proxy.go @@ -3,7 +3,7 @@ package routing_queue_conditional_group_routing import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" ) diff --git a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing.go b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing.go index 028b585e7..a0d3b94a3 100644 --- a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing.go +++ b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "strings" consistencyChecker "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_test.go b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_test.go index 03d3566a0..a8abe0fa1 100644 --- a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_test.go +++ b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_test.go @@ -18,7 +18,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_unit_test.go b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_unit_test.go index e71ff2d42..16b682245 100644 --- a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_unit_test.go +++ b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_unit_test.go @@ -5,7 +5,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/stretchr/testify/assert" "net/http" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/routing_queue_outbound_email_address/genesyscloud_routing_queue_outbound_email_address_proxy.go b/genesyscloud/routing_queue_outbound_email_address/genesyscloud_routing_queue_outbound_email_address_proxy.go index 0972d7cd5..e12da7114 100644 --- a/genesyscloud/routing_queue_outbound_email_address/genesyscloud_routing_queue_outbound_email_address_proxy.go +++ b/genesyscloud/routing_queue_outbound_email_address/genesyscloud_routing_queue_outbound_email_address_proxy.go @@ -3,7 +3,7 @@ package routing_queue_outbound_email_address import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" ) diff --git a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address.go b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address.go index 97a3e55b2..e94fdaee1 100644 --- a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address.go +++ b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "strings" consistencyChecker "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_test.go b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_test.go index 8bf3a50b9..cfac071ce 100644 --- a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_test.go +++ b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_test.go @@ -5,7 +5,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "os" "strings" diff --git a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_unit_test.go b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_unit_test.go index 4f0368308..6ef38582c 100644 --- a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_unit_test.go +++ b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_unit_test.go @@ -4,7 +4,7 @@ import ( "context" "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/stretchr/testify/assert" "net/http" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/routing_sms_addresses/genesyscloud_routing_sms_addresses_proxy.go b/genesyscloud/routing_sms_addresses/genesyscloud_routing_sms_addresses_proxy.go index 950087dc4..4da161286 100644 --- a/genesyscloud/routing_sms_addresses/genesyscloud_routing_sms_addresses_proxy.go +++ b/genesyscloud/routing_sms_addresses/genesyscloud_routing_sms_addresses_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // Type definitions for each func on our proxy so we can easily mock them out later diff --git a/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses.go b/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses.go index 932dad163..d578d8b0c 100644 --- a/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses.go +++ b/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) const resourceName = "genesyscloud_routing_sms_address" diff --git a/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses_test.go b/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses_test.go index a54f64e56..4d4185ee8 100644 --- a/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses_test.go +++ b/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceRoutingSmsAddressesProdOrg(t *testing.T) { diff --git a/genesyscloud/scripts/genesyscloud_scripts_proxy.go b/genesyscloud/scripts/genesyscloud_scripts_proxy.go index f69d0ea13..7f5a53860 100644 --- a/genesyscloud/scripts/genesyscloud_scripts_proxy.go +++ b/genesyscloud/scripts/genesyscloud_scripts_proxy.go @@ -14,7 +14,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/files" "time" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/scripts/resource_genesyscloud_script.go b/genesyscloud/scripts/resource_genesyscloud_script.go index e2f63d14a..53df15885 100644 --- a/genesyscloud/scripts/resource_genesyscloud_script.go +++ b/genesyscloud/scripts/resource_genesyscloud_script.go @@ -12,7 +12,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/genesyscloud/scripts/resource_genesyscloud_script_test.go b/genesyscloud/scripts/resource_genesyscloud_script_test.go index 1c7d9d7cf..23d3a7471 100644 --- a/genesyscloud/scripts/resource_genesyscloud_script_test.go +++ b/genesyscloud/scripts/resource_genesyscloud_script_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/station/genesyscloud_station_init_test.go b/genesyscloud/station/genesyscloud_station_init_test.go index 3db79e890..9641ffcb3 100644 --- a/genesyscloud/station/genesyscloud_station_init_test.go +++ b/genesyscloud/station/genesyscloud_station_init_test.go @@ -6,7 +6,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" "testing" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" gcloud "terraform-provider-genesyscloud/genesyscloud" edgePhone "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_phone" diff --git a/genesyscloud/station/genesyscloud_station_proxy.go b/genesyscloud/station/genesyscloud_station_proxy.go index 7c53e5b68..7486790e1 100644 --- a/genesyscloud/station/genesyscloud_station_proxy.go +++ b/genesyscloud/station/genesyscloud_station_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // internalProxy holds a proxy instance that can be used throughout the package diff --git a/genesyscloud/task_management_workbin/genesyscloud_task_management_workbin_proxy.go b/genesyscloud/task_management_workbin/genesyscloud_task_management_workbin_proxy.go index 29ec9c976..acbe12980 100644 --- a/genesyscloud/task_management_workbin/genesyscloud_task_management_workbin_proxy.go +++ b/genesyscloud/task_management_workbin/genesyscloud_task_management_workbin_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin.go b/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin.go index fe2f8a596..5b4c8a5f5 100644 --- a/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin.go +++ b/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin_test.go b/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin_test.go index 42c8ab351..b468918ea 100644 --- a/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin_test.go +++ b/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin_test.go @@ -12,7 +12,7 @@ import ( gcloud "terraform-provider-genesyscloud/genesyscloud" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workitem/genesyscloud_task_management_workitem_proxy.go b/genesyscloud/task_management_workitem/genesyscloud_task_management_workitem_proxy.go index fa433e4bf..82aa8f0c4 100644 --- a/genesyscloud/task_management_workitem/genesyscloud_task_management_workitem_proxy.go +++ b/genesyscloud/task_management_workitem/genesyscloud_task_management_workitem_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem.go b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem.go index bbff9db3f..9f5494392 100644 --- a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem.go +++ b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_test.go b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_test.go index 5b74074ae..c9d31132c 100644 --- a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_test.go +++ b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_test.go @@ -23,7 +23,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_unit_test.go b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_unit_test.go index 15c62f936..591301bbb 100644 --- a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_unit_test.go +++ b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_unit_test.go @@ -16,7 +16,7 @@ import ( lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_utils.go b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_utils.go index 9c60e471d..6d3ab7ebf 100644 --- a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_utils.go +++ b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_utils.go @@ -9,7 +9,7 @@ import ( lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workitem_schema/genesyscloud_task_management_workitem_schema_proxy.go b/genesyscloud/task_management_workitem_schema/genesyscloud_task_management_workitem_schema_proxy.go index 429ce6e42..a93f33c34 100644 --- a/genesyscloud/task_management_workitem_schema/genesyscloud_task_management_workitem_schema_proxy.go +++ b/genesyscloud/task_management_workitem_schema/genesyscloud_task_management_workitem_schema_proxy.go @@ -8,7 +8,7 @@ import ( "log" "net/http" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema.go b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema.go index 15fe49c6c..f96eba1df 100644 --- a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema.go +++ b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_test.go b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_test.go index ae8816ddc..f043ef040 100644 --- a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_test.go +++ b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_test.go @@ -15,7 +15,7 @@ import ( lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_unit_test.go b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_unit_test.go index e61aaa110..d9914e3b1 100644 --- a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_unit_test.go +++ b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_unit_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/stretchr/testify/assert" ) diff --git a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_utils.go b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_utils.go index 8ff481cfe..7594a8ccf 100644 --- a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_utils.go +++ b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_utils.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) const ( diff --git a/genesyscloud/task_management_worktype/data_source_genesyscloud_task_management_unit_test.go b/genesyscloud/task_management_worktype/data_source_genesyscloud_task_management_unit_test.go index 40114afbc..6cfd137aa 100644 --- a/genesyscloud/task_management_worktype/data_source_genesyscloud_task_management_unit_test.go +++ b/genesyscloud/task_management_worktype/data_source_genesyscloud_task_management_unit_test.go @@ -4,7 +4,7 @@ import ( "context" "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/stretchr/testify/assert" "terraform-provider-genesyscloud/genesyscloud/provider" "testing" diff --git a/genesyscloud/task_management_worktype/genesyscloud_task_management_worktype_proxy.go b/genesyscloud/task_management_worktype/genesyscloud_task_management_worktype_proxy.go index 94775d19a..5f5417369 100644 --- a/genesyscloud/task_management_worktype/genesyscloud_task_management_worktype_proxy.go +++ b/genesyscloud/task_management_worktype/genesyscloud_task_management_worktype_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype.go b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype.go index 4797b1148..df9a05aa0 100644 --- a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype.go +++ b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_test.go b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_test.go index 6354c352b..f796b484d 100644 --- a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_test.go +++ b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_test.go @@ -18,7 +18,7 @@ import ( workitemSchema "terraform-provider-genesyscloud/genesyscloud/task_management_workitem_schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_unit_test.go b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_unit_test.go index fd10b5a50..aefbe1a22 100644 --- a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_unit_test.go +++ b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_unit_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/stretchr/testify/assert" ) diff --git a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go index 22ff63545..79284a9b9 100644 --- a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go +++ b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go @@ -7,7 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/team/genesyscloud_team_proxy.go b/genesyscloud/team/genesyscloud_team_proxy.go index b22b302eb..2880ca8c0 100644 --- a/genesyscloud/team/genesyscloud_team_proxy.go +++ b/genesyscloud/team/genesyscloud_team_proxy.go @@ -6,7 +6,7 @@ import ( "log" "terraform-provider-genesyscloud/genesyscloud/util" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/team/resource_genesyscloud_team.go b/genesyscloud/team/resource_genesyscloud_team.go index f6c10156b..2c6d8414e 100644 --- a/genesyscloud/team/resource_genesyscloud_team.go +++ b/genesyscloud/team/resource_genesyscloud_team.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" diff --git a/genesyscloud/team/resource_genesyscloud_team_test.go b/genesyscloud/team/resource_genesyscloud_team_test.go index 978b50b0f..03bede55f 100644 --- a/genesyscloud/team/resource_genesyscloud_team_test.go +++ b/genesyscloud/team/resource_genesyscloud_team_test.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "math/rand" "strings" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/team/resource_genesyscloud_team_unit_test.go b/genesyscloud/team/resource_genesyscloud_team_unit_test.go index 85b77b13d..3b3e670cb 100644 --- a/genesyscloud/team/resource_genesyscloud_team_unit_test.go +++ b/genesyscloud/team/resource_genesyscloud_team_unit_test.go @@ -11,7 +11,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/stretchr/testify/assert" ) diff --git a/genesyscloud/team/resource_genesyscloud_team_utils.go b/genesyscloud/team/resource_genesyscloud_team_utils.go index 8feb15f32..8c926b239 100644 --- a/genesyscloud/team/resource_genesyscloud_team_utils.go +++ b/genesyscloud/team/resource_genesyscloud_team_utils.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "strings" "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/chunks" diff --git a/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings.go b/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings.go index 8e7d312bd..9655fd4ab 100644 --- a/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings.go +++ b/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings.go @@ -22,7 +22,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) const ( diff --git a/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings_test.go b/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings_test.go index 200b798c3..d0a1ecab1 100644 --- a/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings_test.go +++ b/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceTrunkBaseSettings(t *testing.T) { diff --git a/genesyscloud/telephony_providers_edges_did/genesyscloud_telephony_providers_edges_did_proxy.go b/genesyscloud/telephony_providers_edges_did/genesyscloud_telephony_providers_edges_did_proxy.go index 9e43bbe64..553f33454 100644 --- a/genesyscloud/telephony_providers_edges_did/genesyscloud_telephony_providers_edges_did_proxy.go +++ b/genesyscloud/telephony_providers_edges_did/genesyscloud_telephony_providers_edges_did_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/telephony_providers_edges_did_pool/genesyscloud_telephony_providers_edges_did_pool_proxy.go b/genesyscloud/telephony_providers_edges_did_pool/genesyscloud_telephony_providers_edges_did_pool_proxy.go index e34798b05..65d2cdb54 100644 --- a/genesyscloud/telephony_providers_edges_did_pool/genesyscloud_telephony_providers_edges_did_pool_proxy.go +++ b/genesyscloud/telephony_providers_edges_did_pool/genesyscloud_telephony_providers_edges_did_pool_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool.go b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool.go index 5e97624a4..a0a870405 100644 --- a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool.go +++ b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // getAllDidPools retrieves all DID pools and is used for the exporter diff --git a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_test.go b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_test.go index 25e5b05c6..184070128 100644 --- a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_test.go +++ b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceDidPoolBasic(t *testing.T) { diff --git a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_utils.go b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_utils.go index ecc8d1f93..2f7ffa5c9 100644 --- a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_utils.go +++ b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_utils.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type DidPoolStruct struct { diff --git a/genesyscloud/telephony_providers_edges_edge_group/genesyscloud_telephony_providers_edges_edge_group_proxy.go b/genesyscloud/telephony_providers_edges_edge_group/genesyscloud_telephony_providers_edges_edge_group_proxy.go index 9da50ec91..6db0ceb02 100644 --- a/genesyscloud/telephony_providers_edges_edge_group/genesyscloud_telephony_providers_edges_edge_group_proxy.go +++ b/genesyscloud/telephony_providers_edges_edge_group/genesyscloud_telephony_providers_edges_edge_group_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var internalProxy *edgeGroupProxy diff --git a/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group.go b/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group.go index fd3498481..45882bed4 100644 --- a/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group.go +++ b/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func createEdgeGroup(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { diff --git a/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_test.go b/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_test.go index 02733951a..6c0968e95 100644 --- a/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_test.go +++ b/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceEdgeGroup(t *testing.T) { diff --git a/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_utils.go b/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_utils.go index e6f109eeb..6089618c0 100644 --- a/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_utils.go +++ b/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_utils.go @@ -6,7 +6,7 @@ import ( lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func buildSdkTrunkBases(d *schema.ResourceData) *[]platformclientv2.Trunkbase { diff --git a/genesyscloud/telephony_providers_edges_extension_pool/genesyscloud_telephony_providers_edges_extension_pool_proxy.go b/genesyscloud/telephony_providers_edges_extension_pool/genesyscloud_telephony_providers_edges_extension_pool_proxy.go index ebbe202d2..21de47b35 100644 --- a/genesyscloud/telephony_providers_edges_extension_pool/genesyscloud_telephony_providers_edges_extension_pool_proxy.go +++ b/genesyscloud/telephony_providers_edges_extension_pool/genesyscloud_telephony_providers_edges_extension_pool_proxy.go @@ -3,7 +3,7 @@ package telephony_providers_edges_extension_pool import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var internalProxy *extensionPoolProxy diff --git a/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool.go b/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool.go index b87e18f1a..4cbe729b1 100644 --- a/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool.go +++ b/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllExtensionPools(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool_test.go b/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool_test.go index 0d1d75364..84a0d93a0 100644 --- a/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool_test.go +++ b/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type extensionPoolStruct struct { diff --git a/genesyscloud/telephony_providers_edges_linebasesettings/data_source_genesyscloud_telephony_providers_edges_linebasesettings.go b/genesyscloud/telephony_providers_edges_linebasesettings/data_source_genesyscloud_telephony_providers_edges_linebasesettings.go index f4926b3e0..912f7a8b7 100644 --- a/genesyscloud/telephony_providers_edges_linebasesettings/data_source_genesyscloud_telephony_providers_edges_linebasesettings.go +++ b/genesyscloud/telephony_providers_edges_linebasesettings/data_source_genesyscloud_telephony_providers_edges_linebasesettings.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceLineBaseSettingsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { diff --git a/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_init_test.go b/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_init_test.go index 3f58aa899..ddfe3a1b9 100644 --- a/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_init_test.go +++ b/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_init_test.go @@ -10,7 +10,7 @@ import ( edgeSite "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site" "testing" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_proxy.go b/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_proxy.go index cb4225e0a..648447fb6 100644 --- a/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_proxy.go +++ b/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_proxy.go @@ -8,7 +8,7 @@ import ( rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go index f35777cd5..00c3283b7 100644 --- a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go +++ b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllPhones(ctx context.Context, sdkConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go index eca79cff8..772ae6f4f 100644 --- a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go +++ b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go @@ -17,7 +17,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourcePhoneBasic(t *testing.T) { diff --git a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go index 791aed325..d0a9960b9 100644 --- a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go +++ b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type PhoneConfig struct { diff --git a/genesyscloud/telephony_providers_edges_phonebasesettings/data_source_genesyscloud_telephony_providers_edges_phonebasesettings.go b/genesyscloud/telephony_providers_edges_phonebasesettings/data_source_genesyscloud_telephony_providers_edges_phonebasesettings.go index e0f6d3235..ddbafa09b 100644 --- a/genesyscloud/telephony_providers_edges_phonebasesettings/data_source_genesyscloud_telephony_providers_edges_phonebasesettings.go +++ b/genesyscloud/telephony_providers_edges_phonebasesettings/data_source_genesyscloud_telephony_providers_edges_phonebasesettings.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourcePhoneBaseSettingsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { diff --git a/genesyscloud/telephony_providers_edges_phonebasesettings/genesyscloud_telephony_providers_edges_phonebasesettings_proxy.go b/genesyscloud/telephony_providers_edges_phonebasesettings/genesyscloud_telephony_providers_edges_phonebasesettings_proxy.go index 047852220..47093078c 100644 --- a/genesyscloud/telephony_providers_edges_phonebasesettings/genesyscloud_telephony_providers_edges_phonebasesettings_proxy.go +++ b/genesyscloud/telephony_providers_edges_phonebasesettings/genesyscloud_telephony_providers_edges_phonebasesettings_proxy.go @@ -3,7 +3,7 @@ package telephony_providers_edges_phonebasesettings import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var internalProxy *phoneBaseProxy diff --git a/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings.go b/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings.go index 99fb59df0..3ac3ed4dd 100644 --- a/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings.go +++ b/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func createPhoneBaseSettings(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { diff --git a/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_test.go b/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_test.go index 1fc69d1ac..864dc06f4 100644 --- a/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_test.go +++ b/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_test.go @@ -11,7 +11,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourcePhoneBaseSettings(t *testing.T) { diff --git a/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_utils.go b/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_utils.go index c2ad0afb9..9cd0bc6be 100644 --- a/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_utils.go +++ b/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_utils.go @@ -7,7 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func generatePhoneBaseSettingsDataSource( diff --git a/genesyscloud/telephony_providers_edges_site/data_source_genesyscloud_telephony_providers_edges_site_test.go b/genesyscloud/telephony_providers_edges_site/data_source_genesyscloud_telephony_providers_edges_site_test.go index fd5744d2d..1ca6a3319 100644 --- a/genesyscloud/telephony_providers_edges_site/data_source_genesyscloud_telephony_providers_edges_site_test.go +++ b/genesyscloud/telephony_providers_edges_site/data_source_genesyscloud_telephony_providers_edges_site_test.go @@ -7,7 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "testing" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" gcloud "terraform-provider-genesyscloud/genesyscloud" diff --git a/genesyscloud/telephony_providers_edges_site/genesyscloud_telephony_providers_edges_site_proxy.go b/genesyscloud/telephony_providers_edges_site/genesyscloud_telephony_providers_edges_site_proxy.go index a6f87a171..bd7b487ee 100644 --- a/genesyscloud/telephony_providers_edges_site/genesyscloud_telephony_providers_edges_site_proxy.go +++ b/genesyscloud/telephony_providers_edges_site/genesyscloud_telephony_providers_edges_site_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site.go b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site.go index dffc909f0..ce158dc38 100644 --- a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site.go +++ b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllSites(ctx context.Context, sdkConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_schema.go b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_schema.go index 5a952fc84..097a5cd00 100644 --- a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_schema.go +++ b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_schema.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" diff --git a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_test.go b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_test.go index aa1a90ca5..d601105cc 100644 --- a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_test.go +++ b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_test.go @@ -18,7 +18,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceSite(t *testing.T) { diff --git a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_utils.go b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_utils.go index 6c90c19a2..4cfd92d46 100644 --- a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_utils.go +++ b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_utils.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/leekchan/timeutil" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_init_test.go b/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_init_test.go index e8ace3917..dfa9e4042 100644 --- a/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_init_test.go +++ b/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_init_test.go @@ -2,7 +2,7 @@ package telephony_providers_edges_site_outbound_route import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "sync" gcloud "terraform-provider-genesyscloud/genesyscloud" diff --git a/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_proxy.go b/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_proxy.go index a45e1c589..d9ff5d76c 100644 --- a/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_proxy.go +++ b/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_proxy.go @@ -2,7 +2,7 @@ package telephony_providers_edges_site_outbound_route import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" telephonyProvidersEdgesSite "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site" ) diff --git a/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route.go b/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route.go index 91d094ef3..bcbab805e 100644 --- a/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route.go +++ b/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_utils.go b/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_utils.go index ff069de53..ababd9fe0 100644 --- a/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_utils.go +++ b/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_utils.go @@ -2,7 +2,7 @@ package telephony_providers_edges_site_outbound_route import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" ) diff --git a/genesyscloud/telephony_providers_edges_trunk/data_source_genesyscloud_telephony_providers_edges_trunk.go b/genesyscloud/telephony_providers_edges_trunk/data_source_genesyscloud_telephony_providers_edges_trunk.go index c6d9bbfc9..de61a6741 100644 --- a/genesyscloud/telephony_providers_edges_trunk/data_source_genesyscloud_telephony_providers_edges_trunk.go +++ b/genesyscloud/telephony_providers_edges_trunk/data_source_genesyscloud_telephony_providers_edges_trunk.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceTrunkRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { diff --git a/genesyscloud/telephony_providers_edges_trunk/genesyscloud_telephony_providers_edges_trunk_proxy.go b/genesyscloud/telephony_providers_edges_trunk/genesyscloud_telephony_providers_edges_trunk_proxy.go index 1cefe3a53..4f2138191 100644 --- a/genesyscloud/telephony_providers_edges_trunk/genesyscloud_telephony_providers_edges_trunk_proxy.go +++ b/genesyscloud/telephony_providers_edges_trunk/genesyscloud_telephony_providers_edges_trunk_proxy.go @@ -3,7 +3,7 @@ package telephony_providers_edges_trunk import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) //generate a proxy for telephony_providers_edges_trunk diff --git a/genesyscloud/telephony_providers_edges_trunk/resource_genesyscloud_telephony_providers_edges_trunk.go b/genesyscloud/telephony_providers_edges_trunk/resource_genesyscloud_telephony_providers_edges_trunk.go index c303bc43f..af15ea366 100644 --- a/genesyscloud/telephony_providers_edges_trunk/resource_genesyscloud_telephony_providers_edges_trunk.go +++ b/genesyscloud/telephony_providers_edges_trunk/resource_genesyscloud_telephony_providers_edges_trunk.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func createTrunk(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { diff --git a/genesyscloud/tfexporter/genesyscloud_resource_exporter.go b/genesyscloud/tfexporter/genesyscloud_resource_exporter.go index 35e878b48..9ada32053 100644 --- a/genesyscloud/tfexporter/genesyscloud_resource_exporter.go +++ b/genesyscloud/tfexporter/genesyscloud_resource_exporter.go @@ -29,7 +29,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/mohae/deepcopy" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/tfexporter/genesyscloud_resource_exporter_test.go b/genesyscloud/tfexporter/genesyscloud_resource_exporter_test.go index e1b4a0619..1f85ff1ff 100644 --- a/genesyscloud/tfexporter/genesyscloud_resource_exporter_test.go +++ b/genesyscloud/tfexporter/genesyscloud_resource_exporter_test.go @@ -4,7 +4,7 @@ import ( "context" "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "reflect" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" diff --git a/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go b/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go index d225adea1..6a3dec660 100644 --- a/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go +++ b/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go @@ -23,7 +23,7 @@ import ( "testing" "time" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/testrunner" diff --git a/genesyscloud/user_roles/genesyscloud_user_roles_proxy.go b/genesyscloud/user_roles/genesyscloud_user_roles_proxy.go index c82c59768..348ca624b 100644 --- a/genesyscloud/user_roles/genesyscloud_user_roles_proxy.go +++ b/genesyscloud/user_roles/genesyscloud_user_roles_proxy.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var internalProxy *userRolesProxy diff --git a/genesyscloud/user_roles/resource_genesyscloud_user_roles_utils.go b/genesyscloud/user_roles/resource_genesyscloud_user_roles_utils.go index 629bc643c..9f58a8e8a 100644 --- a/genesyscloud/user_roles/resource_genesyscloud_user_roles_utils.go +++ b/genesyscloud/user_roles/resource_genesyscloud_user_roles_utils.go @@ -7,7 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func flattenSubjectRoles(d *schema.ResourceData, p *userRolesProxy) (*schema.Set, *platformclientv2.APIResponse, error) { diff --git a/genesyscloud/util/resourcedata/resourcedata.go b/genesyscloud/util/resourcedata/resourcedata.go index 89bb58ff2..3cf629233 100644 --- a/genesyscloud/util/resourcedata/resourcedata.go +++ b/genesyscloud/util/resourcedata/resourcedata.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/leekchan/timeutil" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) const ( diff --git a/genesyscloud/util/util_basesetting_properties.go b/genesyscloud/util/util_basesetting_properties.go index c442d7681..44c0ea6de 100644 --- a/genesyscloud/util/util_basesetting_properties.go +++ b/genesyscloud/util/util_basesetting_properties.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func BuildTelephonyProperties(d *schema.ResourceData) *map[string]interface{} { diff --git a/genesyscloud/util/util_diagnostic_unit_test.go b/genesyscloud/util/util_diagnostic_unit_test.go index f6dd193fb..ec9fb4b9f 100644 --- a/genesyscloud/util/util_diagnostic_unit_test.go +++ b/genesyscloud/util/util_diagnostic_unit_test.go @@ -2,7 +2,7 @@ package util import ( "encoding/json" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/stretchr/testify/assert" "net/http" "net/url" diff --git a/genesyscloud/util/util_diagnostics.go b/genesyscloud/util/util_diagnostics.go index 8095bf9c7..7a707a3f0 100644 --- a/genesyscloud/util/util_diagnostics.go +++ b/genesyscloud/util/util_diagnostics.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type detailedDiagnosticInfo struct { diff --git a/genesyscloud/util/util_divisions.go b/genesyscloud/util/util_divisions.go index ff49af4c9..91f269645 100644 --- a/genesyscloud/util/util_divisions.go +++ b/genesyscloud/util/util_divisions.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type JsonMap map[string]interface{} diff --git a/genesyscloud/util/util_domainentities.go b/genesyscloud/util/util_domainentities.go index c06bb345b..a72921b5b 100644 --- a/genesyscloud/util/util_domainentities.go +++ b/genesyscloud/util/util_domainentities.go @@ -4,7 +4,7 @@ import ( lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func BuildSdkDomainEntityRef(d *schema.ResourceData, idAttr string) *platformclientv2.Domainentityref { diff --git a/genesyscloud/util/util_retries.go b/genesyscloud/util/util_retries.go index a20568128..8c819c434 100644 --- a/genesyscloud/util/util_retries.go +++ b/genesyscloud/util/util_retries.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func WithRetries(ctx context.Context, timeout time.Duration, method func() *retry.RetryError) diag.Diagnostics { diff --git a/genesyscloud/webdeployments_configuration/genesyscloud_webdeployments_configuration_proxy.go b/genesyscloud/webdeployments_configuration/genesyscloud_webdeployments_configuration_proxy.go index e4609b7d9..ea0671576 100644 --- a/genesyscloud/webdeployments_configuration/genesyscloud_webdeployments_configuration_proxy.go +++ b/genesyscloud/webdeployments_configuration/genesyscloud_webdeployments_configuration_proxy.go @@ -9,7 +9,7 @@ import ( "time" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var internalProxy *webDeploymentsConfigurationProxy diff --git a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration.go b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration.go index 60d879d96..ea88bc60a 100644 --- a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration.go +++ b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllWebDeploymentConfigurations(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_test.go b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_test.go index d83cb8f42..59984641e 100644 --- a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_test.go +++ b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type scCustomMessageConfig struct { diff --git a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_journey.go b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_journey.go index 9d073a5c1..09edc3979 100644 --- a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_journey.go +++ b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_journey.go @@ -4,7 +4,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func buildSelectorEventTriggers(triggers []interface{}) *[]platformclientv2.Selectoreventtrigger { diff --git a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_messenger.go b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_messenger.go index b5deb12fe..e12d1ae40 100644 --- a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_messenger.go +++ b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_messenger.go @@ -2,7 +2,7 @@ package webdeployments_configuration_utils import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/lists" ) diff --git a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_support_center.go b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_support_center.go index 83e53bfcd..f29d7605d 100644 --- a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_support_center.go +++ b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_support_center.go @@ -4,7 +4,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func buildSupportCenterHeroStyle(styles []interface{}) *platformclientv2.Supportcenterherostyle { diff --git a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_utils.go b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_utils.go index 4a61793cd..b12770c46 100644 --- a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_utils.go +++ b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_utils.go @@ -7,7 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func buildCobrowseSettings(d *schema.ResourceData) *platformclientv2.Cobrowsesettings { @@ -160,7 +160,7 @@ func FlattenCobrowseSettings(cobrowseSettings *platformclientv2.Cobrowsesettings return []interface{}{map[string]interface{}{ "enabled": cobrowseSettings.Enabled, "allow_agent_control": cobrowseSettings.AllowAgentControl, - "allow_agent_navigation": cobrowseSettings.AllowAgentNavigation, + "allow_agent_navigation": cobrowseSettings.AllowAgentNavigation, "channels": cobrowseSettings.Channels, "mask_selectors": cobrowseSettings.MaskSelectors, "readonly_selectors": cobrowseSettings.ReadonlySelectors, diff --git a/genesyscloud/webdeployments_deployment/genesyscloud_webdeployments_deployment_proxy.go b/genesyscloud/webdeployments_deployment/genesyscloud_webdeployments_deployment_proxy.go index 1fa51d7e1..5dfb49182 100644 --- a/genesyscloud/webdeployments_deployment/genesyscloud_webdeployments_deployment_proxy.go +++ b/genesyscloud/webdeployments_deployment/genesyscloud_webdeployments_deployment_proxy.go @@ -10,7 +10,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "time" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var internalProxy *webDeploymentsProxy diff --git a/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment.go b/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment.go index 2e0012aa1..d8ce2bff2 100644 --- a/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment.go +++ b/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllWebDeployments(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_test.go b/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_test.go index 320c085de..0f223d80d 100644 --- a/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_test.go +++ b/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceWebDeploymentsDeployment(t *testing.T) { diff --git a/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_utils.go b/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_utils.go index d0f318b06..358560e1e 100644 --- a/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_utils.go +++ b/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_utils.go @@ -4,7 +4,7 @@ import ( "errors" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func alwaysDifferent(k, old, new string, d *schema.ResourceData) bool { diff --git a/go.mod b/go.mod index 97d022f1b..4e8cce60f 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 github.com/leekchan/timeutil v0.0.0-20150802142658-28917288c48d github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 - github.com/mypurecloud/platform-client-sdk-go/v130 v130.0.0 + github.com/mypurecloud/platform-client-sdk-go/v131 v131.0.0 github.com/nyaruka/phonenumbers v1.3.6 github.com/rjNemo/underscore v0.6.1 github.com/zclconf/go-cty v1.14.4 diff --git a/go.sum b/go.sum index fc5087feb..7081a70b2 100644 --- a/go.sum +++ b/go.sum @@ -257,8 +257,10 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mypurecloud/platform-client-sdk-go/v130 v130.0.0 h1:D6UheKy0j2dFMYMomhx/Qe7IMXeu6fkrUCKUBX11acw= -github.com/mypurecloud/platform-client-sdk-go/v130 v130.0.0/go.mod h1:iDiiCTL8WLcSaLb1W3Qpmj4fGU0kCATO7nvg7098veQ= +github.com/mypurecloud/platform-client-sdk-go/v131 v130.0.0 h1:D6UheKy0j2dFMYMomhx/Qe7IMXeu6fkrUCKUBX11acw= +github.com/mypurecloud/platform-client-sdk-go/v131 v130.0.0/go.mod h1:iDiiCTL8WLcSaLb1W3Qpmj4fGU0kCATO7nvg7098veQ= +github.com/mypurecloud/platform-client-sdk-go/v131 v131.0.0 h1:2YkBK/2pSoaehuSTqhFDXb806nxmHIrz7RxKsQSqM/0= +github.com/mypurecloud/platform-client-sdk-go/v131 v131.0.0/go.mod h1:pWn1ub6TxkdOiI1mgZED+fICo/JiqujY4h+wfgYbOi4= github.com/nyaruka/phonenumbers v1.3.6 h1:33owXWp4d1U+Tyaj9fpci6PbvaQZcXBUO2FybeKeLwQ= github.com/nyaruka/phonenumbers v1.3.6/go.mod h1:Ut+eFwikULbmCenH6InMKL9csUNLyxHuBLyfkpum11s= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= From a9f4257ca460b7e02187bd16d13010c5d6f60952 Mon Sep 17 00:00:00 2001 From: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Date: Tue, 18 Jun 2024 10:57:55 +0100 Subject: [PATCH 10/62] Devtooling 501: Removing support for v1 and v1-http widget deployments (#1097) * Updated widget_deployment schema to reflect API changes * updated example widget deployment resource * Removed old client_config field from schema and fixed data source test * Returned client_config field and marked it as deprecated --- docs/resources/widget_deployment.md | 16 +- .../resource.tf | 5 +- ...ource_genesyscloud_architect_ivr_schema.go | 4 +- ...rce_genesyscloud_widget_deployment_test.go | 10 +- ...yscloud_externalcontacts_contact_schema.go | 6 +- ...yscloud_outbound_callabletimeset_schema.go | 6 +- ...ce_genesyscloud_outbound_dnclist_schema.go | 6 +- ...e_genesyscloud_outbound_settings_schema.go | 10 +- ...resource_genesyscloud_widget_deployment.go | 335 ++++++------------ ...rce_genesyscloud_widget_deployment_test.go | 228 +++++------- ...nesyscloud_routing_sms_addresses_schema.go | 4 +- .../scripts/resource_scripts_schema.go | 4 +- ...yscloud_task_management_workitem_schema.go | 6 +- ...yscloud_task_management_worktype_schema.go | 4 +- ...ud_telephony_providers_edges_did_schema.go | 4 +- ...lephony_providers_edges_did_pool_schema.go | 10 +- ...y_providers_edges_extension_pool_schema.go | 16 +- ..._telephony_providers_edges_phone_schema.go | 4 +- ...d_telephony_providers_edges_site_schema.go | 6 +- .../resource_genesyscloud_tf_export.go | 8 +- .../util/resourcedata/resourcedata.go | 12 +- genesyscloud/validators/validators.go | 20 +- ...oud_webdeployments_configuration_schema.go | 16 +- 23 files changed, 278 insertions(+), 462 deletions(-) diff --git a/docs/resources/widget_deployment.md b/docs/resources/widget_deployment.md index c91b869b1..8153c0069 100644 --- a/docs/resources/widget_deployment.md +++ b/docs/resources/widget_deployment.md @@ -27,9 +27,8 @@ resource "genesyscloud_widget_deployment" "mywidget" { client_type = "v1" authentication_required = true disabled = true - client_config { - authentication_url = "https://examplewebsite.com" - webchat_skin = "modern-caret-skin" + third_party_client_config = { + foo = "bar" } allowed_domains = [] } @@ -41,16 +40,18 @@ resource "genesyscloud_widget_deployment" "mywidget" { ### Required - `authentication_required` (Boolean) When true, the customer members starting a chat must be authenticated by supplying their JWT to the create operation. -- `client_type` (String) The type of display widget for which this Deployment is configured, which controls the administrator settings shown.Valid values: v1, v2, v1-http, third-party. +- `client_type` (String) The type of display widget for which this Deployment is configured, which controls the administrator settings shown. Valid values: v1, v1-http, v2, third-party - `disabled` (Boolean) When true, all create chat operations using this Deployment will be rejected. - `name` (String) Name of the Widget Deployment. ### Optional - `allowed_domains` (List of String) The list of domains that are approved to use this Deployment; the list will be added to CORS headers for ease of web use -- `client_config` (Block Set, Max: 1) The V1 and V1-http client configuration options that should be made available to the clients of this Deployment. (see [below for nested schema](#nestedblock--client_config)) +- `client_config` (Block Set, Max: 1, Deprecated) The V1 and V1-http client configuration options that should be made available to the clients of this Deployment. (see [below for nested schema](#nestedblock--client_config)) - `description` (String) Widget Deployment description. - `flow_id` (String) The Inbound Chat Flow to run when new chats are initiated under this Deployment +- `third_party_client_config` (Map of String) The third party client configuration options that should be made available to the clients of this Deployment. +- `v2_client_config` (Map of String) The v2 client configuration options that should be made available to the clients of this Deployment. ### Read-Only @@ -59,11 +60,8 @@ resource "genesyscloud_widget_deployment" "mywidget" { ### Nested Schema for `client_config` -Required: - -- `webchat_skin` (String) Skin for the webchat user. (basic, modern-caret-skin) - Optional: - `authentication_url` (String) Url endpoint to perform_authentication +- `webchat_skin` (String) Skin for the webchat user. (basic, modern-caret-skin) diff --git a/examples/resources/genesyscloud_widget_deployment/resource.tf b/examples/resources/genesyscloud_widget_deployment/resource.tf index 1070a0fde..fd79e2b04 100644 --- a/examples/resources/genesyscloud_widget_deployment/resource.tf +++ b/examples/resources/genesyscloud_widget_deployment/resource.tf @@ -5,9 +5,8 @@ resource "genesyscloud_widget_deployment" "mywidget" { client_type = "v1" authentication_required = true disabled = true - client_config { - authentication_url = "https://examplewebsite.com" - webchat_skin = "modern-caret-skin" + third_party_client_config = { + foo = "bar" } allowed_domains = [] } \ No newline at end of file diff --git a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_schema.go b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_schema.go index cb0c48118..363b5f8fb 100644 --- a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_schema.go +++ b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_schema.go @@ -6,7 +6,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" ) const ( @@ -65,7 +65,7 @@ func ResourceArchitectIvrConfig() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateDiagFunc: gcloud.ValidatePhoneNumber}, + Elem: &schema.Schema{Type: schema.TypeString, ValidateDiagFunc: validators.ValidatePhoneNumber}, }, "open_hours_flow_id": { Description: "ID of inbound call flow for open hours.", diff --git a/genesyscloud/data_source_genesyscloud_widget_deployment_test.go b/genesyscloud/data_source_genesyscloud_widget_deployment_test.go index 4d9b77b2d..874bd96d5 100644 --- a/genesyscloud/data_source_genesyscloud_widget_deployment_test.go +++ b/genesyscloud/data_source_genesyscloud_widget_deployment_test.go @@ -22,17 +22,11 @@ func TestAccDataSourceWidgetDeployment(t *testing.T) { name: widgetDeploymentsName + uuid.NewString(), description: "This is a test description", flowID: uuid.NewString(), - clientType: "v1", + clientType: V2, authenticationRequired: "true", disabled: "true", - webChatSkin: "basic", - authenticationUrl: "https://localhost", } - _, err := provider.AuthorizeSdk() - if err != nil { - t.Fatal(err) - } deleteWidgetDeploymentWithName(widgetDeploymentsName) resource.Test(t, resource.TestCase{ @@ -40,7 +34,7 @@ func TestAccDataSourceWidgetDeployment(t *testing.T) { ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), Steps: []resource.TestStep{ { - Config: generateWidgetDeployV1(widgetDeployV1) + generateWidgetDeploymentDataSource(widgetDeploymentsDataSource, "genesyscloud_widget_deployment."+widgegetDeploymentsResource+".name", "genesyscloud_widget_deployment."+widgegetDeploymentsResource), + Config: generateWidgetDeploymentResource(widgetDeployV1) + generateWidgetDeploymentDataSource(widgetDeploymentsDataSource, "genesyscloud_widget_deployment."+widgegetDeploymentsResource+".name", "genesyscloud_widget_deployment."+widgegetDeploymentsResource), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair("data.genesyscloud_widget_deployment."+widgetDeploymentsDataSource, "id", "genesyscloud_widget_deployment."+widgegetDeploymentsResource, "id"), ), diff --git a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_schema.go b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_schema.go index 6e56d6f0e..2b9ff630b 100644 --- a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_schema.go +++ b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_schema.go @@ -5,7 +5,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" ) /* @@ -53,7 +53,7 @@ func ResourceExternalContact() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - ValidateDiagFunc: gcloud.ValidatePhoneNumber, + ValidateDiagFunc: validators.ValidatePhoneNumber, }, "country_code": { Description: "Phone number country code.", @@ -95,7 +95,7 @@ func ResourceExternalContact() *schema.Resource { Description: "Contact address country code.", Type: schema.TypeString, Optional: true, - ValidateDiagFunc: gcloud.ValidateCountryCode, + ValidateDiagFunc: validators.ValidateCountryCode, }, }, } diff --git a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_schema.go b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_schema.go index 703ef3099..d2ccb2cac 100644 --- a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_schema.go +++ b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_schema.go @@ -6,7 +6,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" ) const resourceName = "genesyscloud_outbound_callabletimeset" @@ -23,13 +23,13 @@ var campaignTimeslotResource = &schema.Resource{ `start_time`: { Description: `The start time of the interval as an ISO-8601 string, i.e. HH:mm:ss`, Required: true, - ValidateDiagFunc: gcloud.ValidateTime, + ValidateDiagFunc: validators.ValidateTime, Type: schema.TypeString, }, `stop_time`: { Description: `The end time of the interval as an ISO-8601 string, i.e. HH:mm:ss`, Required: true, - ValidateDiagFunc: gcloud.ValidateTime, + ValidateDiagFunc: validators.ValidateTime, Type: schema.TypeString, }, `day`: { diff --git a/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_schema.go b/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_schema.go index 85bf567c2..c44abd1c7 100644 --- a/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_schema.go +++ b/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_schema.go @@ -6,7 +6,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" ) const resourceName = "genesyscloud_outbound_dnclist" @@ -90,7 +90,7 @@ func ResourceOutboundDncList() *schema.Resource { Description: `Expiration date for DNC phone numbers in yyyy-MM-ddTHH:mmZ format.`, Optional: true, Type: schema.TypeString, - ValidateDiagFunc: gcloud.ValidateDateTime, + ValidateDiagFunc: validators.ValidateDateTime, }, `phone_numbers`: { Description: `Phone numbers to add to a DNC list. Only possible if the dncSourceType is rds. Phone numbers must be in an E.164 number format.`, @@ -98,7 +98,7 @@ func ResourceOutboundDncList() *schema.Resource { Type: schema.TypeList, Elem: &schema.Schema{ Type: schema.TypeString, - ValidateDiagFunc: gcloud.ValidatePhoneNumber, + ValidateDiagFunc: validators.ValidatePhoneNumber, }, }, }, diff --git a/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings_schema.go b/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings_schema.go index 89853a623..e013606ec 100644 --- a/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings_schema.go +++ b/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings_schema.go @@ -6,7 +6,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" ) /* @@ -67,13 +67,13 @@ var ( `earliest_callable_time`: { Description: "The earliest time to dial a contact. Valid format is HH:mm", Optional: true, - ValidateDiagFunc: gcloud.ValidateTimeHHMM, + ValidateDiagFunc: validators.ValidateTimeHHMM, Type: schema.TypeString, }, `latest_callable_time`: { Description: "The latest time to dial a contact. Valid format is HH:mm.", Optional: true, - ValidateDiagFunc: gcloud.ValidateTimeHHMM, + ValidateDiagFunc: validators.ValidateTimeHHMM, Type: schema.TypeString, }, }, @@ -83,13 +83,13 @@ var ( `earliest_callable_time`: { Description: "The earliest time to dial a contact. Valid format is HH:mm.", Optional: true, - ValidateDiagFunc: gcloud.ValidateTimeHHMM, + ValidateDiagFunc: validators.ValidateTimeHHMM, Type: schema.TypeString, }, `latest_callable_time`: { Description: "The latest time to dial a contact. Valid format is HH:mm.", Optional: true, - ValidateDiagFunc: gcloud.ValidateTimeHHMM, + ValidateDiagFunc: validators.ValidateTimeHHMM, Type: schema.TypeString, }, `time_zone_id`: { diff --git a/genesyscloud/resource_genesyscloud_widget_deployment.go b/genesyscloud/resource_genesyscloud_widget_deployment.go index bda97d577..54ef064af 100644 --- a/genesyscloud/resource_genesyscloud_widget_deployment.go +++ b/genesyscloud/resource_genesyscloud_widget_deployment.go @@ -4,10 +4,11 @@ import ( "context" "fmt" "log" - "net/url" + "strings" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/constants" + "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "time" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" @@ -15,9 +16,8 @@ import ( "terraform-provider-genesyscloud/genesyscloud/consistency_checker" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" - lists "terraform-provider-genesyscloud/genesyscloud/util/lists" + "terraform-provider-genesyscloud/genesyscloud/util/lists" - "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" @@ -25,30 +25,25 @@ import ( ) const ( - V1 = "v1" - V1HTTP = "v1-http" - V2 = "v2" - THIRDPARTY = "third-party" - HTTPSPROTOCOL = "https" - WEBSKINBASIC = "basic" - WEBSKINMODERN = "modern-caret-skin" + V1 = "v1" + V1HTTP = "v1-http" + V2 = "v2" + THIRDPARTY = "third-party" ) var ( + validClientTypes = []string{V1, V1HTTP, V2, THIRDPARTY} clientConfigSchemaResource = &schema.Resource{ Schema: map[string]*schema.Schema{ "webchat_skin": { - Description: "Skin for the webchat user. (basic, modern-caret-skin)", - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{WEBSKINBASIC, WEBSKINMODERN}, false), + Description: "Skin for the webchat user. (basic, modern-caret-skin)", + Type: schema.TypeString, + Optional: true, }, "authentication_url": { - Description: "Url endpoint to perform_authentication", - Type: schema.TypeString, - Required: false, - Optional: true, - ValidateDiagFunc: validateAuthURL, + Description: "Url endpoint to perform_authentication", + Type: schema.TypeString, + Optional: true, }, }, } @@ -69,78 +64,6 @@ func getAllWidgetDeployments(_ context.Context, clientConfig *platformclientv2.C return resources, nil } -func buildSdkAllowedDomains(d *schema.ResourceData) *[]string { - allowed_domains := []string{} - if domains, ok := d.GetOk("allowed_domains"); ok { - allowed_domains = lists.InterfaceListToStrings(domains.([]interface{})) - } - return &allowed_domains -} - -func parseSdkClientConfigData(d *schema.ResourceData) (webchatSkin *string, authenticationUrl *string) { - clientConfigSet := d.Get("client_config").(*schema.Set) - - if clientConfigSet != nil && len(clientConfigSet.List()) > 0 { - clientConfig := clientConfigSet.List()[0].(map[string]interface{}) - fields := make(map[string]string) - - for k, v := range clientConfig { - fields[k] = v.(string) - } - - webchatSkin := fields["webchat_skin"] - authUrl := fields["authentication_url"] - return &webchatSkin, &authUrl - } - return nil, nil -} - -func validateAuthURL(authUrl interface{}, _ cty.Path) diag.Diagnostics { - authUrlString := authUrl.(string) - u, err := url.Parse(authUrlString) - if err != nil { - return util.BuildDiagnosticError("genesyscloud_widget_deployment", fmt.Sprintf("Authorization url %s provided is not a valid URL", authUrlString), err) - } - - if u.Scheme == "" || u.Host == "" { - log.Printf("Scheme: %s", u.Scheme) - log.Printf("Host: %s", u.Host) - return util.BuildDiagnosticError("genesyscloud_widget_deployment", fmt.Sprintf("Authorization url %s provided is not valid url", authUrlString), fmt.Errorf("authorization url provided is not valid url")) - } - - if u.Scheme != HTTPSPROTOCOL { - return util.BuildDiagnosticError("genesyscloud_widget_deployment", fmt.Sprintf("Authorization url provided must begin with https"), fmt.Errorf("authorization url provided must begin with https")) - - } - - return nil -} - -func buildSDKClientConfig(clientType string, d *schema.ResourceData) (*platformclientv2.Widgetclientconfig, error) { - widgetClientConfig := &platformclientv2.Widgetclientconfig{} - clientConfig := d.Get("client_config").(*schema.Set) - - if (clientType == V1 || clientType == V1HTTP) && clientConfig.Len() == 0 { - return nil, fmt.Errorf("V1 and v1-http widget configurations must have a client_config defined. ") - } - - if clientType == V1 { - v1Client := &platformclientv2.Widgetclientconfigv1{} - - v1Client.WebChatSkin, v1Client.AuthenticationUrl = parseSdkClientConfigData(d) - - widgetClientConfig.V1 = v1Client - } - - if clientType == V1HTTP { - v1HttpClient := &platformclientv2.Widgetclientconfigv1http{} - v1HttpClient.WebChatSkin, v1HttpClient.AuthenticationUrl = parseSdkClientConfigData(d) - widgetClientConfig.V1Http = v1HttpClient - } - - return widgetClientConfig, nil -} - func WidgetDeploymentExporter() *resourceExporter.ResourceExporter { return &resourceExporter.ResourceExporter{ GetResourcesFunc: provider.GetAllWithPooledClient(getAllWidgetDeployments), @@ -192,56 +115,38 @@ func ResourceWidgetDeployment() *schema.Resource { Description: "The list of domains that are approved to use this Deployment; the list will be added to CORS headers for ease of web use", Type: schema.TypeList, Elem: &schema.Schema{Type: schema.TypeString}, - Required: false, Optional: true, }, "client_type": { - Description: "The type of display widget for which this Deployment is configured, which controls the administrator settings shown.Valid values: v1, v2, v1-http, third-party.", + Description: "The type of display widget for which this Deployment is configured, which controls the administrator settings shown. Valid values: " + strings.Join(validClientTypes, ", "), Type: schema.TypeString, Required: true, - ValidateFunc: validation.StringInSlice([]string{V1, V2, V1HTTP, THIRDPARTY}, false), + ValidateFunc: validation.StringInSlice(validClientTypes, false), }, "client_config": { - Description: " The V1 and V1-http client configuration options that should be made available to the clients of this Deployment.", + Description: "The V1 and V1-http client configuration options that should be made available to the clients of this Deployment.", Type: schema.TypeSet, MaxItems: 1, Optional: true, - Elem: clientConfigSchemaResource, + // when this field is removed, V1 and V1HTTP should also be removed from validClientTypes list + Deprecated: "This field is inactive and will be removed entirely in a later version. Please use `v2_client_config` or `third_party_client_config` instead.", + Elem: clientConfigSchemaResource, + }, + "v2_client_config": { + Description: "The v2 client configuration options that should be made available to the clients of this Deployment.", + Type: schema.TypeMap, + Optional: true, + }, + "third_party_client_config": { + Description: "The third party client configuration options that should be made available to the clients of this Deployment.", + Type: schema.TypeMap, + Optional: true, + ConflictsWith: []string{"v2_client_config"}, }, }, } } -func flattenClientConfig(clientType string, clientConfig platformclientv2.Widgetclientconfig) *schema.Set { - clientConfigSet := schema.NewSet(schema.HashResource(clientConfigSchemaResource), []interface{}{}) - - clientConfigMap := make(map[string]interface{}) - - if clientType == V1 { - if clientConfig.V1.WebChatSkin != nil { - clientConfigMap["webchat_skin"] = *clientConfig.V1.WebChatSkin - } - - if clientConfig.V1.AuthenticationUrl != nil { - clientConfigMap["authentication_url"] = *clientConfig.V1.AuthenticationUrl - } - } - - if clientType == V1HTTP { - if clientConfig.V1Http.WebChatSkin != nil { - clientConfigMap["webchat_skin"] = *clientConfig.V1Http.WebChatSkin - } - - if clientConfig.V1Http.AuthenticationUrl != nil { - clientConfigMap["authentication_url"] = *clientConfig.V1Http.AuthenticationUrl - } - } - - clientConfigSet.Add(clientConfigMap) - - return clientConfigSet -} - func readWidgetDeployment(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { sdkConfig := meta.(*provider.ProviderMeta).ClientConfig widgetsAPI := platformclientv2.NewWidgetsApiWithConfig(sdkConfig) @@ -259,47 +164,15 @@ func readWidgetDeployment(ctx context.Context, d *schema.ResourceData, meta inte return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_widget_deployment", fmt.Sprintf("Failed to read widget deployment %s | error: %s", d.Id(), getErr), resp)) } - d.Set("name", *currentWidget.Name) - if currentWidget.Description != nil { - d.Set("description", *currentWidget.Description) - } else { - d.Set("description", nil) - } - - if currentWidget.AuthenticationRequired != nil { - d.Set("authentication_required", *currentWidget.AuthenticationRequired) - } else { - d.Set("authentication_required", nil) - } - - if currentWidget.Disabled != nil { - d.Set("disabled", *currentWidget.Disabled) - } else { - d.Set("disabled", nil) - } - - if currentWidget.Flow != nil { - d.Set("flow_id", *currentWidget.Flow.Id) - } else { - d.Set("flow_id", nil) - } - - if currentWidget.AllowedDomains != nil { - d.Set("allowed_domains", *currentWidget.AllowedDomains) - } else { - d.Set("allowed_domains", nil) - } - - if currentWidget.ClientType != nil { - d.Set("client_type", *currentWidget.ClientType) - } else { - d.Set("client_type", nil) - } - + _ = d.Set("name", *currentWidget.Name) + resourcedata.SetNillableValue(d, "description", currentWidget.Description) + resourcedata.SetNillableValue(d, "authentication_required", currentWidget.AuthenticationRequired) + resourcedata.SetNillableValue(d, "disabled", currentWidget.Disabled) + resourcedata.SetNillableValue(d, "allowed_domains", currentWidget.AllowedDomains) + resourcedata.SetNillableValue(d, "client_type", currentWidget.ClientType) + resourcedata.SetNillableReference(d, "flow_id", currentWidget.Flow) if currentWidget.ClientConfig != nil { - d.Set("client_config", flattenClientConfig(*currentWidget.ClientType, *currentWidget.ClientConfig)) - } else { - d.Set("client_config", nil) + flattenClientConfig(d, *currentWidget.ClientConfig) } return cc.CheckState(d) @@ -308,30 +181,19 @@ func readWidgetDeployment(ctx context.Context, d *schema.ResourceData, meta inte func createWidgetDeployment(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { name := d.Get("name").(string) - description := d.Get("description").(string) - auth_required := d.Get("authentication_required").(bool) - disabled := d.Get("disabled").(bool) - flowId := util.BuildSdkDomainEntityRef(d, "flow_id") - allowed_domains := buildSdkAllowedDomains(d) //Need to make this an array of strings. - client_type := d.Get("client_type").(string) - client_config, client_config_err := buildSDKClientConfig(client_type, d) - - if client_config_err != nil { - return util.BuildDiagnosticError("genesyscloud_widget_deployment", fmt.Sprintf("Failed to create widget deployment %s", name), client_config_err) - } sdkConfig := meta.(*provider.ProviderMeta).ClientConfig widgetsAPI := platformclientv2.NewWidgetsApiWithConfig(sdkConfig) createWidget := platformclientv2.Widgetdeployment{ Name: &name, - Description: &description, - AuthenticationRequired: &auth_required, - Disabled: &disabled, - Flow: flowId, - AllowedDomains: allowed_domains, - ClientType: &client_type, - ClientConfig: client_config, + Description: platformclientv2.String(d.Get("description").(string)), + AuthenticationRequired: platformclientv2.Bool(d.Get("authentication_required").(bool)), + Disabled: platformclientv2.Bool(d.Get("disabled").(bool)), + Flow: util.BuildSdkDomainEntityRef(d, "flow_id"), + AllowedDomains: buildSdkAllowedDomains(d), + ClientType: platformclientv2.String(d.Get("client_type").(string)), + ClientConfig: buildSDKClientConfig(d), } log.Printf("Creating widgets deployment %s", name) @@ -355,28 +217,6 @@ func createWidgetDeployment(ctx context.Context, d *schema.ResourceData, meta in return readWidgetDeployment(ctx, d, meta) } -// Sometimes the Widget API creates 2 deployments due to a bug. This function will delete any duplicates -func deletePotentialDuplicateDeployments(widgetAPI *platformclientv2.WidgetsApi, name, id string, existingResourceIDMetaMap, newResourceIDMetaMap resourceExporter.ResourceIDMetaMap) { - for _, val := range existingResourceIDMetaMap { - for key1, val1 := range newResourceIDMetaMap { - if val.Name == val1.Name { - delete(newResourceIDMetaMap, key1) - break - } - } - } - - for key, val := range newResourceIDMetaMap { - if key != id && val.Name == name { - log.Printf("Deleting duplicate widget deployment %s", name) - _, err := widgetAPI.DeleteWidgetsDeployment(key) - if err != nil { - log.Printf("failed to delete widget deployment %s: %s", name, err) - } - } - } -} - func deleteWidgetDeployment(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { name := d.Get("name").(string) @@ -404,30 +244,19 @@ func deleteWidgetDeployment(ctx context.Context, d *schema.ResourceData, meta in func updateWidgetDeployment(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { name := d.Get("name").(string) - description := d.Get("description").(string) - auth_required := d.Get("authentication_required").(bool) - disabled := d.Get("disabled").(bool) - flowId := util.BuildSdkDomainEntityRef(d, "flow_id") - allowed_domains := buildSdkAllowedDomains(d) //Need to make this an array of strings. - client_type := d.Get("client_type").(string) - client_config, client_config_err := buildSDKClientConfig(client_type, d) - - if client_config_err != nil { - return util.BuildDiagnosticError("genesyscloud_widget_deployment", fmt.Sprintf("Failed updating widget deployment %s", name), client_config_err) - } sdkConfig := meta.(*provider.ProviderMeta).ClientConfig widgetsAPI := platformclientv2.NewWidgetsApiWithConfig(sdkConfig) updateWidget := platformclientv2.Widgetdeployment{ Name: &name, - Description: &description, - AuthenticationRequired: &auth_required, - Disabled: &disabled, - Flow: flowId, - AllowedDomains: allowed_domains, - ClientType: &client_type, - ClientConfig: client_config, + Description: platformclientv2.String(d.Get("description").(string)), + AuthenticationRequired: platformclientv2.Bool(d.Get("authentication_required").(bool)), + Disabled: platformclientv2.Bool(d.Get("disabled").(bool)), + Flow: util.BuildSdkDomainEntityRef(d, "flow_id"), + AllowedDomains: buildSdkAllowedDomains(d), + ClientType: platformclientv2.String(d.Get("client_type").(string)), + ClientConfig: buildSDKClientConfig(d), } log.Printf("Updating widget deployment %s", name) @@ -440,3 +269,61 @@ func updateWidgetDeployment(ctx context.Context, d *schema.ResourceData, meta in log.Printf("Finished updating widget deployment %s", name) return readWidgetDeployment(ctx, d, meta) } + +func buildSDKClientConfig(d *schema.ResourceData) *platformclientv2.Widgetclientconfig { + v2ClientConfig := d.Get("v2_client_config") + if m, ok := v2ClientConfig.(map[string]any); ok && len(m) > 0 { + return &platformclientv2.Widgetclientconfig{V2: &v2ClientConfig} + } + thirdPartyClientConfig := d.Get("third_party_client_config") + if m, ok := thirdPartyClientConfig.(map[string]any); ok && len(m) > 0 { + return &platformclientv2.Widgetclientconfig{ThirdParty: &thirdPartyClientConfig} + } + return nil +} + +func buildSdkAllowedDomains(d *schema.ResourceData) *[]string { + if domains, ok := d.Get("allowed_domains").([]any); ok { + allowedDomains := lists.InterfaceListToStrings(domains) + return &allowedDomains + } + return nil +} + +func flattenClientConfig(d *schema.ResourceData, config platformclientv2.Widgetclientconfig) { + if config.ThirdParty != nil { + thirdParty := *config.ThirdParty + if thirdPartyMap, _ := thirdParty.(map[string]any); len(thirdPartyMap) > 0 { + _ = d.Set("third_party_client_config", thirdPartyMap) + return + } + } + if config.V2 != nil { + v2Config := *config.V2 + if v2ConfigMap, _ := v2Config.(map[string]any); len(v2ConfigMap) > 0 { + _ = d.Set("v2_client_config", v2ConfigMap) + } + } +} + +// deletePotentialDuplicateDeployments Sometimes the Widget API creates 2 deployments due to a bug. This function will delete any duplicates +func deletePotentialDuplicateDeployments(widgetAPI *platformclientv2.WidgetsApi, name, id string, existingResourceIDMetaMap, newResourceIDMetaMap resourceExporter.ResourceIDMetaMap) { + for _, val := range existingResourceIDMetaMap { + for key1, val1 := range newResourceIDMetaMap { + if val.Name == val1.Name { + delete(newResourceIDMetaMap, key1) + break + } + } + } + + for key, val := range newResourceIDMetaMap { + if key != id && val.Name == name { + log.Printf("Deleting duplicate widget deployment %s", name) + _, err := widgetAPI.DeleteWidgetsDeployment(key) + if err != nil { + log.Printf("failed to delete widget deployment %s: %s", name, err) + } + } + } +} diff --git a/genesyscloud/resource_genesyscloud_widget_deployment_test.go b/genesyscloud/resource_genesyscloud_widget_deployment_test.go index 0c69204b7..27b72d1c3 100644 --- a/genesyscloud/resource_genesyscloud_widget_deployment_test.go +++ b/genesyscloud/resource_genesyscloud_widget_deployment_test.go @@ -2,6 +2,7 @@ package genesyscloud import ( "fmt" + "strconv" "strings" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" @@ -22,8 +23,8 @@ type widgetDeploymentConfig struct { flowID string allowedDomains []string clientType string - webChatSkin string - authenticationUrl string + v2ClientConfig map[string]string + thirdPartyClientConfig map[string]string } func deleteWidgetDeploymentWithName(name string) { @@ -35,139 +36,86 @@ func deleteWidgetDeploymentWithName(name string) { for _, widgetDeployment := range *widgetDeployments.Entities { if strings.Contains(*widgetDeployment.Name, name) { - widgetsAPI.DeleteWidgetsDeployment(*widgetDeployment.Id) + _, _ = widgetsAPI.DeleteWidgetsDeployment(*widgetDeployment.Id) } } } -func generateWidgetDeployV2(widgetDeploymentConfig *widgetDeploymentConfig) string { - return fmt.Sprintf(`resource "genesyscloud_widget_deployment" "%s" { - name = "%s" - description = "%s" - flow_id = "%s" - client_type = "%s" - authentication_required = %s - disabled = %s +func generateWidgetDeploymentResource(wdConfig *widgetDeploymentConfig) string { + var ( + v2ClientConfigStr string + thirdPartyConfigStr string + ) + if wdConfig.v2ClientConfig != nil { + v2ClientConfigStr = util.GenerateMapAttrWithMapProperties("v2_client_config", wdConfig.v2ClientConfig) + } + if wdConfig.thirdPartyClientConfig != nil { + thirdPartyConfigStr = util.GenerateMapAttrWithMapProperties("third_party_client_config", wdConfig.thirdPartyClientConfig) } - `, widgetDeploymentConfig.resourceID, - widgetDeploymentConfig.name, - widgetDeploymentConfig.description, - widgetDeploymentConfig.flowID, - widgetDeploymentConfig.clientType, - widgetDeploymentConfig.authenticationRequired, - widgetDeploymentConfig.disabled) -} - -func generateWidgetDeployV1(widgetDeploymentConfig *widgetDeploymentConfig) string { return fmt.Sprintf(`resource "genesyscloud_widget_deployment" "%s" { - name = "%s" - description = "%s" - flow_id = "%s" - client_type = "%s" + name = "%s" + description = %s + flow_id = %s + client_type = "%s" authentication_required = %s - disabled = %s - client_config { - authentication_url = "%s" - webchat_skin = "%s" - } + disabled = %s + %s + %s } - `, widgetDeploymentConfig.resourceID, - widgetDeploymentConfig.name, - widgetDeploymentConfig.description, - widgetDeploymentConfig.flowID, - widgetDeploymentConfig.clientType, - widgetDeploymentConfig.authenticationRequired, - widgetDeploymentConfig.disabled, - widgetDeploymentConfig.authenticationUrl, - widgetDeploymentConfig.webChatSkin) + `, wdConfig.resourceID, + wdConfig.name, + wdConfig.description, + wdConfig.flowID, + wdConfig.clientType, + wdConfig.authenticationRequired, + wdConfig.disabled, + v2ClientConfigStr, + thirdPartyConfigStr, + ) } -func TestAccResourceWidgetDeploymentV2Widget(t *testing.T) { - t.Parallel() - name := "My Test V2 Widget" - widgetDeployV2 := &widgetDeploymentConfig{ - resourceID: "myTestV2Widget", - name: name + uuid.NewString(), - description: "This is a test description", - flowID: uuid.NewString(), - clientType: "v2", - authenticationRequired: "false", - disabled: "true", - } - - _, err := provider.AuthorizeSdk() - if err != nil { - t.Fatal(err) +func copyWidgetDeploymentConfig(original widgetDeploymentConfig) *widgetDeploymentConfig { + var widgetCopy widgetDeploymentConfig + widgetCopy = widgetDeploymentConfig{ + resourceID: original.resourceID, + name: original.name, + description: original.description, + authenticationRequired: original.authenticationRequired, + disabled: original.disabled, + flowID: original.flowID, + allowedDomains: append(widgetCopy.allowedDomains, original.allowedDomains...), + clientType: original.clientType, + v2ClientConfig: original.v2ClientConfig, + thirdPartyClientConfig: original.thirdPartyClientConfig, } - deleteWidgetDeploymentWithName(name) - - resource.Test(t, resource.TestCase{ - PreCheck: func() { util.TestAccPreCheck(t) }, - ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), - - Steps: []resource.TestStep{ - { - //create - Config: generateWidgetDeployV2(widgetDeployV2), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV2.resourceID, "name", widgetDeployV2.name), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV2.resourceID, "description", widgetDeployV2.description), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV2.resourceID, "flow_id", widgetDeployV2.flowID), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV2.resourceID, "client_type", widgetDeployV2.clientType), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV2.resourceID, "authentication_required", widgetDeployV2.authenticationRequired), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV2.resourceID, "disabled", widgetDeployV2.disabled), - ), - }, - { - //update - Config: generateWidgetDeployV2(&widgetDeploymentConfig{ - resourceID: widgetDeployV2.resourceID, - name: widgetDeployV2.name, - description: "New test description", - flowID: widgetDeployV2.flowID, - clientType: widgetDeployV2.clientType, - authenticationRequired: widgetDeployV2.authenticationRequired, - disabled: widgetDeployV2.disabled, - }), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV2.resourceID, "name", widgetDeployV2.name), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV2.resourceID, "description", "New test description"), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV2.resourceID, "flow_id", widgetDeployV2.flowID), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV2.resourceID, "client_type", widgetDeployV2.clientType), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV2.resourceID, "authentication_required", widgetDeployV2.authenticationRequired), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV2.resourceID, "disabled", widgetDeployV2.disabled), - ), - }, - { - // Import/Read - ResourceName: "genesyscloud_widget_deployment." + widgetDeployV2.resourceID, - ImportState: true, - ImportStateVerify: true, - }, - }, - CheckDestroy: testVerifyWidgetDeploymentDestroyed, - }) + return &widgetCopy } -func TestAccResourceWidgetDeploymentV1Widget(t *testing.T) { +func TestAccResourceWidgetDeploymentThirdPartyWidget(t *testing.T) { t.Parallel() - name := "My Text V1 Widget" - widgetDeployV1 := &widgetDeploymentConfig{ - resourceID: "myTestV1Widget", - name: name + uuid.NewString(), - description: "This is a test description", - flowID: uuid.NewString(), - clientType: "v1", - authenticationRequired: "true", - disabled: "true", - webChatSkin: "basic", - authenticationUrl: "https://localhost", + name := "My Test Third Party Widget" + uuid.NewString() + description := "This is a test description" + flowId := uuid.NewString() + widgetDeployment := &widgetDeploymentConfig{ + resourceID: "third_party_widget", + name: name, + description: strconv.Quote(description), + flowID: strconv.Quote(flowId), + clientType: V2, + authenticationRequired: util.FalseValue, + disabled: util.TrueValue, + thirdPartyClientConfig: map[string]string{ + "foo": strconv.Quote("bar"), + }, } - _, err := provider.AuthorizeSdk() - if err != nil { - t.Fatal(err) + updatedDescription := "New description" + widgetDeploymentUpdate := copyWidgetDeploymentConfig(*widgetDeployment) + widgetDeploymentUpdate.description = strconv.Quote(updatedDescription) + widgetDeploymentUpdate.thirdPartyClientConfig = map[string]string{ + "foo": strconv.Quote("bar2"), } + deleteWidgetDeploymentWithName(name) resource.Test(t, resource.TestCase{ @@ -177,43 +125,33 @@ func TestAccResourceWidgetDeploymentV1Widget(t *testing.T) { Steps: []resource.TestStep{ { //create - Config: generateWidgetDeployV1(widgetDeployV1), + Config: generateWidgetDeploymentResource(widgetDeployment), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "name", widgetDeployV1.name), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "description", widgetDeployV1.description), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "flow_id", widgetDeployV1.flowID), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "client_type", widgetDeployV1.clientType), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "authentication_required", widgetDeployV1.authenticationRequired), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "disabled", widgetDeployV1.disabled), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "client_config.0.authentication_url", widgetDeployV1.authenticationUrl), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "client_config.0.webchat_skin", widgetDeployV1.webChatSkin), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "name", name), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "description", description), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "flow_id", flowId), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "client_type", widgetDeployment.clientType), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "authentication_required", widgetDeployment.authenticationRequired), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "disabled", widgetDeployment.disabled), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "third_party_client_config.foo", "bar"), ), }, { //update - Config: generateWidgetDeployV1(&widgetDeploymentConfig{ - resourceID: widgetDeployV1.resourceID, - name: widgetDeployV1.name, - description: "New test description", - flowID: widgetDeployV1.flowID, - clientType: widgetDeployV1.clientType, - authenticationRequired: widgetDeployV1.authenticationRequired, - disabled: widgetDeployV1.disabled, - webChatSkin: widgetDeployV1.webChatSkin, - authenticationUrl: widgetDeployV1.authenticationUrl, - }), + Config: generateWidgetDeploymentResource(widgetDeploymentUpdate), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "name", widgetDeployV1.name), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "description", "New test description"), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "flow_id", widgetDeployV1.flowID), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "client_type", widgetDeployV1.clientType), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "authentication_required", widgetDeployV1.authenticationRequired), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "disabled", widgetDeployV1.disabled), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "name", name), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "description", updatedDescription), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "flow_id", flowId), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "client_type", widgetDeployment.clientType), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "authentication_required", widgetDeployment.authenticationRequired), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "disabled", widgetDeployment.disabled), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "third_party_client_config.foo", "bar2"), ), }, { // Import/Read - ResourceName: "genesyscloud_widget_deployment." + widgetDeployV1.resourceID, + ResourceName: "genesyscloud_widget_deployment." + widgetDeployment.resourceID, ImportState: true, ImportStateVerify: true, }, diff --git a/genesyscloud/routing_sms_addresses/genesyscloud_routing_sms_addresses_schema.go b/genesyscloud/routing_sms_addresses/genesyscloud_routing_sms_addresses_schema.go index c9a449d0c..edc7f69bf 100644 --- a/genesyscloud/routing_sms_addresses/genesyscloud_routing_sms_addresses_schema.go +++ b/genesyscloud/routing_sms_addresses/genesyscloud_routing_sms_addresses_schema.go @@ -5,7 +5,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" ) // SetRegistrar registers all the resources, data sources and exporters in the package @@ -68,7 +68,7 @@ func ResourceRoutingSmsAddress() *schema.Resource { Required: true, ForceNew: true, Type: schema.TypeString, - ValidateDiagFunc: gcloud.ValidateCountryCode, + ValidateDiagFunc: validators.ValidateCountryCode, }, `auto_correct_address`: { Description: `This is used when the address is created. If the value is not set or true, then the system will, if necessary, auto-correct the address you provide. Set this value to false if the system should not auto-correct the address.`, diff --git a/genesyscloud/scripts/resource_scripts_schema.go b/genesyscloud/scripts/resource_scripts_schema.go index 459850ed1..d3381654e 100644 --- a/genesyscloud/scripts/resource_scripts_schema.go +++ b/genesyscloud/scripts/resource_scripts_schema.go @@ -5,7 +5,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" ) /* @@ -59,7 +59,7 @@ func ResourceScript() *schema.Resource { Description: "Path to the script file to upload.", Type: schema.TypeString, Required: true, - ValidateFunc: gcloud.ValidatePath, + ValidateFunc: validators.ValidatePath, }, "file_content_hash": { Description: "Hash value of the script file content. Used to detect changes.", diff --git a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_schema.go b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_schema.go index d639b207f..6e1c27978 100644 --- a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_schema.go +++ b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_schema.go @@ -7,7 +7,7 @@ import ( resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" "terraform-provider-genesyscloud/genesyscloud/util" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" ) /* @@ -91,14 +91,14 @@ func ResourceTaskManagementWorkitem() *schema.Resource { Optional: true, Computed: true, Type: schema.TypeString, - ValidateDiagFunc: gcloud.ValidateLocalDateTimes, + ValidateDiagFunc: validators.ValidateLocalDateTimes, }, `date_expires`: { Description: `The expiry date of the Workitem. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z`, Optional: true, Computed: true, Type: schema.TypeString, - ValidateDiagFunc: gcloud.ValidateLocalDateTimes, + ValidateDiagFunc: validators.ValidateLocalDateTimes, }, `duration_seconds`: { Description: `The estimated duration in seconds to complete the workitem.`, diff --git a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_schema.go b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_schema.go index c1b190920..35ea54fce 100644 --- a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_schema.go +++ b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_schema.go @@ -5,7 +5,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) @@ -77,7 +77,7 @@ func ResourceTaskManagementWorktype() *schema.Resource { Optional: true, Computed: true, Type: schema.TypeString, - ValidateDiagFunc: gcloud.ValidateTime, + ValidateDiagFunc: validators.ValidateTime, }, }, } diff --git a/genesyscloud/telephony_providers_edges_did/genesyscloud_telephony_providers_edges_did_schema.go b/genesyscloud/telephony_providers_edges_did/genesyscloud_telephony_providers_edges_did_schema.go index 7646d8028..10ff98a5e 100644 --- a/genesyscloud/telephony_providers_edges_did/genesyscloud_telephony_providers_edges_did_schema.go +++ b/genesyscloud/telephony_providers_edges_did/genesyscloud_telephony_providers_edges_did_schema.go @@ -4,7 +4,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "terraform-provider-genesyscloud/genesyscloud/provider" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" ) const resourceName = "genesyscloud_telephony_providers_edges_did" @@ -24,7 +24,7 @@ func DataSourceDid() *schema.Resource { Description: "Phone number for the DID.", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidatePhoneNumber, + ValidateDiagFunc: validators.ValidatePhoneNumber, }, }, } diff --git a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_schema.go b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_schema.go index 097a32310..1f88fdc4b 100644 --- a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_schema.go +++ b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_schema.go @@ -6,7 +6,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" ) const resourceName = "genesyscloud_telephony_providers_edges_did_pool" @@ -44,13 +44,13 @@ func ResourceTelephonyDidPool() *schema.Resource { Description: "Starting phone number of the DID Pool range. Phone number must be in a E.164 number format. Changing the start_phone_number attribute will cause the did_pool object to be dropped and recreated with a new ID.", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidatePhoneNumber, + ValidateDiagFunc: validators.ValidatePhoneNumber, }, "end_phone_number": { Description: "Ending phone number of the DID Pool range. Phone number must be in an E.164 number format. Changing the end_phone_number attribute will cause the did_pool object to be dropped and recreated with a new ID.", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidatePhoneNumber, + ValidateDiagFunc: validators.ValidatePhoneNumber, }, "description": { Description: "DID Pool description.", @@ -83,13 +83,13 @@ func DataSourceDidPool() *schema.Resource { Description: "Starting phone number of the DID Pool range. Must be in an E.164 number format.", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidatePhoneNumber, + ValidateDiagFunc: validators.ValidatePhoneNumber, }, "end_phone_number": { Description: "Ending phone number of the DID Pool range.", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidatePhoneNumber, + ValidateDiagFunc: validators.ValidatePhoneNumber, }, }, } diff --git a/genesyscloud/telephony_providers_edges_extension_pool/genesyscloud_telephony_providers_edges_extension_pool_schema.go b/genesyscloud/telephony_providers_edges_extension_pool/genesyscloud_telephony_providers_edges_extension_pool_schema.go index 0b8eb37df..929e78bed 100644 --- a/genesyscloud/telephony_providers_edges_extension_pool/genesyscloud_telephony_providers_edges_extension_pool_schema.go +++ b/genesyscloud/telephony_providers_edges_extension_pool/genesyscloud_telephony_providers_edges_extension_pool_schema.go @@ -5,7 +5,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" ) const ( @@ -29,14 +29,14 @@ func ResourceTelephonyExtensionPool() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateDiagFunc: gcloud.ValidateExtensionPool, + ValidateDiagFunc: validators.ValidateExtensionPool, }, "end_number": { Description: "Ending phone number of the Extension Pool range. Changing the end_number attribute will cause the extension object to be dropped and recreated with a new ID.", Type: schema.TypeString, Required: true, ForceNew: true, - ValidateDiagFunc: gcloud.ValidateExtensionPool, + ValidateDiagFunc: validators.ValidateExtensionPool, }, "description": { Description: "Extension Pool description.", @@ -56,13 +56,13 @@ func DataSourceExtensionPool() *schema.Resource { Description: "Starting number of the Extension Pool range.", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidateExtensionPool, + ValidateDiagFunc: validators.ValidateExtensionPool, }, "end_number": { Description: "Ending number of the Extension Pool range.", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidateExtensionPool, + ValidateDiagFunc: validators.ValidateExtensionPool, }, }, } @@ -76,7 +76,7 @@ func TelephonyExtensionPoolExporter() *resourceExporter.ResourceExporter { } func SetRegistrar(l registrar.Registrar) { - l.RegisterDataSource("genesyscloud_telephony_providers_edges_extension_pool", DataSourceExtensionPool()) - l.RegisterResource("genesyscloud_telephony_providers_edges_extension_pool", ResourceTelephonyExtensionPool()) - l.RegisterExporter("genesyscloud_telephony_providers_edges_extension_pool", TelephonyExtensionPoolExporter()) + l.RegisterDataSource(resourceName, DataSourceExtensionPool()) + l.RegisterResource(resourceName, ResourceTelephonyExtensionPool()) + l.RegisterExporter(resourceName, TelephonyExtensionPoolExporter()) } diff --git a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_schema.go b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_schema.go index 2e1315b58..489a269b7 100644 --- a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_schema.go +++ b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_schema.go @@ -5,7 +5,7 @@ import ( resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" "terraform-provider-genesyscloud/genesyscloud/util" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" @@ -140,7 +140,7 @@ func ResourcePhone() *schema.Resource { Type: schema.TypeList, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateDiagFunc: gcloud.ValidatePhoneNumber}, + Elem: &schema.Schema{Type: schema.TypeString, ValidateDiagFunc: validators.ValidatePhoneNumber}, }, "properties": { Description: "phone properties", diff --git a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_schema.go b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_schema.go index 097a5cd00..db12e288d 100644 --- a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_schema.go +++ b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_schema.go @@ -8,7 +8,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" ) /* @@ -90,7 +90,7 @@ func ResourceSite() *schema.Resource { Description: "A reoccurring rule for updating the Edges assigned to the site. The only supported frequencies are daily and weekly. Weekly frequencies require a day list with at least oneday specified. All other configurations are not supported.", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidateRrule, + ValidateDiagFunc: validators.ValidateRrule, }, "start": { Description: "Date time is represented as an ISO-8601 string without a timezone. For example: yyyy-MM-ddTHH:mm:ss.SSS", @@ -221,7 +221,7 @@ func ResourceSite() *schema.Resource { Description: "The caller ID value for the site. The callerID must be a valid E.164 formatted phone number", Type: schema.TypeString, Optional: true, - ValidateDiagFunc: gcloud.ValidatePhoneNumber, + ValidateDiagFunc: validators.ValidatePhoneNumber, }, "caller_name": { Description: "The caller name for the site", diff --git a/genesyscloud/tfexporter/resource_genesyscloud_tf_export.go b/genesyscloud/tfexporter/resource_genesyscloud_tf_export.go index ff21b8582..9ed87e0e5 100644 --- a/genesyscloud/tfexporter/resource_genesyscloud_tf_export.go +++ b/genesyscloud/tfexporter/resource_genesyscloud_tf_export.go @@ -5,7 +5,7 @@ import ( "fmt" "os" "path/filepath" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" @@ -48,7 +48,7 @@ func ResourceTfExport() *schema.Resource { Optional: true, Elem: &schema.Schema{ Type: schema.TypeString, - ValidateFunc: gcloud.ValidateSubStringInSlice(resourceExporter.GetAvailableExporterTypes()), + ValidateFunc: validators.ValidateSubStringInSlice(resourceExporter.GetAvailableExporterTypes()), }, ForceNew: true, Deprecated: "Use include_filter_resources attribute instead", @@ -60,7 +60,7 @@ func ResourceTfExport() *schema.Resource { Optional: true, Elem: &schema.Schema{ Type: schema.TypeString, - ValidateFunc: gcloud.ValidateSubStringInSlice(resourceExporter.GetAvailableExporterTypes()), + ValidateFunc: validators.ValidateSubStringInSlice(resourceExporter.GetAvailableExporterTypes()), }, ForceNew: true, ConflictsWith: []string{"resource_types", "exclude_filter_resources"}, @@ -80,7 +80,7 @@ func ResourceTfExport() *schema.Resource { Optional: true, Elem: &schema.Schema{ Type: schema.TypeString, - ValidateFunc: gcloud.ValidateSubStringInSlice(resourceExporter.GetAvailableExporterTypes()), + ValidateFunc: validators.ValidateSubStringInSlice(resourceExporter.GetAvailableExporterTypes()), }, ForceNew: true, ConflictsWith: []string{"resource_types", "include_filter_resources"}, diff --git a/genesyscloud/util/resourcedata/resourcedata.go b/genesyscloud/util/resourcedata/resourcedata.go index 3cf629233..f4d2c21c6 100644 --- a/genesyscloud/util/resourcedata/resourcedata.go +++ b/genesyscloud/util/resourcedata/resourcedata.go @@ -147,21 +147,21 @@ func SetNillableValue[T any](d *schema.ResourceData, key string, value *T) { } } -// SetNillableValueWithInterfaceArrayWithFunc will read the values in a nested resource using the provided function and set it on the schema +// SetNillableValueWithInterfaceArrayWithFunc will set the value of {key} to an interface array using func {f} if {value} is not nil func SetNillableValueWithInterfaceArrayWithFunc[T any](d *schema.ResourceData, key string, value *T, f func(*T) []interface{}) { if value != nil { - d.Set(key, f(value)) + _ = d.Set(key, f(value)) } else { - d.Set(key, nil) + _ = d.Set(key, nil) } } -// SetNillableValueWithInterfaceArrayWithFunc will read the values in a nested resource using the provided function and set it on the schema +// SetNillableValueWithSchemaSetWithFunc will set the value of {key} to a *schema.Set using func {f} if {value} is not nil func SetNillableValueWithSchemaSetWithFunc[T any](d *schema.ResourceData, key string, value *T, f func(*T) *schema.Set) { if value != nil { - d.Set(key, f(value)) + _ = d.Set(key, f(value)) } else { - d.Set(key, nil) + _ = d.Set(key, nil) } } diff --git a/genesyscloud/validators/validators.go b/genesyscloud/validators/validators.go index 4c4a78a9d..a375e6bd6 100644 --- a/genesyscloud/validators/validators.go +++ b/genesyscloud/validators/validators.go @@ -94,7 +94,7 @@ func ValidateRrule(rrule interface{}, _ cty.Path) diag.Diagnostics { return diag.Errorf("Provided rrule %v is not in string format", rrule) } -// Validates a phone extension pool +// ValidateExtensionPool validates a phone extension pool func ValidateExtensionPool(number interface{}, _ cty.Path) diag.Diagnostics { if numberStr, ok := number.(string); ok { @@ -109,7 +109,7 @@ func ValidateExtensionPool(number interface{}, _ cty.Path) diag.Diagnostics { return diag.Errorf("Extension provided %v is not a string", number) } -// Validates a date string is in the format yyyy-MM-dd +// ValidateDate validates a date string is in the format yyyy-MM-dd func ValidateDate(date interface{}, _ cty.Path) diag.Diagnostics { if dateStr, ok := date.(string); ok { _, err := time.Parse(resourcedata.DateParseFormat, dateStr) @@ -121,7 +121,7 @@ func ValidateDate(date interface{}, _ cty.Path) diag.Diagnostics { return diag.Errorf("Date %v is not a string", date) } -// Validates a date string is in the format 2006-01-02T15:04Z +// ValidateDateTime validates a date string is in the format 2006-01-02T15:04Z func ValidateDateTime(date interface{}, _ cty.Path) diag.Diagnostics { if dateStr, ok := date.(string); ok { _, err := time.Parse("2006-01-02T15:04Z", dateStr) @@ -133,7 +133,7 @@ func ValidateDateTime(date interface{}, _ cty.Path) diag.Diagnostics { return diag.Errorf("Date %v is not a string", date) } -// Validates a country code is in format ISO 3166-1 alpha-2 +// ValidateCountryCode validates a country code is in format ISO 3166-1 alpha-2 func ValidateCountryCode(code interface{}, _ cty.Path) diag.Diagnostics { countryCode := code.(string) if len(countryCode) == 2 { @@ -144,7 +144,7 @@ func ValidateCountryCode(code interface{}, _ cty.Path) diag.Diagnostics { return diag.Errorf("Country code %v is not of format ISO 3166-1 alpha-2", code) } -// Validates a date string is in format hh:mm:ss +// ValidateTime validates a date string is in format hh:mm:ss func ValidateTime(time interface{}, _ cty.Path) diag.Diagnostics { timeStr := time.(string) if len(timeStr) > 9 { @@ -157,7 +157,7 @@ func ValidateTime(time interface{}, _ cty.Path) diag.Diagnostics { return diag.Errorf("Time %v is not a valid time", time) } -// Validates a date string is in format hh:mm +// ValidateTimeHHMM validates a date string is in format hh:mm func ValidateTimeHHMM(time interface{}, _ cty.Path) diag.Diagnostics { timeStr := time.(string) if timeStr == "" { @@ -171,7 +171,7 @@ func ValidateTimeHHMM(time interface{}, _ cty.Path) diag.Diagnostics { return diag.Errorf("Time %v is not a valid time, must use format HH:mm", time) } -// Validates a date string is in the format 2006-01-02T15:04:05.000000 +// ValidateLocalDateTimes validates a date string is in the format 2006-01-02T15:04:05.000000 func ValidateLocalDateTimes(date interface{}, _ cty.Path) diag.Diagnostics { if dateStr, ok := date.(string); ok { _, err := time.Parse(resourcedata.TimeParseFormat, dateStr) @@ -183,7 +183,7 @@ func ValidateLocalDateTimes(date interface{}, _ cty.Path) diag.Diagnostics { return diag.Errorf("Date %v is not a string", date) } -// Validates a file path or URL +// ValidatePath validates a file path or URL func ValidatePath(i interface{}, k string) (warnings []string, errors []error) { v, ok := i.(string) if !ok { @@ -207,7 +207,7 @@ func ValidatePath(i interface{}, k string) (warnings []string, errors []error) { return warnings, errors } -// Validate a response asset filename matches the criteria outlined in the description +// ValidateResponseAssetName validate a response asset filename matches the criteria outlined in the description func ValidateResponseAssetName(name interface{}, _ cty.Path) diag.Diagnostics { if nameStr, ok := name.(string); ok { matched, err := regexp.MatchString("^[^\\.][^\\`\\\\{\\^\\}\\% \"\\>\\<\\[\\]\\#\\~|]+[^/]$", nameStr) @@ -250,7 +250,7 @@ func ValidateSubStringInSlice(valid []string) schema.SchemaValidateFunc { } } -// Validate if a string matches '#FFFFFF' RGB color representation. +// ValidateHexColor validates if a string matches '#FFFFFF' RGB color representation. func ValidateHexColor(color interface{}, _ cty.Path) diag.Diagnostics { if colorStr, ok := color.(string); ok { matched, err := regexp.MatchString("^#([A-Fa-f0-9]{6})$", colorStr) diff --git a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_schema.go b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_schema.go index ba5c38bea..8cb13177c 100644 --- a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_schema.go +++ b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_schema.go @@ -4,7 +4,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" wdcUtils "terraform-provider-genesyscloud/genesyscloud/webdeployments_configuration/utils" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -518,13 +518,13 @@ var ( Description: "Background color for hero section, in hexadecimal format, eg #ffffff", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidateHexColor, + ValidateDiagFunc: validators.ValidateHexColor, }, "text_color": { Description: "Text color for hero section, in hexadecimal format, eg #ffffff", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidateHexColor, + ValidateDiagFunc: validators.ValidateHexColor, }, "image_uri": { Description: "Background image for hero section", @@ -546,31 +546,31 @@ var ( Description: "Global background color, in hexadecimal format, eg #ffffff", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidateHexColor, + ValidateDiagFunc: validators.ValidateHexColor, }, "primary_color": { Description: "Global primary color, in hexadecimal format, eg #ffffff", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidateHexColor, + ValidateDiagFunc: validators.ValidateHexColor, }, "primary_color_dark": { Description: "Global dark primary color, in hexadecimal format, eg #ffffff", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidateHexColor, + ValidateDiagFunc: validators.ValidateHexColor, }, "primary_color_light": { Description: "Global light primary color, in hexadecimal format, eg #ffffff", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidateHexColor, + ValidateDiagFunc: validators.ValidateHexColor, }, "text_color": { Description: "Global text color, in hexadecimal format, eg #ffffff", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidateHexColor, + ValidateDiagFunc: validators.ValidateHexColor, }, "font_family": { Description: "Global font family", From 397140de4c22319d1f1380e994ba6cee616ce6ae Mon Sep 17 00:00:00 2001 From: tsantos-genesys <154342374+tsantos-genesys@users.noreply.github.com> Date: Tue, 18 Jun 2024 17:49:20 +0100 Subject: [PATCH 11/62] refactor/Tidy up journey_segment resource tests/doc (#1103) --- docs/resources/journey_segment.md | 2 +- .../resource_genesyscloud_journey_segment.go | 3 +- ...ource_genesyscloud_journey_segment_test.go | 76 ++++++------------- .../05_update_remove_ignore_frequency_cap.tf | 2 +- .../01_basic_resource.tf} | 0 .../02_update_attributes.tf | 0 .../01_create_customer_scope.tf | 19 ----- ...2_recreate_external_segment_update_name.tf | 19 ----- ..._recreate_external_segment_id_force_new.tf | 20 ----- .../04_update_color_change.tf | 20 ----- .../03_recreate_scope_change_force_new.tf | 20 ----- ...pdate_remove_assignment_expirition_days.tf | 20 ----- 12 files changed, 25 insertions(+), 176 deletions(-) rename test/data/resource/genesyscloud_journey_segment/{basic_session_attributes/01_create_session_scope.tf => basic_attributes/01_basic_resource.tf} (100%) rename test/data/resource/genesyscloud_journey_segment/{basic_session_attributes => basic_attributes}/02_update_attributes.tf (100%) delete mode 100644 test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/01_create_customer_scope.tf delete mode 100644 test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/02_recreate_external_segment_update_name.tf delete mode 100644 test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/03_recreate_external_segment_id_force_new.tf delete mode 100644 test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/04_update_color_change.tf delete mode 100644 test/data/resource/genesyscloud_journey_segment/basic_session_attributes/03_recreate_scope_change_force_new.tf delete mode 100644 test/data/resource/genesyscloud_journey_segment/optional_attributes/04_update_remove_assignment_expirition_days.tf diff --git a/docs/resources/journey_segment.md b/docs/resources/journey_segment.md index 66173abf6..bc7f23450 100644 --- a/docs/resources/journey_segment.md +++ b/docs/resources/journey_segment.md @@ -60,7 +60,7 @@ resource "genesyscloud_journey_segment" "example_journey_segment_resource" { - `color` (String) The hexadecimal color value of the segment. - `display_name` (String) The display name of the segment. -- `scope` (String) The target entity that a segment applies to.Valid values: Session, Customer. Changing the scope attribute will cause the existing journey_segment to be dropped and recreated with new ID. +- `scope` (String) The target entity that a segment applies to. Valid values: Session. ### Optional diff --git a/genesyscloud/resource_genesyscloud_journey_segment.go b/genesyscloud/resource_genesyscloud_journey_segment.go index 08bc2892b..453d1191e 100644 --- a/genesyscloud/resource_genesyscloud_journey_segment.go +++ b/genesyscloud/resource_genesyscloud_journey_segment.go @@ -53,7 +53,7 @@ var ( }(), ""), }, "scope": { - Description: "The target entity that a segment applies to.Valid values: Session, Customer. Changing the scope attribute will cause the existing journey_segment to be dropped and recreated with new ID.", + Description: "The target entity that a segment applies to. Valid values: Session", Type: schema.TypeString, Required: true, ForceNew: true, // scope can be only set during creation @@ -63,7 +63,6 @@ var ( Description: "Whether or not the segment should be displayed to agent/supervisor users.", Type: schema.TypeBool, Optional: true, - // Customer scope only supports false for this value }, "context": { Description: "The context of the segment.", diff --git a/genesyscloud/resource_genesyscloud_journey_segment_test.go b/genesyscloud/resource_genesyscloud_journey_segment_test.go index 7c7f57778..7e0946b52 100644 --- a/genesyscloud/resource_genesyscloud_journey_segment_test.go +++ b/genesyscloud/resource_genesyscloud_journey_segment_test.go @@ -2,7 +2,6 @@ package genesyscloud import ( "fmt" - "github.com/google/uuid" "log" "strings" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -16,12 +15,8 @@ import ( "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) -func TestAccResourceJourneySegmentCustomer(t *testing.T) { - runResourceJourneySegmentTestCase(t, "basic_customer_attributes") -} - -func TestAccResourceJourneySegmentSession(t *testing.T) { - runResourceJourneySegmentTestCase(t, "basic_session_attributes") +func TestAccResourceJourneySegment(t *testing.T) { + runResourceJourneySegmentTestCase(t, "basic_attributes") } func TestAccResourceJourneySegmentContextOnly(t *testing.T) { @@ -56,30 +51,36 @@ func setupJourneySegment(t *testing.T, testCaseName string) { func cleanupJourneySegments(idPrefix string) { journeyApi := platformclientv2.NewJourneyApiWithConfig(sdkConfig) - pageCount := 1 // Needed because of broken journey common paging - for pageNum := 1; pageNum <= pageCount; pageNum++ { - const pageSize = 100 + segmentsToDelete := make([]platformclientv2.Journeysegment, 0) + + // go through all segments to find those to delete + const pageSize = 200 + for pageNum := 1; ; pageNum++ { journeySegments, _, getErr := journeyApi.GetJourneySegments("", pageSize, pageNum, true, nil, nil, "") if getErr != nil { + log.Printf("failed to get page %v of journeySegments: %v", pageNum, getErr) return } - if journeySegments.Entities == nil || len(*journeySegments.Entities) == 0 { - break - } - for _, journeySegment := range *journeySegments.Entities { if journeySegment.DisplayName != nil && strings.HasPrefix(*journeySegment.DisplayName, idPrefix) { - _, delErr := journeyApi.DeleteJourneySegment(*journeySegment.Id) - if delErr != nil { - util.BuildDiagnosticError("genesyscloud_journey_segment", fmt.Sprintf("failed to delete journey segment %s (%s)", *journeySegment.Id, *journeySegment.DisplayName), delErr) - return - } - log.Printf("Deleted journey segment %s (%s)", *journeySegment.Id, *journeySegment.DisplayName) + segmentsToDelete = append(segmentsToDelete, journeySegment) } } - pageCount = *journeySegments.PageCount + if *journeySegments.PageNumber >= *journeySegments.PageCount { + break + } + } + + // delete them + for _, journeySegment := range segmentsToDelete { + _, delErr := journeyApi.DeleteJourneySegment(*journeySegment.Id) + if delErr != nil { + util.BuildDiagnosticError("genesyscloud_journey_segment", fmt.Sprintf("failed to delete journey segment %s (%s)", *journeySegment.Id, *journeySegment.DisplayName), delErr) + return + } + log.Printf("Deleted journey segment %s (%s)", *journeySegment.Id, *journeySegment.DisplayName) } } @@ -106,36 +107,3 @@ func testVerifyJourneySegmentsDestroyed(state *terraform.State) error { // Success. All Journey segment destroyed return nil } - -func customerSegmentationIsSupported(t *testing.T) (bool, string) { - segmentRequest := platformclientv2.Journeysegmentrequest{ - DisplayName: platformclientv2.String("terraform_test_" + uuid.NewString()), - Color: platformclientv2.String("#008000"), - Scope: platformclientv2.String("Customer"), - ShouldDisplayToAgent: platformclientv2.Bool(false), - ExternalSegment: &platformclientv2.Requestexternalsegment{ - Id: platformclientv2.String("4654654654"), - Name: platformclientv2.String("external segment name"), - Source: platformclientv2.String("AdobeExperiencePlatform"), - }, - } - - apiInstance := platformclientv2.NewJourneyApiWithConfig(sdkConfig) - segment, response, err := apiInstance.PostJourneySegments(segmentRequest) - if err != nil { - if response != nil && response.StatusCode == 501 && strings.Contains(response.ErrorMessage, "not currently supported") { - return false, response.ErrorMessage - } - t.Logf("failed to create segment inside method customerSegmentationIsSupported: %v", err) - return true, "" - } - - t.Logf("Customer segmentation has been implemented.") - - // cleanup segment - if _, err := apiInstance.DeleteJourneySegment(*segment.Id); err != nil { - t.Logf("failed to cleanup segment inside method customerSegmentationIsSupported. Segment ID: '%s'. Error: '%v'", *segment.Id, err) - } - - return true, "" -} diff --git a/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/05_update_remove_ignore_frequency_cap.tf b/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/05_update_remove_ignore_frequency_cap.tf index 1010bf0fb..a62c9d674 100644 --- a/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/05_update_remove_ignore_frequency_cap.tf +++ b/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/05_update_remove_ignore_frequency_cap.tf @@ -19,7 +19,7 @@ resource "genesyscloud_journey_segment" "terraform_test_-TEST-CASE-_action_map_d display_name = "terraform_test_-TEST-CASE-_action_map_dependency" color = "#008000" scope = "Session" - should_display_to_agent = false + should_display_to_agent = false journey { patterns { criteria { diff --git a/test/data/resource/genesyscloud_journey_segment/basic_session_attributes/01_create_session_scope.tf b/test/data/resource/genesyscloud_journey_segment/basic_attributes/01_basic_resource.tf similarity index 100% rename from test/data/resource/genesyscloud_journey_segment/basic_session_attributes/01_create_session_scope.tf rename to test/data/resource/genesyscloud_journey_segment/basic_attributes/01_basic_resource.tf diff --git a/test/data/resource/genesyscloud_journey_segment/basic_session_attributes/02_update_attributes.tf b/test/data/resource/genesyscloud_journey_segment/basic_attributes/02_update_attributes.tf similarity index 100% rename from test/data/resource/genesyscloud_journey_segment/basic_session_attributes/02_update_attributes.tf rename to test/data/resource/genesyscloud_journey_segment/basic_attributes/02_update_attributes.tf diff --git a/test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/01_create_customer_scope.tf b/test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/01_create_customer_scope.tf deleted file mode 100644 index 13cc0599f..000000000 --- a/test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/01_create_customer_scope.tf +++ /dev/null @@ -1,19 +0,0 @@ -resource "genesyscloud_journey_segment" "terraform_test_-TEST-CASE-" { - display_name = "terraform_test_-TEST-CASE-" - color = "#008000" - should_display_to_agent = false - scope = "Session" - journey { - patterns { - criteria { - key = "page.title" - values = ["Title"] - operator = "notEqual" - should_ignore_case = true - } - count = 1 - stream_type = "Web" - session_type = "web" - } - } -} diff --git a/test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/02_recreate_external_segment_update_name.tf b/test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/02_recreate_external_segment_update_name.tf deleted file mode 100644 index 37c77bc7a..000000000 --- a/test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/02_recreate_external_segment_update_name.tf +++ /dev/null @@ -1,19 +0,0 @@ -resource "genesyscloud_journey_segment" "terraform_test_-TEST-CASE-" { - display_name = "terraform_test_-TEST-CASE-_recreated" - color = "#308000" - should_display_to_agent = false -scope = "Session" - journey { - patterns { - criteria { - key = "page.title" - values = ["Title"] - operator = "notEqual" - should_ignore_case = true - } - count = 1 - stream_type = "Web" - session_type = "web" - } - } -} diff --git a/test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/03_recreate_external_segment_id_force_new.tf b/test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/03_recreate_external_segment_id_force_new.tf deleted file mode 100644 index 4b224baf3..000000000 --- a/test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/03_recreate_external_segment_id_force_new.tf +++ /dev/null @@ -1,20 +0,0 @@ -resource "genesyscloud_journey_segment" "terraform_test_-TEST-CASE-" { - display_name = "terraform_test_-TEST-CASE-_recreated" - color = "#308000" - should_display_to_agent = false - scope = "Session" - - journey { - patterns { - criteria { - key = "page.title" - values = ["Title"] - operator = "notEqual" - should_ignore_case = true - } - count = 1 - stream_type = "Web" - session_type = "web" - } - } -} diff --git a/test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/04_update_color_change.tf b/test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/04_update_color_change.tf deleted file mode 100644 index e163793a6..000000000 --- a/test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/04_update_color_change.tf +++ /dev/null @@ -1,20 +0,0 @@ -resource "genesyscloud_journey_segment" "terraform_test_-TEST-CASE-" { - display_name = "terraform_test_-TEST-CASE-_updated" - color = "#318234" - should_display_to_agent = false - scope = "Session" - - journey { - patterns { - criteria { - key = "page.title" - values = ["Title"] - operator = "notEqual" - should_ignore_case = true - } - count = 1 - stream_type = "Web" - session_type = "web" - } - } -} diff --git a/test/data/resource/genesyscloud_journey_segment/basic_session_attributes/03_recreate_scope_change_force_new.tf b/test/data/resource/genesyscloud_journey_segment/basic_session_attributes/03_recreate_scope_change_force_new.tf deleted file mode 100644 index 4b224baf3..000000000 --- a/test/data/resource/genesyscloud_journey_segment/basic_session_attributes/03_recreate_scope_change_force_new.tf +++ /dev/null @@ -1,20 +0,0 @@ -resource "genesyscloud_journey_segment" "terraform_test_-TEST-CASE-" { - display_name = "terraform_test_-TEST-CASE-_recreated" - color = "#308000" - should_display_to_agent = false - scope = "Session" - - journey { - patterns { - criteria { - key = "page.title" - values = ["Title"] - operator = "notEqual" - should_ignore_case = true - } - count = 1 - stream_type = "Web" - session_type = "web" - } - } -} diff --git a/test/data/resource/genesyscloud_journey_segment/optional_attributes/04_update_remove_assignment_expirition_days.tf b/test/data/resource/genesyscloud_journey_segment/optional_attributes/04_update_remove_assignment_expirition_days.tf deleted file mode 100644 index 255113a57..000000000 --- a/test/data/resource/genesyscloud_journey_segment/optional_attributes/04_update_remove_assignment_expirition_days.tf +++ /dev/null @@ -1,20 +0,0 @@ -resource "genesyscloud_journey_segment" "terraform_test_-TEST-CASE-" { - # required - display_name = "terraform_test_-TEST-CASE-_updated" - color = "#008000" - scope = "Session" - should_display_to_agent = false - journey { - patterns { - criteria { - key = "page.title" - values = ["Title"] - operator = "notEqual" - should_ignore_case = true - } - count = 1 - stream_type = "Web" - session_type = "web" - } - } -} From 11d167a7727a93d81aec4627078ab2baa055d535 Mon Sep 17 00:00:00 2001 From: Brian Goad Date: Tue, 18 Jun 2024 12:54:29 -0400 Subject: [PATCH 12/62] Fix issues identified in DEVTOOLING-662 as a result of testing DEVTOOLING-477 (#1109) --- ...phony_providers_edges_trunkbasesettings.go | 6 +++-- ...syscloud_telephony_providers_edges_site.go | 23 +++++++++++++------ ...viders_edges_site_outbound_route_schema.go | 6 ++--- .../util/feature_toggles/outbound_routes.go | 6 ++--- 4 files changed, 26 insertions(+), 15 deletions(-) diff --git a/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings.go b/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings.go index 9655fd4ab..a7d109954 100644 --- a/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings.go +++ b/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings.go @@ -402,8 +402,10 @@ func ValidateInboundSiteSettings(inboundSiteString string, trunkBaseMetaId strin func TrunkBaseSettingsExporter() *resourceExporter.ResourceExporter { return &resourceExporter.ResourceExporter{ - GetResourcesFunc: provider.GetAllWithPooledClient(getAllTrunkBaseSettings), - RefAttrs: map[string]*resourceExporter.RefAttrSettings{}, + GetResourcesFunc: provider.GetAllWithPooledClient(getAllTrunkBaseSettings), + RefAttrs: map[string]*resourceExporter.RefAttrSettings{ + "inbound_site_id": {RefType: "genesyscloud_telephony_providers_edges_site"}, + }, JsonEncodeAttributes: []string{"properties"}, } } diff --git a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site.go b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site.go index ce158dc38..5297248fe 100644 --- a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site.go +++ b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site.go @@ -306,14 +306,23 @@ func deleteSite(ctx context.Context, d *schema.ResourceData, meta interface{}) d sdkConfig := meta.(*provider.ProviderMeta).ClientConfig sp := GetSiteProxy(sdkConfig) - log.Printf("Deleting site") - resp, err := sp.deleteSite(ctx, d.Id()) - if err != nil { - if util.IsStatus404(resp) { - log.Printf("Site already deleted %s", d.Id()) - return nil + // A site linked to a trunk will not be able to be deleted until that trunk is deleted. Retrying here to make sure it is cleared properly. + log.Printf("Deleting site %s", d.Id()) + diagErr := util.RetryWhen(util.IsStatus409, func() (*platformclientv2.APIResponse, diag.Diagnostics) { + log.Printf("Deleting site %s", d.Id()) + resp, err := sp.deleteSite(ctx, d.Id()) + if err != nil { + if util.IsStatus404(resp) { + log.Printf("Site already deleted %s", d.Id()) + return resp, nil + } + return resp, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to delete site %s error: %s", d.Id(), err), resp) } - return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to delete site %s error: %s", d.Id(), err), resp) + return resp, nil + }) + + if diagErr != nil { + return diagErr } return util.WithRetries(ctx, 30*time.Second, func() *retry.RetryError { diff --git a/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_schema.go b/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_schema.go index 0e424c08c..a16fefc0b 100644 --- a/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_schema.go +++ b/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_schema.go @@ -1,11 +1,12 @@ package telephony_providers_edges_site_outbound_route import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) /* @@ -93,7 +94,6 @@ func ResourceSiteOutboundRoute() *schema.Resource { Required: true, ConfigMode: schema.SchemaConfigModeAttr, Elem: outboundRouteSchema, - MinItems: 1, }, }, } diff --git a/genesyscloud/util/feature_toggles/outbound_routes.go b/genesyscloud/util/feature_toggles/outbound_routes.go index d3bf3d035..b2f143601 100644 --- a/genesyscloud/util/feature_toggles/outbound_routes.go +++ b/genesyscloud/util/feature_toggles/outbound_routes.go @@ -2,14 +2,14 @@ package feature_toggles import "os" -const outboundRotesEnvToggle = "ENABLE_STANDALONE_OUTBOUND_ROUTES" +const outboundRoutesEnvToggle = "ENABLE_STANDALONE_OUTBOUND_ROUTES" func OutboundRoutesToggleName() string { - return outboundRotesEnvToggle + return outboundRoutesEnvToggle } func OutboundRoutesToggleExists() bool { var exists bool - _, exists = os.LookupEnv(outboundRotesEnvToggle) + _, exists = os.LookupEnv(outboundRoutesEnvToggle) return exists } From 3ea8e24669e30a17d9e6423d687143bf9a3a1b48 Mon Sep 17 00:00:00 2001 From: dginty4 <108797778+dginty4@users.noreply.github.com> Date: Tue, 18 Jun 2024 18:05:35 +0100 Subject: [PATCH 13/62] Updating docs (#1110) --- docs/resources/journey_segment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/resources/journey_segment.md b/docs/resources/journey_segment.md index bc7f23450..785e47715 100644 --- a/docs/resources/journey_segment.md +++ b/docs/resources/journey_segment.md @@ -60,7 +60,7 @@ resource "genesyscloud_journey_segment" "example_journey_segment_resource" { - `color` (String) The hexadecimal color value of the segment. - `display_name` (String) The display name of the segment. -- `scope` (String) The target entity that a segment applies to. Valid values: Session. +- `scope` (String) The target entity that a segment applies to. Valid values: Session ### Optional From cea8ce8427e8a4ea9403859cc58e0b8988a8b3b4 Mon Sep 17 00:00:00 2001 From: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Date: Tue, 18 Jun 2024 18:20:14 +0100 Subject: [PATCH 14/62] feat/devtooling 71: Outbound contact list contact resource (#1084) * Creating contact_list_contact resource * Defined contact list contact resource schema * Defined more boiler plate code for contact package + started working on create func * implemented read function for contact resource * finished crud operations and started testing * Refactored calls to GenerateMap test util function * Necessary refactoring to get contact test passing * extending contact_list_contact tests * Removed id field from schema + added example data * go generate * Adding contact_list_contact exporter * Updated gc sdk version and finished contact exporter * finishing contact exporter --- .../outbound_contact_list_contact.md | 115 +++++++++++ .../apis.md | 4 + .../resource.tf | 37 ++++ .../resource_genesyscloud_integration_test.go | 8 +- ...ce_genesyscloud_integration_action_test.go | 36 ++-- ...enesyscloud_integration_credential_test.go | 4 +- ...enesyscloud_integration_credential_test.go | 34 +++- ...nesyscloud_integration_credential_utils.go | 4 +- ...oud_integration_custom_auth_action_test.go | 2 +- ...oud_integration_custom_auth_action_test.go | 4 +- ...ource_genesyscloud_outbound_contactlist.go | 10 + ..._genesyscloud_outbound_contactlist_test.go | 26 +-- ...outbound_contact_list_contact_init_test.go | 42 ++++ ...oud_outbound_contact_list_contact_proxy.go | 179 +++++++++++++++++ ...esyscloud_outbound_contact_list_contact.go | 153 +++++++++++++++ ...ud_outbound_contact_list_contact_schema.go | 147 ++++++++++++++ ...loud_outbound_contact_list_contact_test.go | 176 +++++++++++++++++ ...oud_outbound_contact_list_contact_utils.go | 182 ++++++++++++++++++ .../resource_exporter/resource_exporter.go | 8 + .../genesyscloud_resource_exporter.go | 8 +- .../tfexporter/tf_exporter_resource_test.go | 4 + genesyscloud/util/lists/util_lists.go | 12 ++ .../util/resourcedata/resourcedata.go | 4 +- genesyscloud/util/test_utils.go | 3 +- go.sum | 2 - main.go | 2 + 26 files changed, 1149 insertions(+), 57 deletions(-) create mode 100644 docs/resources/outbound_contact_list_contact.md create mode 100644 examples/resources/genesyscloud_outbound_contact_list_contact/apis.md create mode 100644 examples/resources/genesyscloud_outbound_contact_list_contact/resource.tf create mode 100644 genesyscloud/outbound_contact_list_contact/genesyscloud_outbound_contact_list_contact_init_test.go create mode 100644 genesyscloud/outbound_contact_list_contact/genesyscloud_outbound_contact_list_contact_proxy.go create mode 100644 genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact.go create mode 100644 genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_schema.go create mode 100644 genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_test.go create mode 100644 genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_utils.go diff --git a/docs/resources/outbound_contact_list_contact.md b/docs/resources/outbound_contact_list_contact.md new file mode 100644 index 000000000..98c79269f --- /dev/null +++ b/docs/resources/outbound_contact_list_contact.md @@ -0,0 +1,115 @@ +--- +page_title: "genesyscloud_outbound_contact_list_contact Resource - terraform-provider-genesyscloud" +subcategory: "" +description: |- + Genesys Cloud Outbound Contact List Contact +--- +# genesyscloud_outbound_contact_list_contact (Resource) + +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: + +- [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-) + +## Example Usage + +```terraform +resource "genesyscloud_outbound_contact_list_contact" "contact" { + contact_list_id = genesyscloud_outbound_contact_list.contact_list.id + callable = true + data = { + Cell = "+1111111" + Home = "+2222222" + Email = "example@email.com" + } + phone_number_status { + key = "Cell" + callable = true + } + phone_number_status { + key = "Home" + callable = false + } + contactable_status { + media_type = "Voice" + contactable = true + column_status { + column = "Cell" + contactable = true + } + column_status { + column = "Home" + contactable = false + } + } + contactable_status { + media_type = "Email" + contactable = true + column_status { + column = "Email" + contactable = true + } + } +} +``` + + +## Schema + +### Required + +- `contact_list_id` (String) The identifier of the contact list containing this contact. +- `data` (Map of String) An ordered map of the contact's columns and corresponding values. + +### Optional + +- `callable` (Boolean) Indicates whether or not the contact can be called. Defaults to `false`. +- `clear_system_data` (Boolean) Clear system data. True means the system columns (attempts, callable status, etc) stored on the contact will be cleared if the contact already exists; false means they won't. +Only applicable on the creation of a contact, so updating this field will force the contact to be deleted from the contact list and re-uploaded. +- `contactable_status` (Block Set) A map of media types (Voice, SMS and Email) to ContactableStatus, which indicates if the contact can be contacted using the specified media type. (see [below for nested schema](#nestedblock--contactable_status)) +- `do_not_queue` (Boolean) Do not queue. True means that updated contacts will not have their positions in the queue altered, so contacts that have already been dialed will not be redialed. +For new contacts, this parameter has no effect; False means that updated contacts will be re-queued, according to the 'priority' parameter. +Only applicable on the creation of a contact, so updating this field will force the contact to be deleted from the contact list and re-uploaded. +- `phone_number_status` (Block Set) A map of phone number columns to PhoneNumberStatuses, which indicate if the phone number is callable or not. (see [below for nested schema](#nestedblock--phone_number_status)) +- `priority` (Boolean) Contact priority. True means the contact(s) will be dialed next; false means the contact will go to the end of the contact queue. +Only applicable on the creation of a contact, so updating this field will force the contact to be deleted from the contact list and re-uploaded. + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `contactable_status` + +Required: + +- `contactable` (Boolean) Indicates whether or not the entire contact is contactable for the associated media type. +- `media_type` (String) The key which identifies the media type (Voice, SMS and Email). + +Optional: + +- `column_status` (Block Set) A map of individual contact method columns to whether the individual column is contactable for the associated media type. (see [below for nested schema](#nestedblock--contactable_status--column_status)) + + +### Nested Schema for `contactable_status.column_status` + +Required: + +- `column` (String) The key which identifies the contact method column. +- `contactable` (Boolean) Indicates whether or not an individual contact method column is contactable. + + + + +### Nested Schema for `phone_number_status` + +Required: + +- `callable` (Boolean) Indicates whether or not a phone number is callable. +- `key` (String) Phone number column identifier. + diff --git a/examples/resources/genesyscloud_outbound_contact_list_contact/apis.md b/examples/resources/genesyscloud_outbound_contact_list_contact/apis.md new file mode 100644 index 000000000..239567e26 --- /dev/null +++ b/examples/resources/genesyscloud_outbound_contact_list_contact/apis.md @@ -0,0 +1,4 @@ +- [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-) \ No newline at end of file diff --git a/examples/resources/genesyscloud_outbound_contact_list_contact/resource.tf b/examples/resources/genesyscloud_outbound_contact_list_contact/resource.tf new file mode 100644 index 000000000..07bd64312 --- /dev/null +++ b/examples/resources/genesyscloud_outbound_contact_list_contact/resource.tf @@ -0,0 +1,37 @@ +resource "genesyscloud_outbound_contact_list_contact" "contact" { + contact_list_id = genesyscloud_outbound_contact_list.contact_list.id + callable = true + data = { + Cell = "+1111111" + Home = "+2222222" + Email = "example@email.com" + } + phone_number_status { + key = "Cell" + callable = true + } + phone_number_status { + key = "Home" + callable = false + } + contactable_status { + media_type = "Voice" + contactable = true + column_status { + column = "Cell" + contactable = true + } + column_status { + column = "Home" + contactable = false + } + } + contactable_status { + media_type = "Email" + contactable = true + column_status { + column = "Email" + contactable = true + } + } +} \ No newline at end of file diff --git a/genesyscloud/integration/resource_genesyscloud_integration_test.go b/genesyscloud/integration/resource_genesyscloud_integration_test.go index 54a613793..4f0476236 100644 --- a/genesyscloud/integration/resource_genesyscloud_integration_test.go +++ b/genesyscloud/integration/resource_genesyscloud_integration_test.go @@ -266,7 +266,9 @@ func TestAccResourceIntegration(t *testing.T) { strconv.Quote(credName1), strconv.Quote(credTypeName1), integrationCred.GenerateCredentialFields( - util.GenerateMapProperty(key1, strconv.Quote(val1)), + map[string]string{ + key1: strconv.Quote(val1), + }, ), ) + GenerateIntegrationResource( inteResource2, @@ -297,7 +299,9 @@ func TestAccResourceIntegration(t *testing.T) { strconv.Quote(credName1), strconv.Quote(credTypeName1), integrationCred.GenerateCredentialFields( - util.GenerateMapProperty(key1, strconv.Quote(val1)), + map[string]string{ + key1: strconv.Quote(val1), + }, ), ) + GenerateIntegrationResource( inteResource2, diff --git a/genesyscloud/integration_action/resource_genesyscloud_integration_action_test.go b/genesyscloud/integration_action/resource_genesyscloud_integration_action_test.go index 9faddcb99..24fe588ff 100644 --- a/genesyscloud/integration_action/resource_genesyscloud_integration_action_test.go +++ b/genesyscloud/integration_action/resource_genesyscloud_integration_action_test.go @@ -114,20 +114,26 @@ func TestAccResourceIntegrationAction(t *testing.T) { reqUrlTemplate2, reqType2, strconv.Quote(reqTemp), - util.GenerateMapAttr( + util.GenerateMapAttrWithMapProperties( "headers", - util.GenerateMapProperty(headerKey, strconv.Quote(headerVal1)), + map[string]string{ + headerKey: strconv.Quote(headerVal1), + }, ), ), generateIntegrationActionConfigResponse( strconv.Quote(successTemplate), - util.GenerateMapAttr( + util.GenerateMapAttrWithMapProperties( "translation_map", - util.GenerateMapProperty(transMapAttr, strconv.Quote(transMapVal1)), + map[string]string{ + transMapAttr: strconv.Quote(transMapVal1), + }, ), - util.GenerateMapAttr( + util.GenerateMapAttrWithMapProperties( "translation_map_defaults", - util.GenerateMapProperty(transMapAttr, strconv.Quote(transMapValDefault1)), + map[string]string{ + transMapAttr: strconv.Quote(transMapValDefault1), + }, ), ), ), @@ -165,20 +171,26 @@ func TestAccResourceIntegrationAction(t *testing.T) { reqUrlTemplate2, reqType2, strconv.Quote(reqTemp), - util.GenerateMapAttr( + util.GenerateMapAttrWithMapProperties( "headers", - util.GenerateMapProperty(headerKey, strconv.Quote(headerVal2)), + map[string]string{ + headerKey: strconv.Quote(headerVal2), + }, ), ), generateIntegrationActionConfigResponse( strconv.Quote(successTemplate), - util.GenerateMapAttr( + util.GenerateMapAttrWithMapProperties( "translation_map", - util.GenerateMapProperty(transMapAttr, strconv.Quote(transMapVal2)), + map[string]string{ + transMapAttr: strconv.Quote(transMapVal2), + }, ), - util.GenerateMapAttr( + util.GenerateMapAttrWithMapProperties( "translation_map_defaults", - util.GenerateMapProperty(transMapAttr, strconv.Quote(transMapValDefault2)), + map[string]string{ + transMapAttr: strconv.Quote(transMapValDefault2), + }, ), ), ), diff --git a/genesyscloud/integration_credential/data_source_genesyscloud_integration_credential_test.go b/genesyscloud/integration_credential/data_source_genesyscloud_integration_credential_test.go index 4bf17ec65..a96945459 100644 --- a/genesyscloud/integration_credential/data_source_genesyscloud_integration_credential_test.go +++ b/genesyscloud/integration_credential/data_source_genesyscloud_integration_credential_test.go @@ -35,7 +35,9 @@ func TestAccDataSourceIntegrationCredential(t *testing.T) { strconv.Quote(credName1), strconv.Quote(typeName1), GenerateCredentialFields( - util.GenerateMapProperty(key1, strconv.Quote(val1)), + map[string]string{ + key1: strconv.Quote(val1), + }, ), ) + generateIntegrationCredentialDataSource(credResource2, credName1, diff --git a/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_test.go b/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_test.go index 60ceebd60..f401541ac 100644 --- a/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_test.go +++ b/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_test.go @@ -49,7 +49,9 @@ func TestAccResourceCredential(t *testing.T) { strconv.Quote(credName1), strconv.Quote(typeName1), GenerateCredentialFields( - util.GenerateMapProperty(key1, strconv.Quote(val1)), + map[string]string{ + key1: strconv.Quote(val1), + }, ), ), Check: resource.ComposeTestCheckFunc( @@ -65,7 +67,9 @@ func TestAccResourceCredential(t *testing.T) { strconv.Quote(credName2), strconv.Quote(typeName1), GenerateCredentialFields( - util.GenerateMapProperty(key1, strconv.Quote(val1_2)), + map[string]string{ + key1: strconv.Quote(val1_2), + }, ), ), Check: resource.ComposeTestCheckFunc( @@ -81,8 +85,10 @@ func TestAccResourceCredential(t *testing.T) { strconv.Quote(credName2), strconv.Quote(typeName1), GenerateCredentialFields( - util.GenerateMapProperty(key1, strconv.Quote(val1)), - util.GenerateMapProperty(key2, strconv.Quote(val2)), + map[string]string{ + key1: strconv.Quote(val1), + key2: strconv.Quote(val2), + }, ), ), Check: resource.ComposeTestCheckFunc( @@ -99,8 +105,10 @@ func TestAccResourceCredential(t *testing.T) { strconv.Quote(credName2), strconv.Quote(typeName1), GenerateCredentialFields( - util.GenerateMapProperty(key1, strconv.Quote(val1)), - util.GenerateMapProperty(key2, strconv.Quote(val2_2)), + map[string]string{ + key1: strconv.Quote(val1), + key2: strconv.Quote(val2_2), + }, ), ), Check: resource.ComposeTestCheckFunc( @@ -124,7 +132,9 @@ func TestAccResourceCredential(t *testing.T) { strconv.Quote(credName1), strconv.Quote(typeName2), GenerateCredentialFields( - util.GenerateMapProperty(key3, strconv.Quote(val3)), + map[string]string{ + key3: strconv.Quote(val3), + }, ), ), Check: resource.ComposeTestCheckFunc( @@ -140,7 +150,9 @@ func TestAccResourceCredential(t *testing.T) { strconv.Quote(credName2), strconv.Quote(typeName2), GenerateCredentialFields( - util.GenerateMapProperty(key3, strconv.Quote(val3)), + map[string]string{ + key3: strconv.Quote(val3), + }, ), ), Check: resource.ComposeTestCheckFunc( @@ -213,8 +225,10 @@ func TestAccGenesysCloudOAuthResourceCredentialWithSecret(t *testing.T) { strconv.Quote(credName), strconv.Quote(typeName), GenerateCredentialFields( - util.GenerateMapProperty("clientId", strconv.Quote(clientId)), - util.GenerateMapProperty("clientSecret", strconv.Quote(clientSecret)), + map[string]string{ + "clientId": strconv.Quote(clientId), + "clientSecret": strconv.Quote(clientSecret), + }, ), ), Check: resource.ComposeTestCheckFunc( diff --git a/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_utils.go b/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_utils.go index 83269582e..869ecf396 100644 --- a/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_utils.go +++ b/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_utils.go @@ -37,6 +37,6 @@ func GenerateCredentialResource(resourceID string, name string, credentialType s } // GenerateCredentialFields builds a terraform string for multiple credential fields -func GenerateCredentialFields(fields ...string) string { - return util.GenerateMapAttr("fields", fields...) +func GenerateCredentialFields(fields map[string]string) string { + return util.GenerateMapAttrWithMapProperties("fields", fields) } diff --git a/genesyscloud/integration_custom_auth_action/data_source_genesyscloud_integration_custom_auth_action_test.go b/genesyscloud/integration_custom_auth_action/data_source_genesyscloud_integration_custom_auth_action_test.go index c305ebb95..24c183ef2 100644 --- a/genesyscloud/integration_custom_auth_action/data_source_genesyscloud_integration_custom_auth_action_test.go +++ b/genesyscloud/integration_custom_auth_action/data_source_genesyscloud_integration_custom_auth_action_test.go @@ -31,7 +31,7 @@ func TestAccDataSourceIntegrationCustomAuthAction(t *testing.T) { strconv.Quote(credentialResourceName), strconv.Quote(customAuthCredentialType), integrationCred.GenerateCredentialFields( - util.GenerateMapProperty(credKey1, strconv.Quote(credVal1)), + map[string]string{credKey1: strconv.Quote(credVal1)}, ), ) diff --git a/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_test.go b/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_test.go index 3d5b7f4ee..3d2e51163 100644 --- a/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_test.go +++ b/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_test.go @@ -54,7 +54,9 @@ func TestAccResourceIntegrationCustomAuthAction(t *testing.T) { strconv.Quote(credentialResourceName), strconv.Quote(customAuthCredentialType), integrationCred.GenerateCredentialFields( - util.GenerateMapProperty(credKey1, strconv.Quote(credVal1)), + map[string]string{ + credKey1: strconv.Quote(credVal1), + }, ), ) diff --git a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist.go b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist.go index 6d95784e1..144afc54a 100644 --- a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist.go +++ b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist.go @@ -625,3 +625,13 @@ func GeneratePhoneColumnsDataTypeSpecBlock(columnName, columnDataType, min, max, } `, columnName, columnDataType, min, max, maxLength) } + +func GenerateEmailColumnsBlock(columnName, columnType, contactableTimeColumn string) string { + return fmt.Sprintf(` + email_columns { + column_name = "%s" + type = "%s" + contactable_time_column = %s + } +`, columnName, columnType, contactableTimeColumn) +} diff --git a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist_test.go b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist_test.go index a76f8bf68..fd80cce10 100644 --- a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist_test.go +++ b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist_test.go @@ -67,12 +67,12 @@ func TestAccResourceOutboundContactListBasic(t *testing.T) { "home", strconv.Quote("Home"), ), - generateEmailColumnsBlock( + GenerateEmailColumnsBlock( "Work", "work", util.NullValue, ), - generateEmailColumnsBlock( + GenerateEmailColumnsBlock( "Personal", "personal", util.NullValue, @@ -124,12 +124,12 @@ func TestAccResourceOutboundContactListBasic(t *testing.T) { "home", strconv.Quote("Home"), ), - generateEmailColumnsBlock( + GenerateEmailColumnsBlock( "Work", "work", util.NullValue, ), - generateEmailColumnsBlock( + GenerateEmailColumnsBlock( "Personal", "personal", util.NullValue, @@ -182,12 +182,12 @@ func TestAccResourceOutboundContactListBasic(t *testing.T) { "home", strconv.Quote("Home"), ), - generateEmailColumnsBlock( + GenerateEmailColumnsBlock( "Work", "work", util.NullValue, ), - generateEmailColumnsBlock( + GenerateEmailColumnsBlock( "Personal", "personal", util.NullValue, @@ -276,12 +276,12 @@ func TestAccResourceOutboundContactListBasic(t *testing.T) { "home", util.NullValue, ), - generateEmailColumnsBlock( + GenerateEmailColumnsBlock( "Work", "work", strconv.Quote(zipCodeColumnName), ), - generateEmailColumnsBlock( + GenerateEmailColumnsBlock( "Personal", "personal", strconv.Quote(zipCodeColumnName), @@ -342,16 +342,6 @@ func TestAccResourceOutboundContactListBasic(t *testing.T) { }) } -func generateEmailColumnsBlock(columnName, columnType, contactableTimeColumn string) string { - return fmt.Sprintf(` - email_columns { - column_name = "%s" - type = "%s" - contactable_time_column = %s - } -`, columnName, columnType, contactableTimeColumn) -} - func testVerifyContactListDestroyed(state *terraform.State) error { outboundAPI := platformclientv2.NewOutboundApi() for _, rs := range state.RootModule().Resources { diff --git a/genesyscloud/outbound_contact_list_contact/genesyscloud_outbound_contact_list_contact_init_test.go b/genesyscloud/outbound_contact_list_contact/genesyscloud_outbound_contact_list_contact_init_test.go new file mode 100644 index 000000000..e6c0f5694 --- /dev/null +++ b/genesyscloud/outbound_contact_list_contact/genesyscloud_outbound_contact_list_contact_init_test.go @@ -0,0 +1,42 @@ +package outbound_contact_list_contact + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "sync" + outboundContactList "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list" + "testing" +) + +// providerResources holds a map of all registered resources +var providerResources map[string]*schema.Resource + +type registerTestInstance struct { + resourceMapMutex sync.RWMutex +} + +// registerTestResources registers all resources used in the tests +func (r *registerTestInstance) registerTestResources() { + r.resourceMapMutex.Lock() + defer r.resourceMapMutex.Unlock() + + providerResources[resourceName] = ResourceOutboundContactListContact() + providerResources["genesyscloud_outbound_contact_list"] = outboundContactList.ResourceOutboundContactList() +} + +// initTestResources initializes all test resources. +func initTestResources() { + providerResources = make(map[string]*schema.Resource) + + regInstance := ®isterTestInstance{} + + regInstance.registerTestResources() +} + +// TestMain is a "setup" function called by the testing framework when run the test +func TestMain(m *testing.M) { + // Run setup function before starting the test suite for the outbound_contact_list_contact package + initTestResources() + + // Run the test suite for the outbound_contact_list_contact package + m.Run() +} diff --git a/genesyscloud/outbound_contact_list_contact/genesyscloud_outbound_contact_list_contact_proxy.go b/genesyscloud/outbound_contact_list_contact/genesyscloud_outbound_contact_list_contact_proxy.go new file mode 100644 index 000000000..021e5b804 --- /dev/null +++ b/genesyscloud/outbound_contact_list_contact/genesyscloud_outbound_contact_list_contact_proxy.go @@ -0,0 +1,179 @@ +package outbound_contact_list_contact + +import ( + "context" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" +) + +var internalProxy *contactProxy + +type createContactFunc func(ctx context.Context, p *contactProxy, contactListId string, contact platformclientv2.Writabledialercontact, priority, clearSystemData, doNotQueue bool) ([]platformclientv2.Dialercontact, *platformclientv2.APIResponse, error) +type readContactByIdFunc func(ctx context.Context, p *contactProxy, contactListId, contactId string) (*platformclientv2.Dialercontact, *platformclientv2.APIResponse, error) +type updateContactFunc func(ctx context.Context, p *contactProxy, contactListId string, contactId string, contact platformclientv2.Dialercontact) (*platformclientv2.Dialercontact, *platformclientv2.APIResponse, error) +type deleteContactFunc func(ctx context.Context, p *contactProxy, contactListId, contactId string) (*platformclientv2.APIResponse, error) +type getAllContactsFunc func(ctx context.Context, p *contactProxy) ([]platformclientv2.Dialercontact, *platformclientv2.APIResponse, error) + +type contactProxy struct { + clientConfig *platformclientv2.Configuration + outboundApi *platformclientv2.OutboundApi + createContactAttr createContactFunc + readContactByIdAttr readContactByIdFunc + updateContactAttr updateContactFunc + deleteContactAttr deleteContactFunc + getAllContactsAttr getAllContactsFunc + contactCache rc.CacheInterface[platformclientv2.Dialercontact] +} + +func newContactProxy(clientConfig *platformclientv2.Configuration) *contactProxy { + api := platformclientv2.NewOutboundApiWithConfig(clientConfig) + contactCache := rc.NewResourceCache[platformclientv2.Dialercontact]() + return &contactProxy{ + clientConfig: clientConfig, + outboundApi: api, + createContactAttr: createContactFn, + readContactByIdAttr: readContactByIdFn, + updateContactAttr: updateContactFn, + deleteContactAttr: deleteContactFn, + getAllContactsAttr: getAllContactsFn, + contactCache: contactCache, + } +} + +func getContactProxy(clientConfig *platformclientv2.Configuration) *contactProxy { + if internalProxy == nil { + internalProxy = newContactProxy(clientConfig) + } + + return internalProxy +} + +func (p *contactProxy) createContact(ctx context.Context, contactListId string, contact platformclientv2.Writabledialercontact, priority, clearSystemData, doNotQueue bool) ([]platformclientv2.Dialercontact, *platformclientv2.APIResponse, error) { + return p.createContactAttr(ctx, p, contactListId, contact, priority, clearSystemData, doNotQueue) +} + +func (p *contactProxy) readContactById(ctx context.Context, contactListId, contactId string) (*platformclientv2.Dialercontact, *platformclientv2.APIResponse, error) { + return p.readContactByIdAttr(ctx, p, contactListId, contactId) +} + +func (p *contactProxy) updateContact(ctx context.Context, contactListId, contactId string, contact platformclientv2.Dialercontact) (*platformclientv2.Dialercontact, *platformclientv2.APIResponse, error) { + return p.updateContactAttr(ctx, p, contactListId, contactId, contact) +} + +func (p *contactProxy) deleteContact(ctx context.Context, contactListId, contactId string) (*platformclientv2.APIResponse, error) { + return p.deleteContactAttr(ctx, p, contactListId, contactId) +} + +func (p *contactProxy) getAllContacts(ctx context.Context) ([]platformclientv2.Dialercontact, *platformclientv2.APIResponse, error) { + return p.getAllContactsAttr(ctx, p) +} + +func createContactFn(_ context.Context, p *contactProxy, contactListId string, contact platformclientv2.Writabledialercontact, priority, clearSystemData, doNotQueue bool) ([]platformclientv2.Dialercontact, *platformclientv2.APIResponse, error) { + return p.outboundApi.PostOutboundContactlistContacts(contactListId, []platformclientv2.Writabledialercontact{contact}, priority, clearSystemData, doNotQueue) +} + +func readContactByIdFn(_ context.Context, p *contactProxy, contactListId, contactId string) (*platformclientv2.Dialercontact, *platformclientv2.APIResponse, error) { + if contact := rc.GetCacheItem(p.contactCache, contactId); contact != nil { + return contact, nil, nil + } + return p.outboundApi.GetOutboundContactlistContact(contactListId, contactId) +} + +func updateContactFn(_ context.Context, p *contactProxy, contactListId, contactId string, contact platformclientv2.Dialercontact) (*platformclientv2.Dialercontact, *platformclientv2.APIResponse, error) { + return p.outboundApi.PutOutboundContactlistContact(contactListId, contactId, contact) +} + +func deleteContactFn(_ context.Context, p *contactProxy, contactListId, contactId string) (*platformclientv2.APIResponse, error) { + return p.outboundApi.DeleteOutboundContactlistContact(contactListId, contactId) +} + +func getAllContactsFn(ctx context.Context, p *contactProxy) ([]platformclientv2.Dialercontact, *platformclientv2.APIResponse, error) { + var allContacts []platformclientv2.Dialercontact + + contactListIds, resp, err := p.getAllContactListIds(ctx) + if err != nil { + return allContacts, resp, err + } + + for _, contactListId := range contactListIds { + contacts, resp, err := p.getContactsByContactListId(ctx, contactListId) + if err != nil { + return nil, resp, err + } + allContacts = append(allContacts, contacts...) + } + + for _, contact := range allContacts { + rc.SetCache(p.contactCache, *contact.Id, contact) + } + + return allContacts, nil, nil +} + +func (p *contactProxy) getContactsByContactListId(_ context.Context, contactListId string) ([]platformclientv2.Dialercontact, *platformclientv2.APIResponse, error) { + var ( + pageNum = 1 + pageSize = 50 + allContacts []platformclientv2.Dialercontact + ) + + body := platformclientv2.Contactlistingrequest{ + PageNumber: &pageNum, + PageSize: &pageSize, + } + + data, resp, err := p.outboundApi.PostOutboundContactlistContactsSearch(contactListId, body) + if err != nil { + return nil, resp, err + } + if data.Entities == nil || len(*data.Entities) == 0 { + return nil, nil, nil + } + allContacts = append(allContacts, *data.Entities...) + + for pageNum = 2; pageNum <= *data.PageCount; pageNum++ { + body.PageNumber = &pageNum + data, resp, err = p.outboundApi.PostOutboundContactlistContactsSearch(contactListId, body) + if err != nil { + return nil, resp, err + } + if data.Entities == nil || len(*data.Entities) == 0 { + break + } + allContacts = append(allContacts, *data.Entities...) + } + + return allContacts, nil, nil +} + +func (p *contactProxy) getAllContactListIds(_ context.Context) ([]string, *platformclientv2.APIResponse, error) { + const pageSize = 100 + var pageNum = 1 + var allContactListIds []string + + contactListConfigs, resp, getErr := p.outboundApi.GetOutboundContactlists(false, false, pageSize, pageNum, true, "", "", []string{}, []string{}, "", "") + if getErr != nil { + return nil, resp, getErr + } + if contactListConfigs.Entities == nil || len(*contactListConfigs.Entities) == 0 { + return nil, nil, nil + } + for _, cl := range *contactListConfigs.Entities { + allContactListIds = append(allContactListIds, *cl.Id) + } + + for pageNum := 2; pageNum <= *contactListConfigs.PageCount; pageNum++ { + contactListConfigs, resp, getErr := p.outboundApi.GetOutboundContactlists(false, false, pageSize, pageNum, true, "", "", []string{}, []string{}, "", "") + if getErr != nil { + return nil, resp, getErr + } + if contactListConfigs.Entities == nil || len(*contactListConfigs.Entities) == 0 { + break + } + for _, cl := range *contactListConfigs.Entities { + allContactListIds = append(allContactListIds, *cl.Id) + } + } + + return allContactListIds, nil, nil +} diff --git a/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact.go b/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact.go new file mode 100644 index 000000000..d8e4cdab6 --- /dev/null +++ b/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact.go @@ -0,0 +1,153 @@ +package outbound_contact_list_contact + +import ( + "context" + "fmt" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "log" + "terraform-provider-genesyscloud/genesyscloud/consistency_checker" + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + "terraform-provider-genesyscloud/genesyscloud/util" + "terraform-provider-genesyscloud/genesyscloud/util/constants" + "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + "time" +) + +func getAllContacts(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { + resources := make(resourceExporter.ResourceIDMetaMap) + cp := getContactProxy(clientConfig) + + contacts, resp, err := cp.getAllContacts(ctx) + if err != nil { + msg := fmt.Sprintf("Failed to read all contact list contacts. Error: %v", err) + if resp != nil { + return nil, util.BuildAPIDiagnosticError(resourceName, msg, resp) + } + return nil, util.BuildDiagnosticError(resourceName, msg, err) + } + + for _, contact := range contacts { + //id := createCustomContactId(*contact.ContactListId, *contact.Id) + resources[*contact.Id] = &resourceExporter.ResourceMeta{Name: *contact.Id} + } + + return resources, nil +} + +func createOutboundContactListContact(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + cp := getContactProxy(sdkConfig) + + contactListId := d.Get("contact_list_id").(string) + priority := d.Get("priority").(bool) + clearSystemData := d.Get("clear_system_data").(bool) + doNotQueue := d.Get("do_not_queue").(bool) + + contactRequestBody := buildWritableContactFromResourceData(d) + + log.Printf("Creating contact in contact list '%s'", contactListId) + contactResponseBody, resp, err := cp.createContact(ctx, contactListId, contactRequestBody, priority, clearSystemData, doNotQueue) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("failed to create contact '%s' for contact list '%s': %v", *contactRequestBody.Id, contactListId, err), resp) + } + + if len(contactResponseBody) != 1 { + msg := fmt.Sprintf("expected to receive one dialer contact object in contact creation response. Received %v", len(contactResponseBody)) + return util.BuildDiagnosticError(resourceName, msg, fmt.Errorf("%v", msg)) + } + + d.SetId(*contactResponseBody[0].Id) + log.Printf("Finished creating contact '%s' in contact list '%s'", d.Id(), contactListId) + return readOutboundContactListContact(ctx, d, meta) +} + +func readOutboundContactListContact(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics { + var ( + resp *platformclientv2.APIResponse + err error + + sdkConfig = meta.(*provider.ProviderMeta).ClientConfig + cp = getContactProxy(sdkConfig) + + contactListId = d.Get("contact_list_id").(string) + ) + + cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceOutboundContactListContact(), constants.DefaultConsistencyChecks, resourceName) + + retryErr := util.WithRetriesForRead(ctx, d, func() *retry.RetryError { + var contactResponseBody *platformclientv2.Dialercontact + + log.Printf("Reading contact '%s' in contact list '%s'", d.Id(), contactListId) + contactResponseBody, resp, err = cp.readContactById(ctx, contactListId, d.Id()) + if err != nil { + if util.IsStatus404(resp) { + return retry.RetryableError(err) + } + return retry.NonRetryableError(err) + } + + _ = d.Set("contact_list_id", *contactResponseBody.ContactListId) + resourcedata.SetNillableValue(d, "callable", contactResponseBody.Callable) + resourcedata.SetNillableValue(d, "data", contactResponseBody.Data) + resourcedata.SetNillableValueWithSchemaSetWithFunc(d, "phone_number_status", contactResponseBody.PhoneNumberStatus, flattenPhoneNumberStatus) + resourcedata.SetNillableValueWithSchemaSetWithFunc(d, "contactable_status", contactResponseBody.ContactableStatus, flattenContactableStatus) + + return cc.CheckState(d) + }) + if retryErr != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("failed to read contact by ID '%s' from contact list '%s'. Error: %v", d.Id(), contactListId, retryErr), resp) + } + log.Printf("Done reading contact '%s' in contact list '%s'", d.Id(), contactListId) + return nil +} + +func updateOutboundContactListContact(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + cp := getContactProxy(sdkConfig) + + contactRequestBody := buildDialerContactFromResourceData(d) + contactListId := *contactRequestBody.ContactListId + + log.Printf("Updating contact '%s' in contact list '%s'", d.Id(), contactListId) + _, resp, err := cp.updateContact(ctx, contactListId, d.Id(), contactRequestBody) + if err != nil { + msg := fmt.Sprintf("failed to update contact '%s' for contact list '%s'. Error: %v", d.Id(), contactListId, err) + return util.BuildAPIDiagnosticError(resourceName, msg, resp) + } + + log.Printf("Finished updating contact '%s' in contact list '%s'", d.Id(), contactListId) + return readOutboundContactListContact(ctx, d, meta) +} + +func deleteOutboundContactListContact(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + cp := getContactProxy(sdkConfig) + + contactListId := d.Get("contact_list_id").(string) + + log.Printf("Deleting contact '%s' from contact list '%s'", d.Id(), contactListId) + resp, err := cp.deleteContact(ctx, contactListId, d.Id()) + if err != nil { + msg := fmt.Sprintf("failed to delete contact '%s' from contact list '%s'. Error: %v", d.Id(), contactListId, err) + return util.BuildAPIDiagnosticError(resourceName, msg, resp) + } + + return util.WithRetries(ctx, 60*time.Second, func() *retry.RetryError { + log.Printf("Reading contact '%s'", d.Id()) + _, resp, err := cp.readContactById(ctx, contactListId, d.Id()) + if err != nil { + if util.IsStatus404(resp) { + log.Printf("Contact '%s' deleted", d.Id()) + return nil + } + msg := fmt.Sprintf("failed to delete contact '%s'. Error: %v", d.Id(), err) + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, msg, resp)) + } + msg := fmt.Sprintf("contact '%s' still exists in contact list '%s'", d.Id(), contactListId) + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, msg, resp)) + }) +} diff --git a/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_schema.go b/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_schema.go new file mode 100644 index 000000000..445f32893 --- /dev/null +++ b/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_schema.go @@ -0,0 +1,147 @@ +package outbound_contact_list_contact + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" +) + +const resourceName = "genesyscloud_outbound_contact_list_contact" + +func SetRegistrar(regInstance registrar.Registrar) { + regInstance.RegisterResource(resourceName, ResourceOutboundContactListContact()) + regInstance.RegisterExporter(resourceName, ContactExporter()) +} + +var ( + contactableStatusResource = &schema.Resource{ + Schema: map[string]*schema.Schema{ + "media_type": { + Description: `The key which identifies the media type (Voice, SMS and Email).`, + Type: schema.TypeString, + Required: true, + }, + "contactable": { + Description: `Indicates whether or not the entire contact is contactable for the associated media type.`, + Type: schema.TypeBool, + Required: true, + }, + "column_status": { + Description: `A map of individual contact method columns to whether the individual column is contactable for the associated media type.`, + Type: schema.TypeSet, + Optional: true, + Elem: columnStatusResource, + }, + }, + } + columnStatusResource = &schema.Resource{ + Schema: map[string]*schema.Schema{ + "column": { + Description: `The key which identifies the contact method column.`, + Type: schema.TypeString, + Required: true, + }, + "contactable": { + Description: `Indicates whether or not an individual contact method column is contactable.`, + Type: schema.TypeBool, + Required: true, + }, + }, + } + phoneNumberStatusResource = &schema.Resource{ + Schema: map[string]*schema.Schema{ + "key": { + Description: `Phone number column identifier.`, + Type: schema.TypeString, + Required: true, + }, + "callable": { + Description: `Indicates whether or not a phone number is callable.`, + Type: schema.TypeBool, + Required: true, + }, + }, + } +) + +func ContactExporter() *resourceExporter.ResourceExporter { + return &resourceExporter.ResourceExporter{ + GetResourcesFunc: provider.GetAllWithPooledClient(getAllContacts), + RefAttrs: map[string]*resourceExporter.RefAttrSettings{ + "contact_list_id": {RefType: "genesyscloud_outbound_contact_list"}, + }, + AllowZeroValuesInMap: []string{"data"}, + } +} + +func ResourceOutboundContactListContact() *schema.Resource { + return &schema.Resource{ + Description: `Genesys Cloud Outbound Contact List Contact`, + + CreateContext: provider.CreateWithPooledClient(createOutboundContactListContact), + ReadContext: provider.ReadWithPooledClient(readOutboundContactListContact), + UpdateContext: provider.UpdateWithPooledClient(updateOutboundContactListContact), + DeleteContext: provider.DeleteWithPooledClient(deleteOutboundContactListContact), + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + SchemaVersion: 1, + Schema: map[string]*schema.Schema{ + "contact_list_id": { + Description: `The identifier of the contact list containing this contact.`, + ForceNew: true, + Required: true, + Type: schema.TypeString, + }, + "priority": { + Description: `Contact priority. True means the contact(s) will be dialed next; false means the contact will go to the end of the contact queue. +Only applicable on the creation of a contact, so updating this field will force the contact to be deleted from the contact list and re-uploaded.`, + ForceNew: true, + Optional: true, + Type: schema.TypeBool, + }, + "clear_system_data": { + Description: `Clear system data. True means the system columns (attempts, callable status, etc) stored on the contact will be cleared if the contact already exists; false means they won't. +Only applicable on the creation of a contact, so updating this field will force the contact to be deleted from the contact list and re-uploaded.`, + ForceNew: true, + Optional: true, + Type: schema.TypeBool, + }, + "do_not_queue": { + Description: `Do not queue. True means that updated contacts will not have their positions in the queue altered, so contacts that have already been dialed will not be redialed. +For new contacts, this parameter has no effect; False means that updated contacts will be re-queued, according to the 'priority' parameter. +Only applicable on the creation of a contact, so updating this field will force the contact to be deleted from the contact list and re-uploaded.`, + ForceNew: true, + Optional: true, + Type: schema.TypeBool, + }, + "callable": { + Description: `Indicates whether or not the contact can be called.`, + Type: schema.TypeBool, + Default: false, + Optional: true, + }, + "data": { + Description: `An ordered map of the contact's columns and corresponding values.`, + Type: schema.TypeMap, + Required: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "phone_number_status": { + Description: `A map of phone number columns to PhoneNumberStatuses, which indicate if the phone number is callable or not.`, + Type: schema.TypeSet, + Optional: true, + ForceNew: true, + Elem: phoneNumberStatusResource, + }, + "contactable_status": { + Description: `A map of media types (Voice, SMS and Email) to ContactableStatus, which indicates if the contact can be contacted using the specified media type.`, + Type: schema.TypeSet, + Optional: true, + ForceNew: true, + Elem: contactableStatusResource, + }, + }, + } +} diff --git a/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_test.go b/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_test.go new file mode 100644 index 000000000..4a923fc7c --- /dev/null +++ b/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_test.go @@ -0,0 +1,176 @@ +package outbound_contact_list_contact + +import ( + "fmt" + "github.com/google/uuid" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "strconv" + outboundContactList "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list" + "terraform-provider-genesyscloud/genesyscloud/provider" + "terraform-provider-genesyscloud/genesyscloud/util" + "testing" +) + +func TestAccResourceOutboundContactListContact(t *testing.T) { + var ( + resourceId = "contact" + fullResourceId = fmt.Sprintf("%s.%s", resourceName, resourceId) + + cellColumnKey = "Cell" + dataCellValue = "+000000" + dataCellValueUpdated = "+111111" + + homeColumnKey = "Home" + dataHomeValue = "+22222222" + dataHomeValueUpdated = "+33333333" + + emailColumnKey = "Email" + dataEmailValue = "email@fake.com" + dataEmailValueUpdated = "fake@email.cmo" + + contactListResourceId = "contact_list" + contactListFullResourceId = "genesyscloud_outbound_contact_list." + contactListResourceId + contactListName = "tf test contact list " + uuid.NewString() + columnNames = []string{ + strconv.Quote(cellColumnKey), + strconv.Quote(homeColumnKey), + strconv.Quote(emailColumnKey), + } + ) + + const ( + emailMediaType = "Email" + voiceMediaType = "Voice" + ) + + contactListResource := outboundContactList.GenerateOutboundContactList( + contactListResourceId, + contactListName, + util.NullValue, + strconv.Quote(cellColumnKey), + []string{strconv.Quote(cellColumnKey)}, + columnNames, + util.FalseValue, + util.NullValue, + util.NullValue, + outboundContactList.GenerateEmailColumnsBlock( + emailColumnKey, + "work", + util.NullValue, + ), + outboundContactList.GeneratePhoneColumnsBlock( + cellColumnKey, + "cell", + strconv.Quote(cellColumnKey), + ), + outboundContactList.GeneratePhoneColumnsBlock( + homeColumnKey, + "home", + strconv.Quote(cellColumnKey), + ), + ) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { util.TestAccPreCheck(t) }, + ProviderFactories: provider.GetProviderFactories(providerResources, nil), + Steps: []resource.TestStep{ + { + Config: contactListResource + GenerateOutboundContactListContact( + resourceId, + contactListFullResourceId+".id", + util.TrueValue, + util.GenerateMapAttrWithMapProperties( + "data", + map[string]string{ + cellColumnKey: strconv.Quote(dataCellValue), + homeColumnKey: strconv.Quote(dataHomeValue), + emailColumnKey: strconv.Quote(dataEmailValue), + }, + ), + GeneratePhoneNumberStatus(cellColumnKey, util.FalseValue), + GeneratePhoneNumberStatus(homeColumnKey, util.TrueValue), + GenerateContactableStatus( + voiceMediaType, + util.FalseValue, // contactable + GenerateColumnStatus(cellColumnKey, util.FalseValue), + ), + GenerateContactableStatus( + emailMediaType, + util.TrueValue, // contactable + GenerateColumnStatus(emailColumnKey, util.TrueValue), + ), + ), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(fullResourceId, "callable", util.TrueValue), + resource.TestCheckResourceAttrPair(fullResourceId, "contact_list_id", contactListFullResourceId, "id"), + resource.TestCheckResourceAttr(fullResourceId, "data."+cellColumnKey, dataCellValue), + resource.TestCheckResourceAttr(fullResourceId, "data."+homeColumnKey, dataHomeValue), + resource.TestCheckResourceAttr(fullResourceId, "data."+emailColumnKey, dataEmailValue), + resource.TestCheckResourceAttr(fullResourceId, "phone_number_status.#", "2"), + resource.TestCheckResourceAttr(fullResourceId, "phone_number_status.0.key", cellColumnKey), + resource.TestCheckResourceAttr(fullResourceId, "phone_number_status.0.callable", util.FalseValue), + resource.TestCheckResourceAttr(fullResourceId, "phone_number_status.1.key", homeColumnKey), + resource.TestCheckResourceAttr(fullResourceId, "phone_number_status.1.callable", util.TrueValue), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.#", "2"), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.0.media_type", voiceMediaType), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.0.contactable", util.FalseValue), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.0.column_status.0.column", cellColumnKey), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.0.column_status.0.contactable", util.FalseValue), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.1.media_type", emailMediaType), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.1.contactable", util.TrueValue), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.1.column_status.0.column", emailColumnKey), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.1.column_status.0.contactable", util.TrueValue), + ), + }, + { + // Update + Config: contactListResource + GenerateOutboundContactListContact( + resourceId, + contactListFullResourceId+".id", + util.FalseValue, + util.GenerateMapAttrWithMapProperties( + "data", + map[string]string{ + cellColumnKey: strconv.Quote(dataCellValueUpdated), + homeColumnKey: strconv.Quote(dataHomeValueUpdated), + emailColumnKey: strconv.Quote(dataEmailValueUpdated), + }, + ), + GeneratePhoneNumberStatus(cellColumnKey, util.FalseValue), + GeneratePhoneNumberStatus(homeColumnKey, util.TrueValue), + GenerateContactableStatus( + voiceMediaType, + util.FalseValue, // contactable + GenerateColumnStatus(cellColumnKey, util.FalseValue), + ), + GenerateContactableStatus( + emailMediaType, + util.TrueValue, // contactable + GenerateColumnStatus(emailColumnKey, util.TrueValue), + ), + ), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(fullResourceId, "callable", util.FalseValue), + resource.TestCheckResourceAttrPair(fullResourceId, "contact_list_id", contactListFullResourceId, "id"), + resource.TestCheckResourceAttr(fullResourceId, "data."+cellColumnKey, dataCellValueUpdated), + resource.TestCheckResourceAttr(fullResourceId, "data."+homeColumnKey, dataHomeValueUpdated), + resource.TestCheckResourceAttr(fullResourceId, "data."+emailColumnKey, dataEmailValueUpdated), + resource.TestCheckResourceAttr(fullResourceId, "phone_number_status.#", "2"), + resource.TestCheckResourceAttr(fullResourceId, "phone_number_status.0.key", cellColumnKey), + resource.TestCheckResourceAttr(fullResourceId, "phone_number_status.0.callable", util.FalseValue), + resource.TestCheckResourceAttr(fullResourceId, "phone_number_status.1.key", homeColumnKey), + resource.TestCheckResourceAttr(fullResourceId, "phone_number_status.1.callable", util.TrueValue), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.#", "2"), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.0.media_type", voiceMediaType), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.0.contactable", util.FalseValue), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.0.column_status.0.column", cellColumnKey), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.0.column_status.0.contactable", util.FalseValue), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.1.media_type", emailMediaType), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.1.contactable", util.TrueValue), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.1.column_status.0.column", emailColumnKey), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.1.column_status.0.contactable", util.TrueValue), + ), + }, + }, + }) +} diff --git a/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_utils.go b/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_utils.go new file mode 100644 index 000000000..797624746 --- /dev/null +++ b/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_utils.go @@ -0,0 +1,182 @@ +package outbound_contact_list_contact + +import ( + "fmt" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "strings" + utillists "terraform-provider-genesyscloud/genesyscloud/util/lists" + "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" +) + +// buildWritableContactFromResourceData used to build the request body for contact creation +func buildWritableContactFromResourceData(d *schema.ResourceData) platformclientv2.Writabledialercontact { + contactListId := d.Get("contact_list_id").(string) + callable := d.Get("callable").(bool) + + var contactRequest = platformclientv2.Writabledialercontact{ + ContactListId: &contactListId, + Callable: &callable, + } + + if dataMap, ok := d.Get("data").(map[string]any); ok { + stringMap := utillists.ConvertMapStringAnyToMapStringString(dataMap) + contactRequest.Data = &stringMap + } + + contactRequest.PhoneNumberStatus = buildPhoneNumberStatus(d) + contactRequest.ContactableStatus = buildContactableStatus(d) + return contactRequest +} + +// buildDialerContactFromResourceData used to build the request body for contact updates +func buildDialerContactFromResourceData(d *schema.ResourceData) platformclientv2.Dialercontact { + contactListId := d.Get("contact_list_id").(string) + callable := d.Get("callable").(bool) + var contactRequest = platformclientv2.Dialercontact{ + ContactListId: &contactListId, + Callable: &callable, + } + if dataMap, ok := d.Get("data").(map[string]any); ok { + stringMap := utillists.ConvertMapStringAnyToMapStringString(dataMap) + contactRequest.Data = &stringMap + } + contactRequest.PhoneNumberStatus = buildPhoneNumberStatus(d) + contactRequest.ContactableStatus = buildContactableStatus(d) + return contactRequest +} + +func buildContactableStatus(d *schema.ResourceData) *map[string]platformclientv2.Contactablestatus { + contactableStatus, ok := d.Get("contactable_status").(*schema.Set) + if !ok { + return nil + } + + contactableStatusMap := make(map[string]platformclientv2.Contactablestatus) + + contactableStatusList := contactableStatus.List() + for _, status := range contactableStatusList { + currentStatusMap := status.(map[string]any) + mediaType := currentStatusMap["media_type"].(string) + contactable := currentStatusMap["contactable"].(bool) + + columnStatusMap := make(map[string]platformclientv2.Columnstatus) + if columnStatus, ok := currentStatusMap["column_status"].(*schema.Set); ok { + columnStatusList := columnStatus.List() + for _, status := range columnStatusList { + currentColumnStatusMap := status.(map[string]any) + column := currentColumnStatusMap["column"].(string) + columnContactable := currentColumnStatusMap["contactable"].(bool) + columnStatusMap[column] = platformclientv2.Columnstatus{ + Contactable: &columnContactable, + } + } + } + contactableStatusMap[mediaType] = platformclientv2.Contactablestatus{ + Contactable: &contactable, + ColumnStatus: &columnStatusMap, + } + } + + return &contactableStatusMap +} + +func buildPhoneNumberStatus(d *schema.ResourceData) *map[string]platformclientv2.Phonenumberstatus { + phoneNumberStatus, ok := d.Get("phone_number_status").(*schema.Set) + if !ok { + return nil + } + + phoneNumberStatusMap := make(map[string]platformclientv2.Phonenumberstatus) + + phoneNumberStatusList := phoneNumberStatus.List() + for _, status := range phoneNumberStatusList { + statusMap := status.(map[string]any) + key := statusMap["key"].(string) + callable, _ := statusMap["callable"].(bool) + phoneNumberStatusMap[key] = platformclientv2.Phonenumberstatus{ + Callable: &callable, + } + } + + return &phoneNumberStatusMap +} + +func flattenPhoneNumberStatus(phoneNumberStatus *map[string]platformclientv2.Phonenumberstatus) *schema.Set { + pnsSet := schema.NewSet(schema.HashResource(phoneNumberStatusResource), []interface{}{}) + for k, v := range *phoneNumberStatus { + pns := make(map[string]any) + pns["key"] = k + resourcedata.SetMapValueIfNotNil(pns, "callable", v.Callable) + pnsSet.Add(pns) + } + return pnsSet +} + +func flattenContactableStatus(contactableStatus *map[string]platformclientv2.Contactablestatus) *schema.Set { + csSet := schema.NewSet(schema.HashResource(contactableStatusResource), []interface{}{}) + for k, v := range *contactableStatus { + cs := make(map[string]any) + cs["media_type"] = k + cs["contactable"] = *v.Contactable + if v.ColumnStatus != nil { + cs["column_status"] = flattenColumnStatus(v.ColumnStatus) + } + csSet.Add(cs) + } + return csSet +} + +func flattenColumnStatus(columnStatus *map[string]platformclientv2.Columnstatus) *schema.Set { + if columnStatus == nil { + return nil + } + csSet := schema.NewSet(schema.HashResource(columnStatusResource), []interface{}{}) + for k, v := range *columnStatus { + cs := make(map[string]any) + cs["column"] = k + cs["contactable"] = *v.Contactable + csSet.Add(cs) + } + return csSet +} + +func GenerateOutboundContactListContact( + resourceId, + contactListId, + callable, + data string, + nestedBlocks ...string, +) string { + return fmt.Sprintf(`resource "%s" "%s" { + contact_list_id = %s + callable = %s + %s + %s +}`, resourceName, resourceId, contactListId, callable, data, strings.Join(nestedBlocks, "\n")) +} + +func GeneratePhoneNumberStatus(key, callable string) string { + return fmt.Sprintf(` + phone_number_status { + key = "%s" + callable = %s + }`, key, callable) +} + +func GenerateContactableStatus(mediaType, contactable string, nestedBlocks ...string) string { + return fmt.Sprintf(` + contactable_status { + media_type = "%s" + contactable = %s + %s + }`, mediaType, contactable, strings.Join(nestedBlocks, "\n")) +} + +func GenerateColumnStatus(column, contactable string) string { + return fmt.Sprintf(` + column_status { + column = "%s" + contactable = %s + }`, column, contactable) +} diff --git a/genesyscloud/resource_exporter/resource_exporter.go b/genesyscloud/resource_exporter/resource_exporter.go index cccb3c43e..81d28fbd1 100644 --- a/genesyscloud/resource_exporter/resource_exporter.go +++ b/genesyscloud/resource_exporter/resource_exporter.go @@ -103,6 +103,10 @@ type ResourceExporter struct { // By default zero values are removed from the config due to lack of "null" support in the plugin SDK AllowZeroValues []string + // AllowZeroValuesInMap is a list of attributes that are maps. Adding a map attribute to this list indicates to + // the exporter that the values within said map should not be cleaned up if they are zero values + AllowZeroValuesInMap []string + // AllowEmptyArrays is a list of List attributes that should allow empty arrays in export. // By default, empty arrays are removed but some array attributes may be required in the schema // or depending on the API behavior better presented explicitly in the API as empty arrays. @@ -195,6 +199,10 @@ func (r *ResourceExporter) AllowForZeroValues(attribute string) bool { return lists.ItemInSlice(attribute, r.AllowZeroValues) } +func (r *ResourceExporter) AllowForZeroValuesInMap(attribute string) bool { + return lists.ItemInSlice(attribute, r.AllowZeroValuesInMap) +} + func (r *ResourceExporter) AllowForEmptyArrays(attribute string) bool { return lists.ItemInSlice(attribute, r.AllowEmptyArrays) } diff --git a/genesyscloud/tfexporter/genesyscloud_resource_exporter.go b/genesyscloud/tfexporter/genesyscloud_resource_exporter.go index 9ada32053..a45475930 100644 --- a/genesyscloud/tfexporter/genesyscloud_resource_exporter.go +++ b/genesyscloud/tfexporter/genesyscloud_resource_exporter.go @@ -33,7 +33,7 @@ import ( ) /* - This file contains all of the logic associated wite the process of exporting a file. + This file contains all logic associated with the process of exporting a file. */ // Used to store the TF config block as a string so that it can be ignored when testing the exported HCL config file. @@ -178,7 +178,7 @@ func (g *GenesysCloudResourceExporter) Export() (diagErr diag.Diagnostics) { if diagErr != nil { return diagErr } - // Step #2 Retrieve all of the individual resources we are going to export + // Step #2 Retrieve all the individual resources we are going to export diagErr = g.retrieveSanitizedResourceMaps() if diagErr != nil { return diagErr @@ -1138,7 +1138,7 @@ func (g *GenesysCloudResourceExporter) sanitizeConfigMap( resourceName string, configMap map[string]interface{}, prevAttr string, - exporters map[string]*resourceExporter.ResourceExporter, //Map of all of the exporters + exporters map[string]*resourceExporter.ResourceExporter, //Map of all exporters exportingState bool, exportingAsHCL bool, parentKey bool) ([]unresolvableAttributeInfo, bool) { @@ -1258,7 +1258,7 @@ func (g *GenesysCloudResourceExporter) sanitizeConfigMap( // This can cause invalid config files due to including attributes with limits that don't allow for zero values, so we remove // those attributes from the config by default. Attributes can opt-out of this behavior by being added to a ResourceExporter's // AllowZeroValues list. - if !exporter.AllowForZeroValues(currAttr) { + if !exporter.AllowForZeroValues(currAttr) && !exporter.AllowForZeroValuesInMap(prevAttr) { removeZeroValues(key, configMap[key], configMap) } diff --git a/genesyscloud/tfexporter/tf_exporter_resource_test.go b/genesyscloud/tfexporter/tf_exporter_resource_test.go index 3ea8cfa57..3af7a26ad 100644 --- a/genesyscloud/tfexporter/tf_exporter_resource_test.go +++ b/genesyscloud/tfexporter/tf_exporter_resource_test.go @@ -7,6 +7,7 @@ import ( emergencyGroup "terraform-provider-genesyscloud/genesyscloud/architect_emergencygroup" flow "terraform-provider-genesyscloud/genesyscloud/architect_flow" flowLogLevel "terraform-provider-genesyscloud/genesyscloud/flow_loglevel" + outboundContactListContact "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list_contact" outboundRoute "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site_outbound_route" grammar "terraform-provider-genesyscloud/genesyscloud/architect_grammar" @@ -175,6 +176,7 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_outbound_callabletimeset"] = obCallableTimeset.ResourceOutboundCallabletimeset() providerResources["genesyscloud_outbound_campaign"] = obCampaign.ResourceOutboundCampaign() providerResources["genesyscloud_outbound_contact_list"] = outboundContactList.ResourceOutboundContactList() + providerResources["genesyscloud_outbound_contact_list_contact"] = outboundContactListContact.ResourceOutboundContactListContact() providerResources["genesyscloud_outbound_contactlistfilter"] = obContactListFilter.ResourceOutboundContactlistfilter() providerResources["genesyscloud_outbound_messagingcampaign"] = ob.ResourceOutboundMessagingCampaign() providerResources["genesyscloud_outbound_sequence"] = obSequence.ResourceOutboundSequence() @@ -240,6 +242,8 @@ func (r *registerTestInstance) registerTestExporters() { RegisterExporter("genesyscloud_outbound_callabletimeset", obCallableTimeset.OutboundCallableTimesetExporter()) RegisterExporter("genesyscloud_outbound_campaign", obCampaign.OutboundCampaignExporter()) RegisterExporter("genesyscloud_outbound_contact_list", outboundContactList.OutboundContactListExporter()) + RegisterExporter("genesyscloud_outbound_contact_list_contact", outboundContactListContact.ContactExporter()) + RegisterExporter("genesyscloud_outbound_contactlistfilter", obContactListFilter.OutboundContactlistfilterExporter()) RegisterExporter("genesyscloud_outbound_messagingcampaign", ob.OutboundMessagingcampaignExporter()) RegisterExporter("genesyscloud_outbound_sequence", obSequence.OutboundSequenceExporter()) diff --git a/genesyscloud/util/lists/util_lists.go b/genesyscloud/util/lists/util_lists.go index 58c13fdce..916c9b0fe 100644 --- a/genesyscloud/util/lists/util_lists.go +++ b/genesyscloud/util/lists/util_lists.go @@ -171,3 +171,15 @@ func Remove[T comparable](s []T, r T) []T { } return s } + +// ConvertMapStringAnyToMapStringString converts a map of type map[string]any to type map[string]string +func ConvertMapStringAnyToMapStringString(m map[string]any) map[string]string { + if m == nil { + return nil + } + sm := make(map[string]string) + for k, v := range m { + sm[k] = v.(string) + } + return sm +} diff --git a/genesyscloud/util/resourcedata/resourcedata.go b/genesyscloud/util/resourcedata/resourcedata.go index f4d2c21c6..066abcfc9 100644 --- a/genesyscloud/util/resourcedata/resourcedata.go +++ b/genesyscloud/util/resourcedata/resourcedata.go @@ -141,9 +141,9 @@ func SetNillableReferenceDivision(d *schema.ResourceData, key string, value *pla // SetNillableValue will read a basic type and set it on the schema func SetNillableValue[T any](d *schema.ResourceData, key string, value *T) { if value != nil { - d.Set(key, *value) + _ = d.Set(key, *value) } else { - d.Set(key, nil) + _ = d.Set(key, nil) } } diff --git a/genesyscloud/util/test_utils.go b/genesyscloud/util/test_utils.go index ff2e31a2c..a232e5ce0 100644 --- a/genesyscloud/util/test_utils.go +++ b/genesyscloud/util/test_utils.go @@ -308,8 +308,7 @@ func GenerateMapProperty(propName string, propValue string) string { func GenerateMapAttr(name string, properties ...string) string { return fmt.Sprintf(`%s = { %s - } - `, name, strings.Join(properties, "\n")) + }`, name, strings.Join(properties, "\n")) } func GenerateMapAttrWithMapProperties(name string, properties map[string]string) string { diff --git a/go.sum b/go.sum index 7081a70b2..d0049284f 100644 --- a/go.sum +++ b/go.sum @@ -257,8 +257,6 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mypurecloud/platform-client-sdk-go/v131 v130.0.0 h1:D6UheKy0j2dFMYMomhx/Qe7IMXeu6fkrUCKUBX11acw= -github.com/mypurecloud/platform-client-sdk-go/v131 v130.0.0/go.mod h1:iDiiCTL8WLcSaLb1W3Qpmj4fGU0kCATO7nvg7098veQ= github.com/mypurecloud/platform-client-sdk-go/v131 v131.0.0 h1:2YkBK/2pSoaehuSTqhFDXb806nxmHIrz7RxKsQSqM/0= github.com/mypurecloud/platform-client-sdk-go/v131 v131.0.0/go.mod h1:pWn1ub6TxkdOiI1mgZED+fICo/JiqujY4h+wfgYbOi4= github.com/nyaruka/phonenumbers v1.3.6 h1:33owXWp4d1U+Tyaj9fpci6PbvaQZcXBUO2FybeKeLwQ= diff --git a/main.go b/main.go index 76ffaac7a..af2bd8dc4 100644 --- a/main.go +++ b/main.go @@ -42,6 +42,7 @@ import ( obCampaign "terraform-provider-genesyscloud/genesyscloud/outbound_campaign" obCampaignRule "terraform-provider-genesyscloud/genesyscloud/outbound_campaignrule" obContactList "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list" + outboundContactListContact "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list_contact" obContactListFilter "terraform-provider-genesyscloud/genesyscloud/outbound_contactlistfilter" obDncList "terraform-provider-genesyscloud/genesyscloud/outbound_dnclist" obfst "terraform-provider-genesyscloud/genesyscloud/outbound_filespecificationtemplate" @@ -222,6 +223,7 @@ func registerResources() { routingQueue.SetRegistrar(regInstance) //Registering routing queue routingQueueConditionalGroupRouting.SetRegistrar(regInstance) //Registering routing queue conditional group routing routingQueueOutboundEmailAddress.SetRegistrar(regInstance) //Registering routing queue outbound email address + outboundContactListContact.SetRegistrar(regInstance) //Registering outbound contact list contact journeyViews.SetRegistrar(regInstance) //Registering journey views // setting resources for Use cases like TF export where provider is used in resource classes. From dad02e42812b88a4c211e5919fdb9e4d04c82bd7 Mon Sep 17 00:00:00 2001 From: Brian Goad Date: Tue, 18 Jun 2024 13:42:02 -0400 Subject: [PATCH 15/62] DEVTOOLING-643 : Adds support for using sanitized names in export. (#1106) * Adds support for using sanitized names in export. This allows you to copy the names from the results of an export and reuse them as include/exclude filters in a new export * Fix Typo * Fix quotes --- genesyscloud/tfexporter/export_common.go | 21 ++- .../genesyscloud_resource_exporter.go | 4 +- .../resource_genesyscloud_tf_export_test.go | 131 +++++++++++++++++- 3 files changed, 151 insertions(+), 5 deletions(-) diff --git a/genesyscloud/tfexporter/export_common.go b/genesyscloud/tfexporter/export_common.go index 91fffdc7e..3743ab1a5 100644 --- a/genesyscloud/tfexporter/export_common.go +++ b/genesyscloud/tfexporter/export_common.go @@ -129,13 +129,22 @@ func IncludeFilterResourceByRegex(result resourceExporter.ResourceIDMetaMap, nam return result } + sanitizer := resourceExporter.NewSanitizerProvider() + for _, pattern := range newFilters { for k := range result { match, _ := regexp.MatchString(pattern, result[k].Name) + // If name matches original name if match { newResourceMap[k] = result[k] } + + // If name matches sanitized name + sanitizedMatch, _ := regexp.MatchString(pattern, sanitizer.S.SanitizeResourceName(result[k].Name)) + if sanitizedMatch { + newResourceMap[k] = result[k] + } } } @@ -157,10 +166,12 @@ func ExcludeFilterResourceByRegex(result resourceExporter.ResourceIDMetaMap, nam } newResourceMap := make(resourceExporter.ResourceIDMetaMap) + sanitizer := resourceExporter.NewSanitizerProvider() for k := range result { for _, pattern := range newFilters { + // If name matches original name match, _ := regexp.MatchString(pattern, result[k].Name) if !match { newResourceMap[k] = result[k] @@ -168,8 +179,16 @@ func ExcludeFilterResourceByRegex(result resourceExporter.ResourceIDMetaMap, nam delete(newResourceMap, k) break } - } + // If name matches sanitized name + sanitizedMatch, _ := regexp.MatchString(pattern, sanitizer.S.SanitizeResourceName(result[k].Name)) + if !sanitizedMatch { + newResourceMap[k] = result[k] + } else { + delete(newResourceMap, k) + break + } + } } return newResourceMap } diff --git a/genesyscloud/tfexporter/genesyscloud_resource_exporter.go b/genesyscloud/tfexporter/genesyscloud_resource_exporter.go index a45475930..cbfdba572 100644 --- a/genesyscloud/tfexporter/genesyscloud_resource_exporter.go +++ b/genesyscloud/tfexporter/genesyscloud_resource_exporter.go @@ -327,6 +327,7 @@ func (g *GenesysCloudResourceExporter) retrieveGenesysCloudObjectInstances() dia go func(resType string, exporter *resourceExporter.ResourceExporter) { defer wg.Done() + log.Printf("Getting exported resources for [%s]", resType) typeResources, err := g.getResourcesForType(resType, g.provider, exporter, g.meta) if err != nil { @@ -834,7 +835,7 @@ func (g *GenesysCloudResourceExporter) buildSanitizedResourceMaps(exporters map[ } if containsPermissionsErrorOnly(err) && logErrors { log.Printf("%v", err[0].Summary) - log.Print("log_permission_errors = true. Resuming export...") + log.Printf("Logging permission error for %s. Resuming export...", name) return } if err != nil { @@ -854,6 +855,7 @@ func (g *GenesysCloudResourceExporter) buildSanitizedResourceMaps(exporters map[ go func() { wg.Wait() + log.Print(`Finished building sanitized resource maps`) close(wgDone) }() diff --git a/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go b/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go index 6a3dec660..ed0a0711f 100644 --- a/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go +++ b/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go @@ -124,6 +124,62 @@ func TestAccResourceTfExportIncludeFilterResourcesByRegEx(t *testing.T) { }) } +// TestAccResourceTfExportIncludeFilterResourcesByRegExAndSanitizedNames will create 3 queues (two with foo bar, one to be excluded). +// The test ensures that resources can be exported directly by their actual name or their sanitized names. +func TestAccResourceTfExportIncludeFilterResourcesByRegExAndSanitizedNames(t *testing.T) { + var ( + exportTestDir = "../.terraformregex" + uuid.NewString() + exportResource = "test-export3_1" + + queueResources = []QueueExport{ + {ResourceName: "test-queue-test-1", Name: "include filter test - exclude me", Description: "This is an excluded bar test resource", AcwTimeoutMs: 200000}, + {ResourceName: "test-queue-test-2", Name: "include filter test - foo - bar me", Description: "This is a foo bar test resource", AcwTimeoutMs: 200000}, + {ResourceName: "test-queue-test-3", Name: "include filter test - fu - barre you", Description: "This is a foo bar test resource", AcwTimeoutMs: 200000}, + } + ) + defer os.RemoveAll(exportTestDir) + + queueResourceDef := buildQueueResources(queueResources) + + config := queueResourceDef + + generateTfExportByIncludeFilterResources( + exportResource, + exportTestDir, + util.TrueValue, + []string{ + strconv.Quote("genesyscloud_routing_queue::include filter test - foo - bar me"), // Unsanitized Named Resource + strconv.Quote("genesyscloud_routing_queue::include_filter_test_-_fu_-_barre_you"), // Sanitized Named Resource + }, + util.FalseValue, + util.FalseValue, + []string{ + strconv.Quote("genesyscloud_routing_queue." + queueResources[0].ResourceName), + strconv.Quote("genesyscloud_routing_queue." + queueResources[1].ResourceName), + strconv.Quote("genesyscloud_routing_queue." + queueResources[2].ResourceName), + }, + ) + + sanitizer := resourceExporter.NewSanitizerProvider() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { util.TestAccPreCheck(t) }, + ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + Steps: []resource.TestStep{ + { + // Generate a queue as well and export it + Config: config, + // Wait for a specified duration to avoid runtime error + Check: resource.ComposeTestCheckFunc( + testQueueExportEqual(exportTestDir+"/"+defaultTfJSONFile, "genesyscloud_routing_queue", sanitizer.S.SanitizeResourceName(queueResources[1].Name), queueResources[1]), + testQueueExportEqual(exportTestDir+"/"+defaultTfJSONFile, "genesyscloud_routing_queue", sanitizer.S.SanitizeResourceName(queueResources[2].Name), queueResources[2]), + testQueueExportExcludesRegEx(exportTestDir+"/"+defaultTfJSONFile, "genesyscloud_routing_queue", ".*exclude me.*"), //We should not find any "test" queues here because we only wanted to include queues that ended with a -prod + ), + }, + }, + CheckDestroy: testVerifyExportsDestroyedFunc(exportTestDir), + }) +} + // TestAccResourceTfExportIncludeFilterResourcesByRegExExclusiveToResource // will create two queues (one with a -prod suffix and one with a -test suffix) // and two wrap up codes (one with a -prod suffix and one with a -test suffix) @@ -260,6 +316,75 @@ func TestAccResourceTfExportExcludeFilterResourcesByRegExExclusiveToResource(t * }) } +// TestAccResourceTfExportExcludeFilterResourcesByRegExExclusiveToResourceAndSanitizedNames will exclude any test resources that match a +// regular expression provided for the resource. In this test we check against both sanitized and unsanitized names. +func TestAccResourceTfExportExcludeFilterResourcesByRegExExclusiveToResourceAndSanitizedNames(t *testing.T) { + var ( + exportTestDir = "../.terraformExclude" + uuid.NewString() + exportResource = "test-export6_1" + + queueResources = []QueueExport{ + {ResourceName: "test-queue-test-1", Name: "exclude filter - exclude me", Description: "This is an excluded bar test resource", AcwTimeoutMs: 200000}, + {ResourceName: "test-queue-test-2", Name: "exclude filter - foo - bar me", Description: "This is a foo bar test resource", AcwTimeoutMs: 200000}, + {ResourceName: "test-queue-test-3", Name: "exclude filter - fu - barre you", Description: "This is a foo bar test resource", AcwTimeoutMs: 200000}, + } + + wrapupCodeResources = []WrapupcodeExport{ + {ResourceName: "test-wrapupcode-prod", Name: "exclude me"}, + {ResourceName: "test-wrapupcode-test", Name: "foo + bar me"}, + {ResourceName: "test-wrapupcode-dev", Name: "fu - barre you"}, + } + ) + defer os.RemoveAll(exportTestDir) + + queueResourceDef := buildQueueResources(queueResources) + wrapupcodeResourceDef := buildWrapupcodeResources(wrapupCodeResources) + config := queueResourceDef + wrapupcodeResourceDef + + generateTfExportByExcludeFilterResources( + exportResource, + exportTestDir, + util.TrueValue, + []string{ + strconv.Quote("genesyscloud_routing_queue::exclude filter - foo - bar me"), + strconv.Quote("genesyscloud_routing_queue::exclude_filter_-_fu_-_barre_you"), + strconv.Quote("genesyscloud_outbound_ruleset"), + strconv.Quote("genesyscloud_user"), + strconv.Quote("genesyscloud_user_roles"), + strconv.Quote("genesyscloud_flow"), + }, + util.FalseValue, + util.FalseValue, + []string{ + strconv.Quote("genesyscloud_routing_queue." + queueResources[0].ResourceName), + strconv.Quote("genesyscloud_routing_queue." + queueResources[1].ResourceName), + strconv.Quote("genesyscloud_routing_queue." + queueResources[2].ResourceName), + strconv.Quote("genesyscloud_routing_wrapupcode." + wrapupCodeResources[0].ResourceName), + strconv.Quote("genesyscloud_routing_wrapupcode." + wrapupCodeResources[1].ResourceName), + strconv.Quote("genesyscloud_routing_wrapupcode." + wrapupCodeResources[2].ResourceName), + }, + ) + + sanitizer := resourceExporter.NewSanitizerProvider() + resource.Test(t, resource.TestCase{ + PreCheck: func() { util.TestAccPreCheck(t) }, + ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + Steps: []resource.TestStep{ + { + // Generate a queue as well and export it + Config: config, + Check: resource.ComposeTestCheckFunc( + testQueueExportEqual(exportTestDir+"/"+defaultTfJSONFile, "genesyscloud_routing_queue", sanitizer.S.SanitizeResourceName(queueResources[0].Name), queueResources[0]), + testWrapupcodeExportEqual(exportTestDir+"/"+defaultTfJSONFile, "genesyscloud_routing_wrapupcode", sanitizer.S.SanitizeResourceName(wrapupCodeResources[0].Name), wrapupCodeResources[0]), + testWrapupcodeExportEqual(exportTestDir+"/"+defaultTfJSONFile, "genesyscloud_routing_wrapupcode", sanitizer.S.SanitizeResourceName(wrapupCodeResources[1].Name), wrapupCodeResources[1]), + testWrapupcodeExportEqual(exportTestDir+"/"+defaultTfJSONFile, "genesyscloud_routing_wrapupcode", sanitizer.S.SanitizeResourceName(wrapupCodeResources[2].Name), wrapupCodeResources[2]), + testQueueExportExcludesRegEx(exportTestDir+"/"+defaultTfJSONFile, "genesyscloud_routing_queue", "(foo|fu)"), + ), + }, + }, + CheckDestroy: testVerifyExportsDestroyedFunc(exportTestDir), + }) +} + // TestAccResourceTfExportSplitFilesAsJSON will create 2 queues, 2 wrap up codes, and 2 users. // The exporter will be run in split mode so 3 resource tf.jsons should be created as well as a provider.tf.json func TestAccResourceTfExportSplitFilesAsJSON(t *testing.T) { @@ -1367,7 +1492,7 @@ resource "genesyscloud_outbound_campaign" "%s" { resource "genesyscloud_script" "script" { script_name = "%s" filepath = "%s" - file_content_hash = filesha256("%s") + file_content_hash = filesha256("%s") } data "genesyscloud_auth_division_home" "home" {} @@ -2129,8 +2254,8 @@ func generateTfExportResource( "genesyscloud_architect_datatable", "genesyscloud_architect_datatable_row", //"genesyscloud_flow", - "genesyscloud_flow_milestone", - //"genesyscloud_flow_outcome", + "genesyscloud_flow_milestone", + //"genesyscloud_flow_outcome", "genesyscloud_architect_ivr", "genesyscloud_architect_schedules", "genesyscloud_architect_schedulegroups", From 6dc9c22c338c29ad2941eb129ec995b6d7c82f54 Mon Sep 17 00:00:00 2001 From: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Date: Tue, 18 Jun 2024 20:49:20 -0400 Subject: [PATCH 16/62] Bug/devtooling 659 (#1108) * added nil check * added nil check for line properties --- ...rce_genesyscloud_telephony_providers_edges_phone.go | 10 ++++++++-- ...nesyscloud_telephony_providers_edges_phone_utils.go | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go index 00c3283b7..64cee7cfa 100644 --- a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go +++ b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go @@ -90,10 +90,16 @@ func readPhone(ctx context.Context, d *schema.ResourceData, meta interface{}) di } _ = d.Set("name", *currentPhone.Name) - _ = d.Set("state", *currentPhone.State) _ = d.Set("site_id", *currentPhone.Site.Id) _ = d.Set("phone_base_settings_id", *currentPhone.PhoneBaseSettings.Id) - _ = d.Set("line_base_settings_id", *currentPhone.LineBaseSettings.Id) + + if currentPhone.State != nil { + _ = d.Set("state", *currentPhone.State) + } + + if currentPhone.LineBaseSettings != nil { + _ = d.Set("line_base_settings_id", *currentPhone.LineBaseSettings.Id) + } if currentPhone.PhoneMetaBase != nil { _ = d.Set("phone_meta_base_id", *currentPhone.PhoneMetaBase.Id) diff --git a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go index d0a9960b9..7545851fe 100644 --- a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go +++ b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go @@ -174,6 +174,9 @@ func flattenPhoneLines(lines *[]platformclientv2.Line) []string { for i := 0; i < len(*lines); i++ { line := (*lines)[i] did := "" + if line.Properties == nil { + continue + } if k := (*line.Properties)["station_identity_address"]; k != nil { didI := k.(map[string]interface{})["value"].(map[string]interface{})["instance"] if didI != nil { From c4412f6bd21517e6514237756fd6e5d529cbf743 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Jun 2024 11:07:40 +0100 Subject: [PATCH 17/62] Bump github.com/hashicorp/hcl/v2 from 2.20.1 to 2.21.0 (#1113) Bumps [github.com/hashicorp/hcl/v2](https://github.com/hashicorp/hcl) from 2.20.1 to 2.21.0. - [Release notes](https://github.com/hashicorp/hcl/releases) - [Changelog](https://github.com/hashicorp/hcl/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/hcl/compare/v2.20.1...v2.21.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/hcl/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 4e8cce60f..641f4f37c 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.6.0 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 - github.com/hashicorp/hcl/v2 v2.20.1 + github.com/hashicorp/hcl/v2 v2.21.0 github.com/hashicorp/terraform-plugin-docs v0.19.4 github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 github.com/leekchan/timeutil v0.0.0-20150802142658-28917288c48d diff --git a/go.sum b/go.sum index d0049284f..ed2d47cac 100644 --- a/go.sum +++ b/go.sum @@ -166,8 +166,8 @@ github.com/hashicorp/hc-install v0.7.0 h1:Uu9edVqjKQxxuD28mR5TikkKDd/p55S8vzPC16 github.com/hashicorp/hc-install v0.7.0/go.mod h1:ELmmzZlGnEcqoUMKUuykHaPCIR1sYLYX+KSggWSKZuA= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/hcl/v2 v2.20.1 h1:M6hgdyz7HYt1UN9e61j+qKJBqR3orTWbI1HKBJEdxtc= -github.com/hashicorp/hcl/v2 v2.20.1/go.mod h1:TZDqQ4kNKCbh1iJp99FdPiUaVDDUPivbqxZulxDYqL4= +github.com/hashicorp/hcl/v2 v2.21.0 h1:lve4q/o/2rqwYOgUg3y3V2YPyD1/zkCLGjIV74Jit14= +github.com/hashicorp/hcl/v2 v2.21.0/go.mod h1:62ZYHrXgPoX8xBnzl8QzbWq4dyDsDtfCRgIq1rbJEvA= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= @@ -346,7 +346,7 @@ github.com/yuin/goldmark-meta v1.1.0 h1:pWw+JLHGZe8Rk0EGsMVssiNb/AaPMHfSRszZeUei github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBvXi1lBb2VP0= github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8= github.com/zclconf/go-cty v1.14.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= -github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b h1:FosyBZYxY34Wul7O/MSKey3txpPYyCqVO5ZyceuQJEI= +github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6ZMSMNJFMOjqrGHynW3DIBuR2H9j0ug+Mo= go.abhg.dev/goldmark/frontmatter v0.2.0 h1:P8kPG0YkL12+aYk2yU3xHv4tcXzeVnN+gU0tJ5JnxRw= go.abhg.dev/goldmark/frontmatter v0.2.0/go.mod h1:XqrEkZuM57djk7zrlRUB02x8I5J0px76YjkOzhB4YlU= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= From 576e175dec51a2239868a1ba7b440e0b89e766fe Mon Sep 17 00:00:00 2001 From: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Date: Thu, 20 Jun 2024 11:58:08 +0100 Subject: [PATCH 18/62] Feat/devtooling 187 - Refactor routing settings (#1089) * Refactored Routing Settings * Added missing attributes to schema * Removed data source * Made requested Changes * Fixing merge conflicts --- docs/data-sources/routing_settings.md | 44 --- docs/resources/routing_settings.md | 2 + ...ta_source_genesyscloud_routing_settings.go | 45 --- ...urce_genesyscloud_routing_settings_test.go | 65 ---- ...loud_externalcontacts_contact_init_test.go | 1 - genesyscloud/resource_genesyscloud_init.go | 3 - .../resource_genesyscloud_init_test.go | 2 - .../resource_genesyscloud_routing_settings.go | 308 ------------------ ...genesyscloud_routing_settings_init_test.go | 40 +++ .../genesyscloud_routing_settings_proxy.go | 110 +++++++ .../resource_genesyscloud_routing_settings.go | 216 ++++++++++++ ...ce_genesyscloud_routing_settings_schema.go | 101 ++++++ ...urce_genesyscloud_routing_settings_test.go | 8 +- .../tfexporter/tf_exporter_resource_test.go | 6 +- main.go | 2 + 15 files changed, 479 insertions(+), 474 deletions(-) delete mode 100644 docs/data-sources/routing_settings.md delete mode 100644 genesyscloud/data_source_genesyscloud_routing_settings.go delete mode 100644 genesyscloud/data_source_genesyscloud_routing_settings_test.go delete mode 100644 genesyscloud/resource_genesyscloud_routing_settings.go create mode 100644 genesyscloud/routing_settings/genesyscloud_routing_settings_init_test.go create mode 100644 genesyscloud/routing_settings/genesyscloud_routing_settings_proxy.go create mode 100644 genesyscloud/routing_settings/resource_genesyscloud_routing_settings.go create mode 100644 genesyscloud/routing_settings/resource_genesyscloud_routing_settings_schema.go rename genesyscloud/{ => routing_settings}/resource_genesyscloud_routing_settings_test.go (98%) diff --git a/docs/data-sources/routing_settings.md b/docs/data-sources/routing_settings.md deleted file mode 100644 index 18d93fc8f..000000000 --- a/docs/data-sources/routing_settings.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -# generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "genesyscloud_routing_settings Data Source - terraform-provider-genesyscloud" -subcategory: "" -description: |- - An organization's routing settings ---- - -# genesyscloud_routing_settings (Data Source) - -An organization's routing settings - - - - -## Schema - -### Optional - -- `contactcenter` (Block List, Max: 1) Contact center settings (see [below for nested schema](#nestedblock--contactcenter)) -- `reset_agent_on_presence_change` (Boolean) Reset agent score when agent presence changes from off-queue to on-queue -- `transcription` (Block List, Max: 1) Transcription settings (see [below for nested schema](#nestedblock--transcription)) - -### Read-Only - -- `id` (String) The ID of this resource. - - -### Nested Schema for `contactcenter` - -Optional: - -- `remove_skills_from_blind_transfer` (Boolean) Strip skills from transfer - - - -### Nested Schema for `transcription` - -Optional: - -- `content_search_enabled` (Boolean) Setting to enable/disable content search -- `low_latency_transcription_enabled` (Boolean) Boolean flag indicating whether low latency transcription via Notification API is enabled -- `transcription` (String) Setting to enable/disable transcription capability.Valid values: Disabled, EnabledGlobally, EnabledQueueFlow -- `transcription_confidence_threshold` (Number) Configure confidence threshold. The possible values are from 1 to 100 diff --git a/docs/resources/routing_settings.md b/docs/resources/routing_settings.md index 548add012..ff9c5d9e8 100644 --- a/docs/resources/routing_settings.md +++ b/docs/resources/routing_settings.md @@ -65,6 +65,8 @@ Optional: - `content_search_enabled` (Boolean) Setting to enable/disable content search - `low_latency_transcription_enabled` (Boolean) Boolean flag indicating whether low latency transcription via Notification API is enabled +- `pci_dss_redaction_enabled` (Boolean) Setting to enable/disable PCI DSS Redaction +- `pii_redaction_enabled` (Boolean) Setting to enable/disable PII Redaction - `transcription` (String) Setting to enable/disable transcription capability.Valid values: Disabled, EnabledGlobally, EnabledQueueFlow - `transcription_confidence_threshold` (Number) Configure confidence threshold. The possible values are from 1 to 100 diff --git a/genesyscloud/data_source_genesyscloud_routing_settings.go b/genesyscloud/data_source_genesyscloud_routing_settings.go deleted file mode 100644 index 00a93ad9b..000000000 --- a/genesyscloud/data_source_genesyscloud_routing_settings.go +++ /dev/null @@ -1,45 +0,0 @@ -package genesyscloud - -import ( - "context" - "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" -) - -func dataSourceRoutingSettings() *schema.Resource { - return &schema.Resource{ - Description: "An organization's routing settings", - ReadContext: provider.ReadWithPooledClient(dataSourceRoutingSettingsRead), - SchemaVersion: 1, - Schema: ResourceRoutingSettings().Schema, - } -} - -func dataSourceRoutingSettingsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - sdkConfig := m.(*provider.ProviderMeta).ClientConfig - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - - settings, resp, getErr := routingAPI.GetRoutingSettings() - if getErr != nil { - return util.BuildAPIDiagnosticError("genesyscloud_routing_settings", fmt.Sprintf("Error requesting routing settings error: %s", getErr), resp) - } - - d.SetId("datasource-settings") - if settings.ResetAgentScoreOnPresenceChange != nil { - d.Set("reset_agent_on_presence_change", *settings.ResetAgentScoreOnPresenceChange) - } - - if diagErr := readRoutingSettingsContactCenter(d, routingAPI); diagErr != nil { - return util.BuildDiagnosticError("genesyscloud_routing_settings", fmt.Sprintf("Error reading routing settings contact center"), fmt.Errorf("%v", diagErr)) - } - - if diagErr := readRoutingSettingsTranscription(d, routingAPI); diagErr != nil { - return util.BuildDiagnosticError("genesyscloud_routing_settings", fmt.Sprintf("Error reading routing settings transcription"), fmt.Errorf("%v", diagErr)) - } - - return nil -} diff --git a/genesyscloud/data_source_genesyscloud_routing_settings_test.go b/genesyscloud/data_source_genesyscloud_routing_settings_test.go deleted file mode 100644 index 29aa90b82..000000000 --- a/genesyscloud/data_source_genesyscloud_routing_settings_test.go +++ /dev/null @@ -1,65 +0,0 @@ -package genesyscloud - -import ( - "fmt" - "strings" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" -) - -func TestAccDataSourceRoutingSettings(t *testing.T) { - var ( - settingsResource = "test-settings" - settingsDataSource = "test-settings-data" - transcription = "EnabledQueueFlow" - confidence = "1" - ) - - resource.Test(t, resource.TestCase{ - PreCheck: func() { util.TestAccPreCheck(t) }, - ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), - Steps: []resource.TestStep{ - { - // Search by contact center - Config: generateRoutingSettingsWithCustomAttrs( - settingsResource, - util.TrueValue, - generateSettingsContactCenter(util.FalseValue), - generateSettingsTranscription(transcription, confidence, util.TrueValue, util.FalseValue), - ) + generateRoutingSettingsDataSource( - settingsDataSource, - util.TrueValue, - "genesyscloud_routing_settings."+settingsResource, - generateSettingsContactCenter(util.FalseValue), - generateSettingsTranscription(transcription, confidence, util.TrueValue, util.FalseValue), - ), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttrPair("data.genesyscloud_routing_settings."+settingsDataSource, "reset_agent_on_presence", "genesyscloud_routing_settings."+settingsResource, "reset_agent_on_presence"), - resource.TestCheckResourceAttrPair("data.genesyscloud_routing_settings."+settingsDataSource, "contactcenter.remove_skills_from_blind_transfer", "genesyscloud_routing_settings."+settingsResource, "contactcenter.remove_skills_from_blind_transfer"), - resource.TestCheckResourceAttrPair("data.genesyscloud_routing_settings."+settingsDataSource, "transcription.0.transcription", "genesyscloud_routing_settings."+settingsResource, "transcription.0.transcription"), - resource.TestCheckResourceAttrPair("data.genesyscloud_routing_settings."+settingsDataSource, "transcription.0.transcription_confidence_threshold", "genesyscloud_routing_settings."+settingsResource, "transcription.0.transcription_confidence_threshold"), - resource.TestCheckResourceAttrPair("data.genesyscloud_routing_settings."+settingsDataSource, "transcription.0.low_latency_transcription_enabled", "genesyscloud_routing_settings."+settingsResource, "transcription.0.low_latency_transcription_enabled"), - resource.TestCheckResourceAttrPair("data.genesyscloud_routing_settings."+settingsDataSource, "transcription.0.content_search_enabled", "genesyscloud_routing_settings."+settingsResource, "transcription.0.content_search_enabled"), - ), - }, - }, - }) -} - -func generateRoutingSettingsDataSource( - resourceID string, - resetAgentScoreOnPresenceChange string, - // Must explicitly use depends_on in terraform v0.13 when a data source references a resource - // Fixed in v0.14 https://github.com/hashicorp/terraform/pull/26284 - dependsOnResource string, - attrs ...string) string { - return fmt.Sprintf(`data "genesyscloud_routing_settings" "%s" { - reset_agent_on_presence_change = %s - %s - depends_on=[%s] - } - `, resourceID, resetAgentScoreOnPresenceChange, strings.Join(attrs, "\n"), dependsOnResource) -} diff --git a/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_init_test.go b/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_init_test.go index 36de1b179..1e1c09f66 100644 --- a/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_init_test.go +++ b/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_init_test.go @@ -39,7 +39,6 @@ func (r *registerTestInstance) registerTestDataSources() { defer r.datasourceMapMutex.Unlock() providerDataSources["genesyscloud_externalcontacts_contact"] = DataSourceExternalContactsContact() - } // initTestResources initializes all test resources and data sources. diff --git a/genesyscloud/resource_genesyscloud_init.go b/genesyscloud/resource_genesyscloud_init.go index 8ca8476fa..a501e4114 100644 --- a/genesyscloud/resource_genesyscloud_init.go +++ b/genesyscloud/resource_genesyscloud_init.go @@ -30,7 +30,6 @@ func registerDataSources(l registrar.Registrar) { l.RegisterDataSource("genesyscloud_quality_forms_evaluation", DataSourceQualityFormsEvaluations()) l.RegisterDataSource("genesyscloud_quality_forms_survey", dataSourceQualityFormsSurvey()) l.RegisterDataSource("genesyscloud_routing_language", dataSourceRoutingLanguage()) - l.RegisterDataSource("genesyscloud_routing_settings", dataSourceRoutingSettings()) l.RegisterDataSource("genesyscloud_routing_skill", dataSourceRoutingSkill()) l.RegisterDataSource("genesyscloud_routing_skill_group", dataSourceRoutingSkillGroup()) l.RegisterDataSource("genesyscloud_routing_email_domain", DataSourceRoutingEmailDomain()) @@ -66,7 +65,6 @@ func registerResources(l registrar.Registrar) { l.RegisterResource("genesyscloud_routing_language", ResourceRoutingLanguage()) l.RegisterResource("genesyscloud_routing_skill", ResourceRoutingSkill()) l.RegisterResource("genesyscloud_routing_skill_group", ResourceRoutingSkillGroup()) - l.RegisterResource("genesyscloud_routing_settings", ResourceRoutingSettings()) l.RegisterResource("genesyscloud_routing_utilization", ResourceRoutingUtilization()) l.RegisterResource("genesyscloud_routing_utilization_label", ResourceRoutingUtilizationLabel()) l.RegisterResource("genesyscloud_routing_wrapupcode", ResourceRoutingWrapupCode()) @@ -93,7 +91,6 @@ func registerExporters(l registrar.Registrar) { l.RegisterExporter("genesyscloud_quality_forms_survey", SurveyFormExporter()) l.RegisterExporter("genesyscloud_routing_email_domain", RoutingEmailDomainExporter()) l.RegisterExporter("genesyscloud_routing_language", RoutingLanguageExporter()) - l.RegisterExporter("genesyscloud_routing_settings", RoutingSettingsExporter()) l.RegisterExporter("genesyscloud_routing_skill", RoutingSkillExporter()) l.RegisterExporter("genesyscloud_routing_skill_group", ResourceSkillGroupExporter()) l.RegisterExporter("genesyscloud_routing_utilization", RoutingUtilizationExporter()) diff --git a/genesyscloud/resource_genesyscloud_init_test.go b/genesyscloud/resource_genesyscloud_init_test.go index 2281f5239..0a7bd0457 100644 --- a/genesyscloud/resource_genesyscloud_init_test.go +++ b/genesyscloud/resource_genesyscloud_init_test.go @@ -58,7 +58,6 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_routing_language"] = ResourceRoutingLanguage() providerResources["genesyscloud_routing_skill"] = ResourceRoutingSkill() providerResources["genesyscloud_routing_skill_group"] = ResourceRoutingSkillGroup() - providerResources["genesyscloud_routing_settings"] = ResourceRoutingSettings() providerResources["genesyscloud_routing_utilization"] = ResourceRoutingUtilization() providerResources["genesyscloud_routing_utilization_label"] = ResourceRoutingUtilizationLabel() providerResources["genesyscloud_routing_wrapupcode"] = ResourceRoutingWrapupCode() @@ -94,7 +93,6 @@ func (r *registerTestInstance) registerTestDataSources() { providerDataSources["genesyscloud_quality_forms_evaluation"] = DataSourceQualityFormsEvaluations() providerDataSources["genesyscloud_quality_forms_survey"] = dataSourceQualityFormsSurvey() providerDataSources["genesyscloud_routing_language"] = dataSourceRoutingLanguage() - providerDataSources["genesyscloud_routing_settings"] = dataSourceRoutingSettings() providerDataSources["genesyscloud_routing_skill"] = dataSourceRoutingSkill() providerDataSources["genesyscloud_routing_skill_group"] = dataSourceRoutingSkillGroup() providerDataSources["genesyscloud_routing_email_domain"] = DataSourceRoutingEmailDomain() diff --git a/genesyscloud/resource_genesyscloud_routing_settings.go b/genesyscloud/resource_genesyscloud_routing_settings.go deleted file mode 100644 index fa76665f8..000000000 --- a/genesyscloud/resource_genesyscloud_routing_settings.go +++ /dev/null @@ -1,308 +0,0 @@ -package genesyscloud - -import ( - "context" - "fmt" - "log" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" - "terraform-provider-genesyscloud/genesyscloud/util/constants" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - - "terraform-provider-genesyscloud/genesyscloud/consistency_checker" - - resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" -) - -func ResourceRoutingSettings() *schema.Resource { - return &schema.Resource{ - Description: "An organization's routing settings", - - CreateContext: provider.CreateWithPooledClient(createRoutingSettings), - ReadContext: provider.ReadWithPooledClient(readRoutingSettings), - UpdateContext: provider.UpdateWithPooledClient(updateRoutingSettings), - DeleteContext: provider.DeleteWithPooledClient(deleteRoutingSettings), - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - SchemaVersion: 1, - Schema: map[string]*schema.Schema{ - "reset_agent_on_presence_change": { - Description: "Reset agent score when agent presence changes from off-queue to on-queue", - Type: schema.TypeBool, - Optional: true, - Computed: true, - }, - "contactcenter": { - Description: "Contact center settings", - Type: schema.TypeList, - Optional: true, - Computed: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "remove_skills_from_blind_transfer": { - Description: "Strip skills from transfer", - Type: schema.TypeBool, - Optional: true, - }, - }, - }, - }, - "transcription": { - Description: "Transcription settings", - Type: schema.TypeList, - Optional: true, - Computed: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "transcription": { - Description: "Setting to enable/disable transcription capability.Valid values: Disabled, EnabledGlobally, EnabledQueueFlow", - Type: schema.TypeString, - Optional: true, - }, - "transcription_confidence_threshold": { - Description: "Configure confidence threshold. The possible values are from 1 to 100", - Type: schema.TypeInt, - Optional: true, - }, - "low_latency_transcription_enabled": { - Description: "Boolean flag indicating whether low latency transcription via Notification API is enabled", - Type: schema.TypeBool, - Optional: true, - }, - "content_search_enabled": { - Description: "Setting to enable/disable content search", - Type: schema.TypeBool, - Optional: true, - }, - }, - }, - }, - }, - } -} - -func getAllRoutingSettings(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { - resources := make(resourceExporter.ResourceIDMetaMap) - resources["0"] = &resourceExporter.ResourceMeta{Name: "routing_settings"} - return resources, nil -} - -func RoutingSettingsExporter() *resourceExporter.ResourceExporter { - return &resourceExporter.ResourceExporter{ - GetResourcesFunc: provider.GetAllWithPooledClient(getAllRoutingSettings), - RefAttrs: map[string]*resourceExporter.RefAttrSettings{}, // No references - } -} - -func createRoutingSettings(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - log.Printf("Creating Routing Setting") - d.SetId("settings") - return updateRoutingSettings(ctx, d, meta) -} - -func readRoutingSettings(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceRoutingSettings(), constants.DefaultConsistencyChecks, "genesyscloud_routing_settings") - - log.Printf("Reading setting: %s", d.Id()) - return util.WithRetriesForRead(ctx, d, func() *retry.RetryError { - settings, resp, getErr := routingAPI.GetRoutingSettings() - - if getErr != nil { - if util.IsStatus404(resp) { - //createRoutingSettings(ctx, d, meta) - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_settings", fmt.Sprintf("Failed to read Routing Setting %s | error: %s", d.Id(), getErr), resp)) - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_settings", fmt.Sprintf("Failed to read Routing Setting %s | error: %s", d.Id(), getErr), resp)) - } - - if settings.ResetAgentScoreOnPresenceChange != nil { - d.Set("reset_agent_on_presence_change", *settings.ResetAgentScoreOnPresenceChange) - } else { - d.Set("reset_agent_on_presence_change", nil) - } - - if diagErr := readRoutingSettingsContactCenter(d, routingAPI); diagErr != nil { - return retry.NonRetryableError(fmt.Errorf("%v", diagErr)) - } - - if diagErr := readRoutingSettingsTranscription(d, routingAPI); diagErr != nil { - return retry.NonRetryableError(fmt.Errorf("%v", diagErr)) - } - - log.Printf("Read Routing Setting") - return cc.CheckState(d) - }) -} - -func updateRoutingSettings(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - resetAgentOnPresenceChange := d.Get("reset_agent_on_presence_change").(bool) - - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - - log.Printf("Updating Routing Settings") - update := platformclientv2.Routingsettings{ - ResetAgentScoreOnPresenceChange: &resetAgentOnPresenceChange, - } - - diagErr := updateContactCenter(d, routingAPI) - if diagErr != nil { - return diagErr - } - - diagErr = updateTranscription(d, routingAPI) - if diagErr != nil { - return diagErr - } - - _, resp, err := routingAPI.PutRoutingSettings(update) - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_routing_settings", fmt.Sprintf("Failed to update routing settings %s error: %s", d.Id(), err), resp) - } - - time.Sleep(5 * time.Second) - - log.Printf("Updated Routing Settings") - return readRoutingSettings(ctx, d, meta) -} - -func deleteRoutingSettings(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - - log.Printf("Resetting Routing Setting") - resp, err := routingAPI.DeleteRoutingSettings() - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_routing_settings", fmt.Sprintf("Failed to delete routing settings error: %s", err), resp) - } - log.Printf("Reset Routing Settings") - return nil -} - -func readRoutingSettingsContactCenter(d *schema.ResourceData, routingAPI *platformclientv2.RoutingApi) diag.Diagnostics { - contactcenter, resp, getErr := routingAPI.GetRoutingSettingsContactcenter() - if getErr != nil { - if util.IsStatus404(resp) { - return nil - } - return util.BuildAPIDiagnosticError("genesyscloud_routing_settings", fmt.Sprintf("Failed to read contact center for routing setting %s error: %s", d.Id(), getErr), resp) - } - - if contactcenter == nil { - d.Set("contactcenter", nil) - return nil - } - - contactSettings := make(map[string]interface{}) - - if contactcenter.RemoveSkillsFromBlindTransfer != nil { - contactSettings["remove_skills_from_blind_transfer"] = *contactcenter.RemoveSkillsFromBlindTransfer - } - - d.Set("contactcenter", []interface{}{contactSettings}) - return nil -} - -func readRoutingSettingsTranscription(d *schema.ResourceData, routingAPI *platformclientv2.RoutingApi) diag.Diagnostics { - transcription, resp, getErr := routingAPI.GetRoutingSettingsTranscription() - if getErr != nil { - if util.IsStatus404(resp) { - return nil - } - return util.BuildAPIDiagnosticError("genesyscloud_routing_settings", fmt.Sprintf("Failed to read contact center for routing settings %s error: %s", d.Id(), getErr), resp) - } - - if transcription == nil { - d.Set("transcription", nil) - return nil - } - - transcriptionSettings := make(map[string]interface{}) - - if transcription.Transcription != nil { - transcriptionSettings["transcription"] = *transcription.Transcription - } - if transcription.TranscriptionConfidenceThreshold != nil { - transcriptionSettings["transcription_confidence_threshold"] = *transcription.TranscriptionConfidenceThreshold - } - if transcription.LowLatencyTranscriptionEnabled != nil { - transcriptionSettings["low_latency_transcription_enabled"] = *transcription.LowLatencyTranscriptionEnabled - } - if transcription.ContentSearchEnabled != nil { - transcriptionSettings["content_search_enabled"] = *transcription.ContentSearchEnabled - } - - d.Set("transcription", []interface{}{transcriptionSettings}) - return nil -} - -func updateContactCenter(d *schema.ResourceData, routingAPI *platformclientv2.RoutingApi) diag.Diagnostics { - var removeSkillsFromBlindTransfer bool - - if contactCenterConfig := d.Get("contactcenter"); contactCenterConfig != nil { - if contactCenterList := contactCenterConfig.([]interface{}); len(contactCenterList) > 0 { - contactCenterMap := contactCenterList[0].(map[string]interface{}) - - if contactCenterMap["remove_skills_from_blind_transfer"] != nil { - removeSkillsFromBlindTransfer = contactCenterMap["remove_skills_from_blind_transfer"].(bool) - } - resp, err := routingAPI.PatchRoutingSettingsContactcenter(platformclientv2.Contactcentersettings{ - RemoveSkillsFromBlindTransfer: &removeSkillsFromBlindTransfer, - }) - - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_routing_settings", fmt.Sprintf("Failed to update contact center for routing settings %s error: %s", d.Id(), err), resp) - } - } - } - return nil -} - -func updateTranscription(d *schema.ResourceData, routingAPI *platformclientv2.RoutingApi) diag.Diagnostics { - if transcriptionConfig := d.Get("transcription"); transcriptionConfig != nil { - if transcriptionList := transcriptionConfig.([]interface{}); len(transcriptionList) > 0 { - transcriptionMap := transcriptionList[0].(map[string]interface{}) - - var transcription string - var transcriptionConfidenceThreshold int - var lowLatencyTranscriptionEnabled bool - var contentSearchEnabled bool - - if transcriptionMap["transcription"] != nil { - transcription = transcriptionMap["transcription"].(string) - } - if transcriptionMap["transcription_confidence_threshold"] != nil { - transcriptionConfidenceThreshold = transcriptionMap["transcription_confidence_threshold"].(int) - } - if transcriptionMap["low_latency_transcription_enabled"] != nil { - lowLatencyTranscriptionEnabled = transcriptionMap["low_latency_transcription_enabled"].(bool) - } - if transcriptionMap["content_search_enabled"] != nil { - contentSearchEnabled = transcriptionMap["content_search_enabled"].(bool) - } - - _, resp, err := routingAPI.PutRoutingSettingsTranscription(platformclientv2.Transcriptionsettings{ - Transcription: &transcription, - TranscriptionConfidenceThreshold: &transcriptionConfidenceThreshold, - LowLatencyTranscriptionEnabled: &lowLatencyTranscriptionEnabled, - ContentSearchEnabled: &contentSearchEnabled, - }) - - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_routing_settings", fmt.Sprintf("Failed to update Transcription for routing settings %s error: %s", d.Id(), err), resp) - } - } - } - return nil -} diff --git a/genesyscloud/routing_settings/genesyscloud_routing_settings_init_test.go b/genesyscloud/routing_settings/genesyscloud_routing_settings_init_test.go new file mode 100644 index 000000000..7e9c341f7 --- /dev/null +++ b/genesyscloud/routing_settings/genesyscloud_routing_settings_init_test.go @@ -0,0 +1,40 @@ +package routing_settings + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "sync" + "testing" +) + +// providerResources holds a map of all registered resources +var providerResources map[string]*schema.Resource + +type registerTestInstance struct { + resourceMapMutex sync.RWMutex +} + +// registerTestResources registers all resources used in the tests +func (r *registerTestInstance) registerTestResources() { + r.resourceMapMutex.Lock() + defer r.resourceMapMutex.Unlock() + + providerResources[resourceName] = ResourceRoutingSettings() +} + +// initTestResources initializes all test resources and data sources. +func initTestResources() { + providerResources = make(map[string]*schema.Resource) + + regInstance := ®isterTestInstance{} + + regInstance.registerTestResources() +} + +// TestMain is a "setup" function called by the testing framework when run the test +func TestMain(m *testing.M) { + // Run setup function before starting the test suite for routing_settings package + initTestResources() + + // Run the test suite for the routing_settings package + m.Run() +} diff --git a/genesyscloud/routing_settings/genesyscloud_routing_settings_proxy.go b/genesyscloud/routing_settings/genesyscloud_routing_settings_proxy.go new file mode 100644 index 000000000..111dcf6f1 --- /dev/null +++ b/genesyscloud/routing_settings/genesyscloud_routing_settings_proxy.go @@ -0,0 +1,110 @@ +package routing_settings + +import ( + "context" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" +) + +var internalProxy *routingSettingsProxy + +type getRoutingSettingsFunc func(ctx context.Context, p *routingSettingsProxy) (*platformclientv2.Routingsettings, *platformclientv2.APIResponse, error) +type updateRoutingSettingsFunc func(ctx context.Context, p *routingSettingsProxy, routingSettings *platformclientv2.Routingsettings) (*platformclientv2.Routingsettings, *platformclientv2.APIResponse, error) +type deleteRoutingSettingsFunc func(ctx context.Context, p *routingSettingsProxy) (*platformclientv2.APIResponse, error) + +type getRoutingSettingsContactCenterFunc func(ctx context.Context, p *routingSettingsProxy) (*platformclientv2.Contactcentersettings, *platformclientv2.APIResponse, error) +type updateRoutingSettingsContactCenterFunc func(ctx context.Context, p *routingSettingsProxy, contactCenterSettings platformclientv2.Contactcentersettings) (*platformclientv2.APIResponse, error) + +type getRoutingSettingsTranscriptionFunc func(ctx context.Context, p *routingSettingsProxy) (*platformclientv2.Transcriptionsettings, *platformclientv2.APIResponse, error) +type updateRoutingSettingsTranscriptionFunc func(ctx context.Context, p *routingSettingsProxy, transcriptionSettings platformclientv2.Transcriptionsettings) (*platformclientv2.Transcriptionsettings, *platformclientv2.APIResponse, error) + +type routingSettingsProxy struct { + clientConfig *platformclientv2.Configuration + routingSettingsApi *platformclientv2.RoutingApi + getRoutingSettingsAttr getRoutingSettingsFunc + updateRoutingSettingsAttr updateRoutingSettingsFunc + deleteRoutingSettingsAttr deleteRoutingSettingsFunc + + getRoutingSettingsContactCenterAttr getRoutingSettingsContactCenterFunc + updateRoutingSettingsContactCenterAttr updateRoutingSettingsContactCenterFunc + + getRoutingSettingsTranscriptionAttr getRoutingSettingsTranscriptionFunc + updateRoutingSettingsTranscriptionAttr updateRoutingSettingsTranscriptionFunc +} + +func newRoutingSettingsProxy(clientConfig *platformclientv2.Configuration) *routingSettingsProxy { + api := platformclientv2.NewRoutingApiWithConfig(clientConfig) + return &routingSettingsProxy{ + clientConfig: clientConfig, + routingSettingsApi: api, + getRoutingSettingsAttr: getRoutingSettingsFn, + updateRoutingSettingsAttr: updateRoutingSettingsFn, + deleteRoutingSettingsAttr: deleteRoutingSettingsFn, + getRoutingSettingsContactCenterAttr: getRoutingSettingsContactCenterFn, + updateRoutingSettingsContactCenterAttr: updateRoutingSettingsContactCenterFn, + getRoutingSettingsTranscriptionAttr: getRoutingSettingsTranscriptionFn, + updateRoutingSettingsTranscriptionAttr: updateRoutingSettingsTranscriptionFn, + } +} + +func getRoutingSettingsProxy(clientConfig *platformclientv2.Configuration) *routingSettingsProxy { + if internalProxy == nil { + internalProxy = newRoutingSettingsProxy(clientConfig) + } + return internalProxy +} + +func (p *routingSettingsProxy) getRoutingSettings(ctx context.Context) (*platformclientv2.Routingsettings, *platformclientv2.APIResponse, error) { + return p.getRoutingSettingsAttr(ctx, p) +} + +func (p *routingSettingsProxy) updateRoutingSettings(ctx context.Context, routingSettings *platformclientv2.Routingsettings) (*platformclientv2.Routingsettings, *platformclientv2.APIResponse, error) { + return p.updateRoutingSettingsAttr(ctx, p, routingSettings) +} + +func (p *routingSettingsProxy) deleteRoutingSettings(ctx context.Context) (*platformclientv2.APIResponse, error) { + return p.deleteRoutingSettingsAttr(ctx, p) +} + +func (p *routingSettingsProxy) getRoutingSettingsContactCenter(ctx context.Context) (*platformclientv2.Contactcentersettings, *platformclientv2.APIResponse, error) { + return p.getRoutingSettingsContactCenterAttr(ctx, p) +} + +func (p *routingSettingsProxy) updateRoutingSettingsContactCenter(ctx context.Context, contactCenterSettings platformclientv2.Contactcentersettings) (*platformclientv2.APIResponse, error) { + return p.updateRoutingSettingsContactCenterAttr(ctx, p, contactCenterSettings) +} + +func (p *routingSettingsProxy) getRoutingSettingsTranscription(ctx context.Context) (*platformclientv2.Transcriptionsettings, *platformclientv2.APIResponse, error) { + return p.getRoutingSettingsTranscriptionAttr(ctx, p) +} + +func (p *routingSettingsProxy) updateRoutingSettingsTranscription(ctx context.Context, transcriptionSettings platformclientv2.Transcriptionsettings) (*platformclientv2.Transcriptionsettings, *platformclientv2.APIResponse, error) { + return p.updateRoutingSettingsTranscriptionAttr(ctx, p, transcriptionSettings) +} + +func getRoutingSettingsFn(ctx context.Context, p *routingSettingsProxy) (*platformclientv2.Routingsettings, *platformclientv2.APIResponse, error) { + return p.routingSettingsApi.GetRoutingSettings() +} + +func updateRoutingSettingsFn(ctx context.Context, p *routingSettingsProxy, routingSettings *platformclientv2.Routingsettings) (*platformclientv2.Routingsettings, *platformclientv2.APIResponse, error) { + return p.routingSettingsApi.PutRoutingSettings(*routingSettings) +} + +func deleteRoutingSettingsFn(ctx context.Context, p *routingSettingsProxy) (*platformclientv2.APIResponse, error) { + return p.routingSettingsApi.DeleteRoutingSettings() +} + +func getRoutingSettingsContactCenterFn(ctx context.Context, p *routingSettingsProxy) (*platformclientv2.Contactcentersettings, *platformclientv2.APIResponse, error) { + return p.routingSettingsApi.GetRoutingSettingsContactcenter() +} + +func updateRoutingSettingsContactCenterFn(ctx context.Context, p *routingSettingsProxy, contactCenterSettings platformclientv2.Contactcentersettings) (*platformclientv2.APIResponse, error) { + return p.routingSettingsApi.PatchRoutingSettingsContactcenter(contactCenterSettings) +} + +func getRoutingSettingsTranscriptionFn(ctx context.Context, p *routingSettingsProxy) (*platformclientv2.Transcriptionsettings, *platformclientv2.APIResponse, error) { + return p.routingSettingsApi.GetRoutingSettingsTranscription() +} + +func updateRoutingSettingsTranscriptionFn(ctx context.Context, p *routingSettingsProxy, transcriptionSettings platformclientv2.Transcriptionsettings) (*platformclientv2.Transcriptionsettings, *platformclientv2.APIResponse, error) { + return p.routingSettingsApi.PutRoutingSettingsTranscription(transcriptionSettings) +} diff --git a/genesyscloud/routing_settings/resource_genesyscloud_routing_settings.go b/genesyscloud/routing_settings/resource_genesyscloud_routing_settings.go new file mode 100644 index 000000000..3f4a4f2e8 --- /dev/null +++ b/genesyscloud/routing_settings/resource_genesyscloud_routing_settings.go @@ -0,0 +1,216 @@ +package routing_settings + +import ( + "context" + "fmt" + "log" + "terraform-provider-genesyscloud/genesyscloud/provider" + "terraform-provider-genesyscloud/genesyscloud/util" + "terraform-provider-genesyscloud/genesyscloud/util/constants" + "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + + "terraform-provider-genesyscloud/genesyscloud/consistency_checker" + + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" +) + +func getAllRoutingSettings(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { + resources := make(resourceExporter.ResourceIDMetaMap) + resources["0"] = &resourceExporter.ResourceMeta{Name: "routing_settings"} + return resources, nil +} + +func createRoutingSettings(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + log.Printf("Creating Routing Setting") + d.SetId("settings") + return updateRoutingSettings(ctx, d, meta) +} + +func readRoutingSettings(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingSettingsProxy(sdkConfig) + cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceRoutingSettings(), constants.DefaultConsistencyChecks, resourceName) + + log.Printf("Reading routing settings") + + return util.WithRetriesForRead(ctx, d, func() *retry.RetryError { + settings, resp, getErr := proxy.getRoutingSettings(ctx) + if getErr != nil { + if util.IsStatus404(resp) { + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read Routing Setting %s | error: %s", d.Id(), getErr), resp)) + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read Routing Setting %s | error: %s", d.Id(), getErr), resp)) + } + + resourcedata.SetNillableValue(d, "reset_agent_on_presence_change", settings.ResetAgentScoreOnPresenceChange) + + if diagErr := readRoutingSettingsContactCenter(ctx, d, proxy); diagErr != nil { + return retry.NonRetryableError(fmt.Errorf("%v", diagErr)) + } + + if diagErr := readRoutingSettingsTranscription(ctx, d, proxy); diagErr != nil { + return retry.NonRetryableError(fmt.Errorf("%v", diagErr)) + } + + log.Printf("Read Routing Setting") + return cc.CheckState(d) + }) +} + +func updateRoutingSettings(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + resetAgentOnPresenceChange := d.Get("reset_agent_on_presence_change").(bool) + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingSettingsProxy(sdkConfig) + + log.Printf("Updating Routing Settings") + update := platformclientv2.Routingsettings{ + ResetAgentScoreOnPresenceChange: &resetAgentOnPresenceChange, + } + + diagErr := updateContactCenter(ctx, d, proxy) + if diagErr != nil { + return diagErr + } + + diagErr = updateTranscription(ctx, d, proxy) + if diagErr != nil { + return diagErr + } + + _, resp, err := proxy.updateRoutingSettings(ctx, &update) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to update routing settings %s error: %s", d.Id(), err), resp) + } + + time.Sleep(5 * time.Second) + + log.Printf("Updated Routing Settings") + return readRoutingSettings(ctx, d, meta) +} + +func deleteRoutingSettings(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingSettingsProxy(sdkConfig) + + log.Printf("Resetting Routing Setting") + resp, err := proxy.deleteRoutingSettings(ctx) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to delete routing settings %s error: %s", d.Id(), err), resp) + } + + log.Printf("Reset Routing Settings") + return nil +} + +func readRoutingSettingsContactCenter(ctx context.Context, d *schema.ResourceData, proxy *routingSettingsProxy) diag.Diagnostics { + contactCenter, resp, getErr := proxy.getRoutingSettingsContactCenter(ctx) + if getErr != nil { + if util.IsStatus404(resp) { + return nil + } + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to read contact center for routing setting %s error: %s", d.Id(), getErr), resp) + } + + if contactCenter == nil { + _ = d.Set("contactcenter", nil) + return nil + } + + contactSettings := make(map[string]interface{}) + resourcedata.SetMapValueIfNotNil(contactSettings, "remove_skills_from_blind_transfer", contactCenter.RemoveSkillsFromBlindTransfer) + + _ = d.Set("contactcenter", []interface{}{contactSettings}) + return nil +} + +func updateContactCenter(ctx context.Context, d *schema.ResourceData, proxy *routingSettingsProxy) diag.Diagnostics { + var removeSkillsFromBlindTransfer bool + + if contactCenterConfig := d.Get("contactcenter"); contactCenterConfig != nil { + if contactCenterList := contactCenterConfig.([]interface{}); len(contactCenterList) > 0 { + contactCenterMap := contactCenterList[0].(map[string]interface{}) + + if contactCenterMap["remove_skills_from_blind_transfer"] != nil { + removeSkillsFromBlindTransfer = contactCenterMap["remove_skills_from_blind_transfer"].(bool) + } + + contactCenterSettings := platformclientv2.Contactcentersettings{ + RemoveSkillsFromBlindTransfer: &removeSkillsFromBlindTransfer, + } + + resp, err := proxy.updateRoutingSettingsContactCenter(ctx, contactCenterSettings) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to update contact center for routing settings %s error: %s", d.Id(), err), resp) + } + } + } + return nil +} + +func readRoutingSettingsTranscription(ctx context.Context, d *schema.ResourceData, proxy *routingSettingsProxy) diag.Diagnostics { + transcription, resp, getErr := proxy.getRoutingSettingsTranscription(ctx) + if getErr != nil { + if util.IsStatus404(resp) { + return nil + } + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to read contact center for routing settings %s error: %s", d.Id(), getErr), resp) + } + + if transcription == nil { + _ = d.Set("transcription", nil) + return nil + } + + transcriptionSettings := make(map[string]interface{}) + resourcedata.SetMapValueIfNotNil(transcriptionSettings, "transcription", transcription.Transcription) + resourcedata.SetMapValueIfNotNil(transcriptionSettings, "transcription_confidence_threshold", transcription.TranscriptionConfidenceThreshold) + resourcedata.SetMapValueIfNotNil(transcriptionSettings, "low_latency_transcription_enabled", transcription.LowLatencyTranscriptionEnabled) + resourcedata.SetMapValueIfNotNil(transcriptionSettings, "content_search_enabled", transcription.ContentSearchEnabled) + resourcedata.SetMapValueIfNotNil(transcriptionSettings, "pci_dss_redaction_enabled", transcription.PciDssRedactionEnabled) + resourcedata.SetMapValueIfNotNil(transcriptionSettings, "pii_redaction_enabled", transcription.PiiRedactionEnabled) + + _ = d.Set("transcription", []interface{}{transcriptionSettings}) + return nil +} + +func updateTranscription(ctx context.Context, d *schema.ResourceData, proxy *routingSettingsProxy) diag.Diagnostics { + transcriptionRequest := platformclientv2.Transcriptionsettings{} + + if transcriptionConfigList, ok := d.Get("transcription").([]interface{}); ok && len(transcriptionConfigList) > 0 { + transcriptionMap, ok := transcriptionConfigList[0].(map[string]interface{}) + if !ok { + return nil + } + if transcription, ok := transcriptionMap["transcription"].(string); ok && transcription != "" { + transcriptionRequest.Transcription = &transcription + } + if transcriptionConfidenceThreshold, ok := transcriptionMap["transcription_confidence_threshold"].(int); ok { + transcriptionRequest.TranscriptionConfidenceThreshold = &transcriptionConfidenceThreshold + } + if lowLatencyTranscriptionEnabled, ok := transcriptionMap["low_latency_transcription_enabled"].(bool); ok { + transcriptionRequest.LowLatencyTranscriptionEnabled = &lowLatencyTranscriptionEnabled + } + if contentSearchEnabled, ok := transcriptionMap["content_search_enabled"].(bool); ok { + transcriptionRequest.ContentSearchEnabled = &contentSearchEnabled + } + if pciEnabled, ok := transcriptionMap["pci_dss_redaction_enabled"].(bool); ok { + transcriptionRequest.PciDssRedactionEnabled = &pciEnabled + } + if piiEnabled, ok := transcriptionMap["pii_redaction_enabled"].(bool); ok { + transcriptionRequest.PiiRedactionEnabled = &piiEnabled + } + + _, resp, err := proxy.updateRoutingSettingsTranscription(ctx, transcriptionRequest) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to update Transcription for routing settings %s error: %s", d.Id(), err), resp) + } + } + return nil +} diff --git a/genesyscloud/routing_settings/resource_genesyscloud_routing_settings_schema.go b/genesyscloud/routing_settings/resource_genesyscloud_routing_settings_schema.go new file mode 100644 index 000000000..0f0d50f28 --- /dev/null +++ b/genesyscloud/routing_settings/resource_genesyscloud_routing_settings_schema.go @@ -0,0 +1,101 @@ +package routing_settings + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" +) + +var resourceName = "genesyscloud_routing_settings" + +func SetRegistrar(regInstance registrar.Registrar) { + regInstance.RegisterResource(resourceName, ResourceRoutingSettings()) + regInstance.RegisterExporter(resourceName, RoutingSettingsExporter()) +} + +func ResourceRoutingSettings() *schema.Resource { + return &schema.Resource{ + Description: "An organization's routing settings", + + CreateContext: provider.CreateWithPooledClient(createRoutingSettings), + ReadContext: provider.ReadWithPooledClient(readRoutingSettings), + UpdateContext: provider.UpdateWithPooledClient(updateRoutingSettings), + DeleteContext: provider.DeleteWithPooledClient(deleteRoutingSettings), + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + SchemaVersion: 1, + Schema: map[string]*schema.Schema{ + "reset_agent_on_presence_change": { + Description: "Reset agent score when agent presence changes from off-queue to on-queue", + Type: schema.TypeBool, + Optional: true, + Computed: true, + }, + "contactcenter": { + Description: "Contact center settings", + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "remove_skills_from_blind_transfer": { + Description: "Strip skills from transfer", + Type: schema.TypeBool, + Optional: true, + }, + }, + }, + }, + "transcription": { + Description: "Transcription settings", + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "transcription": { + Description: "Setting to enable/disable transcription capability.Valid values: Disabled, EnabledGlobally, EnabledQueueFlow", + Type: schema.TypeString, + Optional: true, + }, + "transcription_confidence_threshold": { + Description: "Configure confidence threshold. The possible values are from 1 to 100", + Type: schema.TypeInt, + Optional: true, + }, + "low_latency_transcription_enabled": { + Description: "Boolean flag indicating whether low latency transcription via Notification API is enabled", + Type: schema.TypeBool, + Optional: true, + }, + "content_search_enabled": { + Description: "Setting to enable/disable content search", + Type: schema.TypeBool, + Optional: true, + }, + `pci_dss_redaction_enabled`: { + Description: `Setting to enable/disable PCI DSS Redaction`, + Optional: true, + Type: schema.TypeBool, + }, + `pii_redaction_enabled`: { + Description: `Setting to enable/disable PII Redaction`, + Optional: true, + Type: schema.TypeBool, + }, + }, + }, + }, + }, + } +} + +func RoutingSettingsExporter() *resourceExporter.ResourceExporter { + return &resourceExporter.ResourceExporter{ + GetResourcesFunc: provider.GetAllWithPooledClient(getAllRoutingSettings), + } +} diff --git a/genesyscloud/resource_genesyscloud_routing_settings_test.go b/genesyscloud/routing_settings/resource_genesyscloud_routing_settings_test.go similarity index 98% rename from genesyscloud/resource_genesyscloud_routing_settings_test.go rename to genesyscloud/routing_settings/resource_genesyscloud_routing_settings_test.go index 96b87f348..2539787b7 100644 --- a/genesyscloud/resource_genesyscloud_routing_settings_test.go +++ b/genesyscloud/routing_settings/resource_genesyscloud_routing_settings_test.go @@ -1,4 +1,4 @@ -package genesyscloud +package routing_settings import ( "fmt" @@ -17,7 +17,7 @@ func TestAccResourceRoutingSettingsBasic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) }, - ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + ProviderFactories: provider.GetProviderFactories(providerResources, nil), Steps: []resource.TestStep{ { // Create @@ -57,7 +57,7 @@ func TestAccResourceRoutingSettingsContactCenter(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) }, - ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + ProviderFactories: provider.GetProviderFactories(providerResources, nil), Steps: []resource.TestStep{ { // Create with contact center @@ -102,7 +102,7 @@ func TestAccResourceRoutingSettingsTranscription(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) }, - ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + ProviderFactories: provider.GetProviderFactories(providerResources, nil), Steps: []resource.TestStep{ { // Create with transcription diff --git a/genesyscloud/tfexporter/tf_exporter_resource_test.go b/genesyscloud/tfexporter/tf_exporter_resource_test.go index 3af7a26ad..e9edddbbb 100644 --- a/genesyscloud/tfexporter/tf_exporter_resource_test.go +++ b/genesyscloud/tfexporter/tf_exporter_resource_test.go @@ -8,6 +8,8 @@ import ( flow "terraform-provider-genesyscloud/genesyscloud/architect_flow" flowLogLevel "terraform-provider-genesyscloud/genesyscloud/flow_loglevel" outboundContactListContact "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list_contact" + routingSettings "terraform-provider-genesyscloud/genesyscloud/routing_settings" + outboundRoute "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site_outbound_route" grammar "terraform-provider-genesyscloud/genesyscloud/architect_grammar" @@ -152,7 +154,7 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_routing_queue_conditional_group_routing"] = routingQueueConditionalGroupRouting.ResourceRoutingQueueConditionalGroupRouting() providerResources["genesyscloud_routing_queue_outbound_email_address"] = routingQueueOutboundEmailAddress.ResourceRoutingQueueOutboundEmailAddress() providerResources["genesyscloud_routing_skill"] = gcloud.ResourceRoutingSkill() - providerResources["genesyscloud_routing_settings"] = gcloud.ResourceRoutingSettings() + providerResources["genesyscloud_routing_settings"] = routingSettings.ResourceRoutingSettings() providerResources["genesyscloud_routing_utilization"] = gcloud.ResourceRoutingUtilization() providerResources["genesyscloud_routing_wrapupcode"] = gcloud.ResourceRoutingWrapupCode() @@ -264,7 +266,7 @@ func (r *registerTestInstance) registerTestExporters() { RegisterExporter("genesyscloud_routing_queue", routingQueue.RoutingQueueExporter()) RegisterExporter("genesyscloud_routing_queue_conditional_group_routing", routingQueueConditionalGroupRouting.RoutingQueueConditionalGroupRoutingExporter()) RegisterExporter("genesyscloud_routing_queue_outbound_email_address", routingQueueOutboundEmailAddress.OutboundRoutingQueueOutboundEmailAddressExporter()) - RegisterExporter("genesyscloud_routing_settings", gcloud.RoutingSettingsExporter()) + RegisterExporter("genesyscloud_routing_settings", routingSettings.RoutingSettingsExporter()) RegisterExporter("genesyscloud_routing_skill", gcloud.RoutingSkillExporter()) RegisterExporter("genesyscloud_routing_skill_group", gcloud.ResourceSkillGroupExporter()) RegisterExporter("genesyscloud_routing_sms_address", routingSmsAddress.RoutingSmsAddressExporter()) diff --git a/main.go b/main.go index af2bd8dc4..e8ce504d5 100644 --- a/main.go +++ b/main.go @@ -66,6 +66,7 @@ import ( routingQueueConditionalGroupRouting "terraform-provider-genesyscloud/genesyscloud/routing_queue_conditional_group_routing" routingQueueOutboundEmailAddress "terraform-provider-genesyscloud/genesyscloud/routing_queue_outbound_email_address" + routingSettings "terraform-provider-genesyscloud/genesyscloud/routing_settings" smsAddresses "terraform-provider-genesyscloud/genesyscloud/routing_sms_addresses" "terraform-provider-genesyscloud/genesyscloud/scripts" "terraform-provider-genesyscloud/genesyscloud/station" @@ -224,6 +225,7 @@ func registerResources() { routingQueueConditionalGroupRouting.SetRegistrar(regInstance) //Registering routing queue conditional group routing routingQueueOutboundEmailAddress.SetRegistrar(regInstance) //Registering routing queue outbound email address outboundContactListContact.SetRegistrar(regInstance) //Registering outbound contact list contact + routingSettings.SetRegistrar(regInstance) //Registering routing Settings journeyViews.SetRegistrar(regInstance) //Registering journey views // setting resources for Use cases like TF export where provider is used in resource classes. From 933f02e1ab02f22f0a1daa36589124021d969d7a Mon Sep 17 00:00:00 2001 From: dginty4 <108797778+dginty4@users.noreply.github.com> Date: Thu, 20 Jun 2024 14:43:51 +0100 Subject: [PATCH 19/62] DEVTOOLING-601: Queue member assignment taking long time (#1107) * Sped up member assignment * Used diag error wrapper --- .../resource_genesyscloud_routing_queue.go | 58 ++++++------------- 1 file changed, 17 insertions(+), 41 deletions(-) diff --git a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue.go b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue.go index 04f5a1450..f1133b919 100644 --- a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue.go +++ b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue.go @@ -1030,9 +1030,15 @@ func updateQueueMembers(d *schema.ResourceData, sdkConfig *platformclientv2.Conf if len(newUserIds) > 0 { log.Printf("Sleeping for 10 seconds") time.Sleep(10 * time.Second) + + members, diagErr := getRoutingQueueMembers(d.Id(), "group", sdkConfig) + if diagErr != nil { + return diagErr + } + for _, userId := range newUserIds { - if err := verifyUserIsNotGroupMemberOfQueue(d.Id(), userId, sdkConfig); err != nil { - log.Println(err.Error()) + if err := verifyUserIsNotGroupMemberOfQueue(d.Id(), userId, members); err != nil { + return util.BuildDiagnosticError(resourceName, "failed to update queue member: ", err) } } } @@ -1115,39 +1121,12 @@ func removeAllExistingUserMembersFromQueue(queueId string, sdkConfig *platformcl } // verifyUserIsNotGroupMemberOfQueue Search through queue group members to verify that a given user is not a group member -func verifyUserIsNotGroupMemberOfQueue(queueId, userId string, sdkConfig *platformclientv2.Configuration) error { - var ( - userName string - routingApi = platformclientv2.NewRoutingApiWithConfig(sdkConfig) - usersApi = platformclientv2.NewUsersApiWithConfig(sdkConfig) - ) - +func verifyUserIsNotGroupMemberOfQueue(queueId, userId string, members []platformclientv2.Queuemember) error { log.Printf("verifying that member '%s' is not assinged to the queue '%s' via a group", userId, queueId) - // Read name of user to filter results when listing members of queue - log.Printf("reading user %s to fetch name", userId) - user, _, err := usersApi.GetUser(userId, nil, "", "") - if err != nil { - log.Printf("Failed to read name of user '%s' inside verifyUserIsNotGroupMemberOfQueue: %s. Queue ID: %s", userId, err, queueId) - } else { - userName = *user.Name - log.Printf("read user %s %s", userId, userName) - } - - const pageSize = 100 - for pageNum := 1; ; pageNum++ { - users, resp, err := sdkGetRoutingQueueMembers(queueId, "group", userName, pageNum, pageSize, routingApi) - if err != nil || resp.StatusCode != http.StatusOK { - log.Printf("Error requesting group members of queue '%s': %v. Cannot validate that user '%s' is not already assigned via a group", queueId, err, userId) - break - } - if users == nil || users.Entities == nil || len(*users.Entities) == 0 { - break - } - for _, member := range *users.Entities { - if userId == *member.Id { - return fmt.Errorf("member %s '%s' is already assigned to queue '%s' via a group, and therefore should not be assigned as a member", userName, userId, queueId) - } + for _, member := range members { + if *member.Id == userId { + return fmt.Errorf("member %s is already assigned to queue %s via a group, and therefore should not be assigned as a member", userId, queueId) } } @@ -1207,25 +1186,25 @@ func getRoutingQueueMembers(queueID string, memberBy string, sdkConfig *platform log.Printf("%d members belong to queue %s", queueMembers, queueID) for pageNum := 1; ; pageNum++ { - users, resp, err := sdkGetRoutingQueueMembers(queueID, memberBy, "", pageNum, pageSize, api) + users, resp, err := sdkGetRoutingQueueMembers(queueID, memberBy, pageNum, pageSize, api) if err != nil || resp.StatusCode != http.StatusOK { return nil, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to query users for queue %s error: %s", queueID, err), resp) } if users == nil || users.Entities == nil || len(*users.Entities) == 0 { membersFound := len(members) log.Printf("%d queue members found for queue %s", membersFound, queueID) + if membersFound != queueMembers { log.Printf("Member count is not equal to queue member found for queue %s, Correlation Id: %s", queueID, resp.CorrelationID) } return members, nil } - for _, user := range *users.Entities { - members = append(members, user) - } + + members = append(members, *users.Entities...) } } -func sdkGetRoutingQueueMembers(queueID, memberBy, name string, pageNumber, pageSize int, api *platformclientv2.RoutingApi) (*platformclientv2.Queuememberentitylisting, *platformclientv2.APIResponse, error) { +func sdkGetRoutingQueueMembers(queueID, memberBy string, pageNumber, pageSize int, api *platformclientv2.RoutingApi) (*platformclientv2.Queuememberentitylisting, *platformclientv2.APIResponse, error) { // SDK does not support nil values for boolean query params yet, so we must manually construct this HTTP request for now apiClient := &api.Configuration.APIClient @@ -1254,9 +1233,6 @@ func sdkGetRoutingQueueMembers(queueID, memberBy, name string, pageNumber, pageS if memberBy != "" { queryParams["memberBy"] = memberBy } - if name != "" { - queryParams["name"] = name - } headerParams["Content-Type"] = "application/json" headerParams["Accept"] = "application/json" From b3d723492f0d0b0b05067e78f08fcf70be99d619 Mon Sep 17 00:00:00 2001 From: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Date: Thu, 20 Jun 2024 14:59:41 +0100 Subject: [PATCH 20/62] Fixes #1086 + some minor refactoring (#1111) --- ...source_genesyscloud_routing_skill_group.go | 100 +++++++++++------- ...e_genesyscloud_routing_skill_group_test.go | 4 +- ...source_genesyscloud_routing_skill_group.go | 88 +++++---------- 3 files changed, 89 insertions(+), 103 deletions(-) diff --git a/genesyscloud/data_source_genesyscloud_routing_skill_group.go b/genesyscloud/data_source_genesyscloud_routing_skill_group.go index 1acce6fbd..5bb30ae14 100644 --- a/genesyscloud/data_source_genesyscloud_routing_skill_group.go +++ b/genesyscloud/data_source_genesyscloud_routing_skill_group.go @@ -2,18 +2,14 @@ package genesyscloud import ( "context" - "encoding/json" "fmt" - "net/http" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "terraform-provider-genesyscloud/genesyscloud/provider" + "terraform-provider-genesyscloud/genesyscloud/util" + "time" ) func dataSourceRoutingSkillGroup() *schema.Resource { @@ -31,52 +27,74 @@ func dataSourceRoutingSkillGroup() *schema.Resource { } func dataSourceRoutingSkillGroupRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + var ( + resp *platformclientv2.APIResponse + err error + ) sdkConfig := m.(*provider.ProviderMeta).ClientConfig routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - name := d.Get("name").(string) - // Find first non-deleted skill by name. Retry in case new skill is not yet indexed by search - return util.WithRetries(ctx, 15*time.Second, func() *retry.RetryError { - for pageNum := 1; ; pageNum++ { - const pageSize = 100 + retryErr := util.WithRetries(ctx, 15*time.Second, func() *retry.RetryError { + var skillGroups []platformclientv2.Skillgroupdefinition + skillGroups, resp, err = getAllSkillGroupsByName(routingAPI, name) + if err != nil { + return retry.NonRetryableError(err) + } - apiClient := &routingAPI.Configuration.APIClient - path := routingAPI.Configuration.BasePath + "/api/v2/routing/skillgroups" + for _, skillGroup := range skillGroups { + if name == *skillGroup.Name { + d.SetId(*skillGroup.Id) + return nil + } + } - headerParams := buildHeaderParams(routingAPI) - response, err := apiClient.CallAPI(path, "GET", nil, headerParams, nil, nil, "", nil) + return retry.RetryableError(fmt.Errorf("failed to find skill group with name '%s'", name)) + }) - if err != nil { - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("error encountered while trying to retrieve routing skills group found with name %s | error: %s", name, err), response)) - } + if retryErr != nil { + msg := fmt.Sprintf("failed to read skill group by name %s: %v", name, retryErr) + if resp != nil { + return util.BuildAPIDiagnosticError(getSkillGroupResourceName(), msg, resp) + } + return util.BuildDiagnosticError(getSkillGroupResourceName(), msg, fmt.Errorf("%v", retryErr)) + } - if err == nil && response.Error != nil { - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("error encountered while trying to retrieve routing skills group found with name %s | error:%s", name, err), response)) - } - if err == nil && response.StatusCode == http.StatusNotFound { - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("routing skills group not found with name %s", name), response)) - } + return nil +} - allSkillGroups := &AllSkillGroups{} +func getAllSkillGroupsByName(api *platformclientv2.RoutingApi, name string) ([]platformclientv2.Skillgroupdefinition, *platformclientv2.APIResponse, error) { + const pageSize = 100 + var ( + after string + allSkillGroups []platformclientv2.Skillgroupdefinition + ) + + for { + skillGroups, resp, err := api.GetRoutingSkillgroups(pageSize, name, after, "") + if err != nil { + return nil, resp, err + } - err = json.Unmarshal(response.RawBody, &allSkillGroups) - if err != nil { - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("error encountered while trying to retrieve routing skills group found with name %s %s", name, err), response)) - } + if skillGroups.Entities == nil || len(*skillGroups.Entities) == 0 { + break + } - if allSkillGroups.Entities == nil || len(allSkillGroups.Entities) == 0 { - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("no routing skills groups found with name %s", name), response)) - } + allSkillGroups = append(allSkillGroups, *skillGroups.Entities...) - for _, skillGroup := range allSkillGroups.Entities { - if skillGroup.Name == name { - d.SetId(skillGroup.ID) - return nil - } - } + if skillGroups.NextUri == nil || *skillGroups.NextUri == "" { + break } - }) + after, err = util.GetQueryParamValueFromUri(*skillGroups.NextUri, "after") + if err != nil { + return nil, nil, fmt.Errorf("error parsing NextUri '%s' while reading skill groups: %v", *skillGroups.NextUri, err) + } + if after == "" { + break + } + } + + return allSkillGroups, nil, nil } diff --git a/genesyscloud/data_source_genesyscloud_routing_skill_group_test.go b/genesyscloud/data_source_genesyscloud_routing_skill_group_test.go index a059ca33f..834da4175 100644 --- a/genesyscloud/data_source_genesyscloud_routing_skill_group_test.go +++ b/genesyscloud/data_source_genesyscloud_routing_skill_group_test.go @@ -47,9 +47,9 @@ func generateRoutingSkillGroupDataSource( // Must explicitly use depends_on in terraform v0.13 when a data source references a resource // Fixed in v0.14 https://github.com/hashicorp/terraform/pull/26284 dependsOnResource string) string { - return fmt.Sprintf(`data "genesyscloud_routing_skill_group" "%s" { + return fmt.Sprintf(`data "%s" "%s" { name = %s depends_on=[%s] } - `, resourceID, name, dependsOnResource) + `, getSkillGroupResourceName(), resourceID, name, dependsOnResource) } diff --git a/genesyscloud/resource_genesyscloud_routing_skill_group.go b/genesyscloud/resource_genesyscloud_routing_skill_group.go index 28886af01..c16f83937 100644 --- a/genesyscloud/resource_genesyscloud_routing_skill_group.go +++ b/genesyscloud/resource_genesyscloud_routing_skill_group.go @@ -34,54 +34,18 @@ type SkillGroupsRequest struct { SkillConditions struct{} `json:"skillConditions"` //Keep this here. Even though we do not use this field in the struct The generated attributed is used as a placeholder } -type AllSkillGroups struct { - Entities []struct { - ID string `json:"id"` - Name string `json:"name"` - } - NextURI string `json:"nextUri"` - SelfURI string `json:"selfUri"` - PreviousURI string `json:"previousUri"` -} - -func getAllSkillGroups(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { +func getAllSkillGroups(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { resources := make(resourceExporter.ResourceIDMetaMap) routingAPI := platformclientv2.NewRoutingApiWithConfig(clientConfig) - apiClient := &routingAPI.Configuration.APIClient - route := "/api/v2/routing/skillgroups" - - headerParams := buildHeaderParams(routingAPI) - - for { - path := routingAPI.Configuration.BasePath + route - skillGroupPayload := &AllSkillGroups{} - - response, err := apiClient.CallAPI(path, "GET", nil, headerParams, nil, nil, "", nil) - - if err != nil { - return nil, util.BuildAPIDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Failed to get page of skill groups error: %s", err), response) - } - - err = json.Unmarshal(response.RawBody, &skillGroupPayload) - if err != nil { - return nil, util.BuildDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Failed to unmarshal skill groups"), err) - } - - if skillGroupPayload.Entities == nil || len(skillGroupPayload.Entities) == 0 { - break - } - - for _, skillGroup := range skillGroupPayload.Entities { - - resources[skillGroup.ID] = &resourceExporter.ResourceMeta{Name: skillGroup.Name} - } - if route == skillGroupPayload.NextURI || skillGroupPayload.NextURI == "" { - break - } else { - route = skillGroupPayload.NextURI - } + allSkillGroups, resp, err := getAllSkillGroupsByName(routingAPI, "") + if err != nil { + msg := fmt.Sprintf("failed to read skill groups: %v", err) + return nil, util.BuildAPIDiagnosticError(getSkillGroupResourceName(), msg, resp) + } + for _, skillGroup := range allSkillGroups { + resources[*skillGroup.Id] = &resourceExporter.ResourceMeta{Name: *skillGroup.Name} } return resources, nil @@ -101,6 +65,10 @@ func ResourceSkillGroupExporter() *resourceExporter.ResourceExporter { } } +func getSkillGroupResourceName() string { + return "genesyscloud_routing_skill_group" +} + func ResourceRoutingSkillGroup() *schema.Resource { return &schema.Resource{ Description: `Genesys Cloud Skill Group`, @@ -174,7 +142,7 @@ func createOrUpdateSkillGroups(ctx context.Context, d *schema.ResourceData, meta //Merge in skill conditions finalSkillGroupsJson, err := mergeSkillConditionsIntoSkillGroups(d, skillGroupsRequest) if err != nil { - return util.BuildDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Failed to read the before skills groups request before: %s", skillGroupsRequest.Name), err) + return util.BuildDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf("Failed to read the before skills groups request before: %s", skillGroupsRequest.Name), err) } sdkConfig := meta.(*provider.ProviderMeta).ClientConfig @@ -190,7 +158,7 @@ func createOrUpdateSkillGroups(ctx context.Context, d *schema.ResourceData, meta var skillGroupsPayload map[string]interface{} err = json.Unmarshal([]byte(finalSkillGroupsJson), &skillGroupsPayload) if err != nil { - return util.BuildDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Failed to unmarshal the JSON payload while creating/updating the skills group %s", skillGroupsRequest.Name), err) + return util.BuildDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf("Failed to unmarshal the JSON payload while creating/updating the skills group %s", skillGroupsRequest.Name), err) } httpMethod := "POST" @@ -200,14 +168,14 @@ func createOrUpdateSkillGroups(ctx context.Context, d *schema.ResourceData, meta response, err := apiClient.CallAPI(path, httpMethod, skillGroupsPayload, headerParams, nil, nil, "", nil) if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Failed to create/update skill groups %s error: %s", skillGroupsRequest.Name, err), response) + return util.BuildAPIDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf("Failed to create/update skill groups %s error: %s", skillGroupsRequest.Name, err), response) } //Get the results and pull out the id skillGroupPayload := make(map[string]interface{}) err = json.Unmarshal(response.RawBody, &skillGroupPayload) if err != nil { - return util.BuildDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Failed to unmarshal skill groups"), err) + return util.BuildDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf("Failed to unmarshal skill groups"), err) } if create == true { @@ -270,7 +238,7 @@ func postSkillGroupMemberDivisions(ctx context.Context, d *schema.ResourceData, path := fmt.Sprintf("%s/api/v2/routing/skillgroups/%s/members/divisions", routingAPI.Configuration.BasePath, d.Id()) response, err := apiClient.CallAPI(path, "POST", skillGroupsMemberDivisionIdsPayload, headerParams, nil, nil, "", nil) if err != nil || response.Error != nil { - return util.BuildAPIDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Failed to create/update skill group %s member divisions error: %s", d.Id(), err), response) + return util.BuildAPIDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf("Failed to create/update skill group %s member divisions error: %s", d.Id(), err), response) } log.Printf("Updated skill group %s member divisions", name) @@ -300,7 +268,7 @@ func createListsForSkillgroupsMembersDivisionsPost(schemaMemberDivisionIds []str if allMemberDivisionsSpecified(schemaMemberDivisionIds) { if len(schemaMemberDivisionIds) > 1 { - return nil, nil, util.BuildDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf(`member_division_ids should not contain more than one item when the value of an item is "*"`), fmt.Errorf(`member_division_ids should not contain more than one item when the value of an item is "*"`)) + return nil, nil, util.BuildDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf(`member_division_ids should not contain more than one item when the value of an item is "*"`), fmt.Errorf(`member_division_ids should not contain more than one item when the value of an item is "*"`)) } toAdd, err := getAllAuthDivisionIds(meta) return toAdd, nil, err @@ -371,11 +339,11 @@ func readSkillGroups(ctx context.Context, d *schema.ResourceData, meta interface response, err := apiClient.CallAPI(path, "GET", nil, headerParams, nil, nil, "", nil) if err != nil { - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Failed to retrieve skill groups %s", err), response)) + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf("Failed to retrieve skill groups %s", err), response)) } if err == nil && response.Error != nil && response.StatusCode != http.StatusNotFound { - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Failed to retrieve skill groups. %s", err), response)) + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf("Failed to retrieve skill groups. %s", err), response)) } err = json.Unmarshal(response.RawBody, &skillGroupPayload) @@ -384,7 +352,7 @@ func readSkillGroups(ctx context.Context, d *schema.ResourceData, meta interface } if err == nil && util.IsStatus404(response) { - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Failed to read skill groups %s | error: %s", d.Id(), err), response)) + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf("Failed to read skill groups %s | error: %s", d.Id(), err), response)) } name := skillGroupPayload["name"] @@ -481,7 +449,7 @@ func deleteSkillGroups(ctx context.Context, d *schema.ResourceData, meta interfa log.Printf("Skills Group was already deleted %s", d.Id()) return nil } - return util.BuildAPIDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Failed to delete skill group %s error: %s", d.Id(), err), response) + return util.BuildAPIDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf("Failed to delete skill group %s error: %s", d.Id(), err), response) } return util.WithRetries(ctx, 30*time.Second, func() *retry.RetryError { @@ -494,9 +462,9 @@ func deleteSkillGroups(ctx context.Context, d *schema.ResourceData, meta interfa log.Printf("Deleted skills group %s", d.Id()) return nil } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Error deleting skill group %s | error: %s", d.Id(), err), response)) + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf("Error deleting skill group %s | error: %s", d.Id(), err), response)) } - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Skill group %s still exists", d.Id()), response)) + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf("Skill group %s still exists", d.Id()), response)) }) } @@ -509,13 +477,13 @@ func readSkillGroupMemberDivisionIds(d *schema.ResourceData, routingAPI *platfor response, err := apiClient.CallAPI(path, "GET", nil, headers, nil, nil, "", nil) if err != nil || response.Error != nil { - return nil, util.BuildAPIDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Failed to get member divisions for skill group %s error: %s", d.Id(), err), response) + return nil, util.BuildAPIDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf("Failed to get member divisions for skill group %s error: %s", d.Id(), err), response) } memberDivisionsPayload := make(map[string]interface{}, 0) err = json.Unmarshal(response.RawBody, &memberDivisionsPayload) if err != nil { - return nil, util.BuildDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Failed to unmarshal member divisions"), err) + return nil, util.BuildDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf("Failed to unmarshal member divisions"), err) } apiSkillGroupMemberDivisionIds := make([]string, 0) @@ -593,9 +561,9 @@ func GenerateRoutingSkillGroupResourceBasic( resourceID string, name string, description string) string { - return fmt.Sprintf(`resource "genesyscloud_routing_skill_group" "%s" { + return fmt.Sprintf(`resource "%s" "%s" { name = "%s" description="%s" } - `, resourceID, name, description) + `, getSkillGroupResourceName(), resourceID, name, description) } From 8cc3bf440cafd79574a81c646ff44850831ea398 Mon Sep 17 00:00:00 2001 From: shrutisuryawanshigenesys Date: Thu, 20 Jun 2024 10:00:24 -0400 Subject: [PATCH 21/62] Feat/devtooling 618 (#1083) * code for compression * added compression logic in generateoutput func * added fields compress and passphrase * removed passphrase flag * updated docs * moved the compression logic to a function * added test case for compress flag * comments resolved * updated docs * resolved comments --- docs/resources/tf_export.md | 1 + ..._recording_media_retention_policy_proxy.go | 3 +- .../data_source_genesyscloud_routing_queue.go | 3 +- .../genesyscloud_resource_exporter.go | 55 +++++++ .../resource_genesyscloud_tf_export.go | 15 +- .../resource_genesyscloud_tf_export_test.go | 138 ++++++++++++++++++ 6 files changed, 212 insertions(+), 3 deletions(-) diff --git a/docs/resources/tf_export.md b/docs/resources/tf_export.md index 4fbff2237..b68964897 100644 --- a/docs/resources/tf_export.md +++ b/docs/resources/tf_export.md @@ -60,6 +60,7 @@ resource "genesyscloud_tf_export" "export" { ### Optional +- `compress` (Boolean) Compress exported results using zip format Defaults to `false`. - `directory` (String) Directory where the config and state files will be exported. Defaults to `./genesyscloud`. - `enable_dependency_resolution` (Boolean) Adds a "depends_on" attribute to genesyscloud_flow resources with a list of resources that are referenced inside the flow configuration . This also resolves and exports all the dependent resources for any given resource. Defaults to `false`. - `exclude_attributes` (List of String) Attributes to exclude from the config when exporting resources. Each value should be of the form {resource_name}.{attribute}, e.g. 'genesyscloud_user.skills'. Excluded attributes must be optional. diff --git a/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_proxy.go b/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_proxy.go index 0a9511ef9..345294b53 100644 --- a/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_proxy.go +++ b/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_proxy.go @@ -4,9 +4,10 @@ import ( "context" "encoding/json" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "net/http" "net/url" + + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/routing_queue/data_source_genesyscloud_routing_queue.go b/genesyscloud/routing_queue/data_source_genesyscloud_routing_queue.go index b5f6e49b5..cd47befaa 100644 --- a/genesyscloud/routing_queue/data_source_genesyscloud_routing_queue.go +++ b/genesyscloud/routing_queue/data_source_genesyscloud_routing_queue.go @@ -11,10 +11,11 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" - rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" ) var ( diff --git a/genesyscloud/tfexporter/genesyscloud_resource_exporter.go b/genesyscloud/tfexporter/genesyscloud_resource_exporter.go index cbfdba572..abf75169a 100644 --- a/genesyscloud/tfexporter/genesyscloud_resource_exporter.go +++ b/genesyscloud/tfexporter/genesyscloud_resource_exporter.go @@ -1,10 +1,14 @@ package tfexporter import ( + "archive/zip" "context" "fmt" "hash/fnv" + "io" "log" + "os" + "path" "path/filepath" "reflect" "regexp" @@ -480,6 +484,57 @@ func (g *GenesysCloudResourceExporter) generateOutputFiles() diag.Diagnostics { } } + err = g.generateZipForExporter() + if err != nil { + return err + } + + return nil +} + +func (g *GenesysCloudResourceExporter) generateZipForExporter() diag.Diagnostics { + zipFileName := "../archive_genesyscloud_tf_export" + uuid.NewString() + ".zip" + if compress := g.d.Get("compress").(bool); compress { //if true, compress directory name of where the export is going to occur + // read all the files + var files []fileMeta + ferr := filepath.Walk(g.exportDirPath, func(path string, info os.FileInfo, ferr error) error { + files = append(files, fileMeta{Path: path, IsDir: info.IsDir()}) + return nil + }) + if ferr != nil { + return diag.Errorf("Failed to fetch file path %s", ferr) + } + // create a zip + archive, ferr := os.Create(zipFileName) + if ferr != nil { + return diag.Errorf("Failed to create zip %s", ferr) + } + defer archive.Close() + zipWriter := zip.NewWriter(archive) + + for _, f := range files { + if !f.IsDir { + fPath := f.Path + + w, ferr := zipWriter.Create(path.Base(fPath)) + if ferr != nil { + return diag.Errorf("Failed to create base path for zip %s", ferr) + } + + file, ferr := os.Open(f.Path) + if ferr != nil { + return diag.Errorf("Failed to open the original file %s", ferr) + } + defer file.Close() + + if _, ferr = io.Copy(w, file); ferr != nil { + return diag.Errorf("Failed to copy the file to zip %s", ferr) + } + } + } + zipWriter.Close() + } + return nil } diff --git a/genesyscloud/tfexporter/resource_genesyscloud_tf_export.go b/genesyscloud/tfexporter/resource_genesyscloud_tf_export.go index 9ed87e0e5..44b727ab7 100644 --- a/genesyscloud/tfexporter/resource_genesyscloud_tf_export.go +++ b/genesyscloud/tfexporter/resource_genesyscloud_tf_export.go @@ -11,11 +11,17 @@ import ( registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" + "terraform-provider-genesyscloud/genesyscloud/tfexporter_state" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "terraform-provider-genesyscloud/genesyscloud/tfexporter_state" ) +type fileMeta struct { + Path string + IsDir bool +} + func SetRegistrar(l registrar.Registrar) { l.RegisterResource("genesyscloud_tf_export", ResourceTfExport()) @@ -134,6 +140,13 @@ func ResourceTfExport() *schema.Resource { Default: true, ForceNew: true, }, + "compress": { + Description: "Compress exported results using zip format", + Type: schema.TypeBool, + Optional: true, + Default: false, + ForceNew: true, + }, }, } } diff --git a/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go b/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go index ed0a0711f..ac69c388b 100644 --- a/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go +++ b/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go @@ -1,6 +1,8 @@ package tfexporter import ( + "archive/zip" + "bytes" "encoding/json" "fmt" "io" @@ -459,6 +461,39 @@ func TestAccResourceTfExportSplitFilesAsJSON(t *testing.T) { }) } +// TestAccResourceTfExportForCompress does a basic test check to make sure the compressed file is created. +func TestAccResourceTfExportForCompress(t *testing.T) { + var ( + exportTestDir = "../../.terraform" + uuid.NewString() + exportResource1 = "test-export1" + zipFileName = "../archive_genesyscloud_tf_export*" + ) + + defer os.RemoveAll(exportTestDir) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { util.TestAccPreCheck(t) }, + ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + Steps: []resource.TestStep{ + { + // Run export without state file + Config: generateTfExportResourceForCompress( + exportResource1, + exportTestDir, + util.TrueValue, + util.TrueValue, + "", + ), + Check: resource.ComposeTestCheckFunc( + validateCompressedCreated(zipFileName), + validateCompressedFile(zipFileName), + ), + }, + }, + CheckDestroy: deleteTestCompressedZip(exportTestDir, zipFileName), + }) +} + // TestAccResourceTfExport does a basic test check to make sure the export file is created. func TestAccResourceTfExport(t *testing.T) { var ( @@ -2304,6 +2339,25 @@ func generateTfExportResource( `, resourceID, directory, includeState, excludedAttributes) } +// generateTfExportResourceForCompress creates a resource to test compressed exported results +func generateTfExportResourceForCompress( + resourceID string, + directory string, + includeState string, + compressFlag string, + excludedAttributes string) string { + return fmt.Sprintf(`resource "genesyscloud_tf_export" "%s" { + directory = "%s" + include_state_file = %s + compress=%s + resource_types = [ + "genesyscloud_architect_datatable", + ] + exclude_attributes = [%s] + } + `, resourceID, directory, includeState, compressFlag, excludedAttributes) +} + func generateTfExportResourceMin( resourceID string, directory string, @@ -2428,6 +2482,40 @@ func validateFileCreated(filename string) resource.TestCheckFunc { } } +func validateCompressedCreated(filename string) resource.TestCheckFunc { + return func(state *terraform.State) error { + _, err := filepath.Glob(filename) + if err != nil { + return fmt.Errorf("Failed to find file") + } + return nil + } +} + +func deleteTestCompressedZip(exportPath string, zipFileName string) resource.TestCheckFunc { + return func(state *terraform.State) error { + dir, err := os.ReadDir(exportPath) + if err != nil { + return fmt.Errorf("Failed to read compressed zip %s", exportPath) + } + for _, d := range dir { + os.RemoveAll(filepath.Join(exportPath, d.Name())) + } + files, err := filepath.Glob(zipFileName) + + if err != nil { + return fmt.Errorf("Failed to get zip: %s", err) + } + for _, f := range files { + if err := os.Remove(f); err != nil { + return fmt.Errorf("Failed to delete: %s", err) + } + } + + return nil + } +} + func testVerifyExportsDestroyedFunc(exportTestDir string) resource.TestCheckFunc { return func(state *terraform.State) error { // Check config file deleted @@ -2462,6 +2550,56 @@ func validateEvaluationFormAttributes(resourceName string, form gcloud.Evaluatio ) } +// validateCompressedFile unzips and validates the exported resulted in the compressed folder +func validateCompressedFile(path string) resource.TestCheckFunc { + return func(state *terraform.State) error { + files, err := filepath.Glob(path) + if err != nil { + return err + } + for _, f := range files { + reader, err := zip.OpenReader(f) + if err != nil { + return err + } + for _, file := range reader.File { + err = validateCompressedConfigFiles(f, file) + if err != nil { + return err + } + } + } + return nil + } +} + +// validateCompressedConfigFiles validates the data inside the compressed json file +func validateCompressedConfigFiles(dirName string, file *zip.File) error { + + if file.FileInfo().Name() == defaultTfJSONFile { + rc, _ := file.Open() + + buf := new(bytes.Buffer) + buf.ReadFrom(rc) + var data map[string]interface{} + + if err := json.Unmarshal(buf.Bytes(), &data); err != nil { + return fmt.Errorf("failed to unmarshal json exportData to map variable: %v", err) + } + + if _, ok := data["resource"]; !ok { + return fmt.Errorf("config file missing resource attribute") + } + + if _, ok := data["terraform"]; !ok { + return fmt.Errorf("config file missing terraform attribute") + } + rc.Close() + return nil + } + return nil +} + func validateConfigFile(path string) resource.TestCheckFunc { return func(state *terraform.State) error { result, err := loadJsonFileToMap(path) From 02b93a8e39b8b72ed8c77d73d548ac3e69320bf0 Mon Sep 17 00:00:00 2001 From: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Date: Sat, 22 Jun 2024 12:50:10 +0100 Subject: [PATCH 22/62] commenting RefAttr in trunkbasesettings exporter to fix unit test (#1115) --- ...enesyscloud_telephony_providers_edges_trunkbasesettings.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings.go b/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings.go index a7d109954..e81844e03 100644 --- a/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings.go +++ b/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings.go @@ -403,8 +403,8 @@ func ValidateInboundSiteSettings(inboundSiteString string, trunkBaseMetaId strin func TrunkBaseSettingsExporter() *resourceExporter.ResourceExporter { return &resourceExporter.ResourceExporter{ GetResourcesFunc: provider.GetAllWithPooledClient(getAllTrunkBaseSettings), - RefAttrs: map[string]*resourceExporter.RefAttrSettings{ - "inbound_site_id": {RefType: "genesyscloud_telephony_providers_edges_site"}, + RefAttrs: map[string]*resourceExporter.RefAttrSettings{ + //"inbound_site_id": {RefType: "genesyscloud_telephony_providers_edges_site"}, TODO: decide how/if this will be included after DEVTOOLING-676 is resolved }, JsonEncodeAttributes: []string{"properties"}, } From 55d63ce140c566a20c265bb8236ab819b50059b0 Mon Sep 17 00:00:00 2001 From: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Date: Mon, 24 Jun 2024 14:40:44 +0530 Subject: [PATCH 23/62] Merge unit tests & fix failing testcases (#1116) * run unit tests * run unit tests * add unit test * Fix failing tests * fix failed tests * Fix failing tests * Fix webdeployment testcases * Fix webdeployment testcases * Run remaining unit tests * Revert export changes * Fix export tests * Fix widget tests * Modify to delete list of didpool --------- Co-authored-by: Monisha Padmavathi Ragavan --- ...urce_genesyscloud_routing_language_test.go | 6 ++ ...rce_genesyscloud_widget_deployment_test.go | 10 ++- ...esource_genesyscloud_auth_division_test.go | 3 + ...e_genesyscloud_routing_skill_group_test.go | 73 +++++++++++++++++- ...rce_genesyscloud_widget_deployment_test.go | 4 +- ...esource_genesyscloud_routing_queue_test.go | 67 ++++++++++++++++ ...ng_queue_conditional_group_routing_test.go | 1 + ...ud_telephony_providers_edges_phone_test.go | 77 +++++++++++++------ .../resource_genesyscloud_tf_export_test.go | 3 + jenkins/tests/Jenkinsfile | 37 +++++++-- 10 files changed, 241 insertions(+), 40 deletions(-) diff --git a/genesyscloud/data_source_genesyscloud_routing_language_test.go b/genesyscloud/data_source_genesyscloud_routing_language_test.go index 9d6eebb2a..018c1d2e9 100644 --- a/genesyscloud/data_source_genesyscloud_routing_language_test.go +++ b/genesyscloud/data_source_genesyscloud_routing_language_test.go @@ -21,6 +21,12 @@ func TestAccDataSourceRoutingLanguage(t *testing.T) { PreCheck: func() { util.TestAccPreCheck(t) }, ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), Steps: []resource.TestStep{ + { + Config: GenerateRoutingLanguageResource( + langResource, + langName, + ), + }, { Config: GenerateRoutingLanguageResource( langResource, diff --git a/genesyscloud/data_source_genesyscloud_widget_deployment_test.go b/genesyscloud/data_source_genesyscloud_widget_deployment_test.go index 874bd96d5..ce1ce1b6d 100644 --- a/genesyscloud/data_source_genesyscloud_widget_deployment_test.go +++ b/genesyscloud/data_source_genesyscloud_widget_deployment_test.go @@ -2,6 +2,7 @@ package genesyscloud import ( "fmt" + "strconv" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "testing" @@ -16,12 +17,13 @@ func TestAccDataSourceWidgetDeployment(t *testing.T) { widgetDeploymentsDataSource = "widget-deployments-data" widgetDeploymentsName = "Widget_deployments-" ) - + description := "This is a test description" + flowId := uuid.NewString() widgetDeployV1 := &widgetDeploymentConfig{ resourceID: widgegetDeploymentsResource, - name: widgetDeploymentsName + uuid.NewString(), - description: "This is a test description", - flowID: uuid.NewString(), + name: widgetDeploymentsName, + description: strconv.Quote(description), + flowID: strconv.Quote(flowId), clientType: V2, authenticationRequired: "true", disabled: "true", diff --git a/genesyscloud/resource_genesyscloud_auth_division_test.go b/genesyscloud/resource_genesyscloud_auth_division_test.go index 3718f7d99..cebf83c42 100644 --- a/genesyscloud/resource_genesyscloud_auth_division_test.go +++ b/genesyscloud/resource_genesyscloud_auth_division_test.go @@ -30,6 +30,9 @@ func TestAccResourceAuthDivisionBasic(t *testing.T) { ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), Steps: []resource.TestStep{ { + PreConfig: func() { + time.Sleep(30 * time.Second) + }, // Create Config: GenerateAuthDivisionResource( divResource1, diff --git a/genesyscloud/resource_genesyscloud_routing_skill_group_test.go b/genesyscloud/resource_genesyscloud_routing_skill_group_test.go index ee5bd2120..378de4ccc 100644 --- a/genesyscloud/resource_genesyscloud_routing_skill_group_test.go +++ b/genesyscloud/resource_genesyscloud_routing_skill_group_test.go @@ -391,7 +391,6 @@ data "genesyscloud_auth_division_home" "home" {} 3. Verify the skill group added those users when they match the skill expression. */ func TestAccResourceRoutingSkillGroupMemberDivisionsUsersAssigned(t *testing.T) { - t.Parallel() var ( skillGroupResourceId = "testskillgroup3" skillGroupName = "testskillgroup3 " + uuid.NewString() @@ -422,6 +421,9 @@ func TestAccResourceRoutingSkillGroupMemberDivisionsUsersAssigned(t *testing.T) "genesyscloud_auth_division." + division2ResourceId + ".id", "genesyscloud_auth_division." + division3ResourceId + ".id", } + userID1 string + userID2 string + userID3 string ) routingSkillResource := GenerateRoutingSkillResource(routingSkillResourceId, routingSkillName) @@ -501,6 +503,9 @@ resource "genesyscloud_routing_skill_group" "%s" { ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), Steps: []resource.TestStep{ { + PreConfig: func() { + time.Sleep(30 * time.Second) + }, Config: skillGroupResource + routingSkillResource + division1Resource + @@ -511,6 +516,25 @@ resource "genesyscloud_routing_skill_group" "%s" { user3Resource, Check: resource.ComposeTestCheckFunc( testVerifySkillGroupMemberCount("genesyscloud_routing_skill_group."+skillGroupResourceId, "3"), + func(s *terraform.State) error { + rs, ok := s.RootModule().Resources["genesyscloud_user."+user1ResourceId] + if !ok { + return fmt.Errorf("not found: %s", "genesyscloud_user."+user1ResourceId) + } + userID1 = rs.Primary.ID + log.Printf("User ID: %s\n", userID1) // Print user ID + rs, ok = s.RootModule().Resources["genesyscloud_user."+user2ResourceId] + if !ok { + return fmt.Errorf("not found: %s", "genesyscloud_user."+user2ResourceId) + } + userID2 = rs.Primary.ID + rs, ok = s.RootModule().Resources["genesyscloud_user."+user3ResourceId] + if !ok { + return fmt.Errorf("not found: %s", "genesyscloud_user."+user3ResourceId) + } + userID3 = rs.Primary.ID + return nil + }, ), }, { @@ -518,6 +542,11 @@ resource "genesyscloud_routing_skill_group" "%s" { ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{"member_division_ids"}, + Check: resource.ComposeTestCheckFunc( + checkUserDeleted(userID1), + checkUserDeleted(userID2), + checkUserDeleted(userID3), + ), }, }, CheckDestroy: testVerifySkillGroupDestroyed, @@ -761,3 +790,45 @@ func getAllSkillGroupMemberDivisionIds(routingAPI *platformclientv2.RoutingApi, return apiSkillGroupMemberDivisionIds, nil } + +func checkUserDeleted(id string) resource.TestCheckFunc { + log.Printf("Fetching user with ID: %s\n", id) + return func(s *terraform.State) error { + maxAttempts := 18 + for i := 0; i < maxAttempts; i++ { + + deleted, err := isUserDeleted(id) + if err != nil { + return err + } + if deleted { + return nil + } + time.Sleep(10 * time.Second) + } + return fmt.Errorf("user %s was not deleted properly", id) + } +} + +func isUserDeleted(id string) (bool, error) { + mu.Lock() + defer mu.Unlock() + + usersAPI := platformclientv2.NewUsersApiWithConfig(sdkConfig) + // Attempt to get the user + _, response, err := usersAPI.GetUser(id, nil, "", "") + + // Check if the user is not found (deleted) + if response != nil && response.StatusCode == 404 { + return true, nil // User is deleted + } + + // Handle other errors + if err != nil { + log.Printf("Error fetching user: %v", err) + return false, err + } + + // If user is found, it means the user is not deleted + return false, nil +} diff --git a/genesyscloud/resource_genesyscloud_widget_deployment_test.go b/genesyscloud/resource_genesyscloud_widget_deployment_test.go index 27b72d1c3..2f4b56c25 100644 --- a/genesyscloud/resource_genesyscloud_widget_deployment_test.go +++ b/genesyscloud/resource_genesyscloud_widget_deployment_test.go @@ -54,8 +54,8 @@ func generateWidgetDeploymentResource(wdConfig *widgetDeploymentConfig) string { } return fmt.Sprintf(`resource "genesyscloud_widget_deployment" "%s" { name = "%s" - description = %s - flow_id = %s + description = %s + flow_id = %s client_type = "%s" authentication_required = %s disabled = %s diff --git a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go index b59182aab..f212f3e3e 100644 --- a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go +++ b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go @@ -5,6 +5,7 @@ import ( "log" "strconv" "strings" + "sync" "terraform-provider-genesyscloud/genesyscloud" "terraform-provider-genesyscloud/genesyscloud/architect_flow" "terraform-provider-genesyscloud/genesyscloud/group" @@ -20,6 +21,11 @@ import ( "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) +var ( + sdkConfig *platformclientv2.Configuration + mu sync.Mutex +) + func TestAccResourceRoutingQueueBasic(t *testing.T) { var ( queueResource1 = "test-queue" @@ -681,6 +687,10 @@ func TestAccResourceRoutingQueueMembers(t *testing.T) { ), }, { + PreConfig: func() { + // Wait for a specified duration to avoid runtime error + time.Sleep(30 * time.Second) + }, // Update with another queue member and modify rings Config: genesyscloud.GenerateBasicUserResource( queueMemberResource1, @@ -1088,6 +1098,7 @@ func TestAccResourceRoutingQueueMembersOutsideOfConfig(t *testing.T) { userEmail = fmt.Sprintf("user%s@test.com", strings.Replace(uuid.NewString(), "-", "", -1)) queueResourceId = "queue" queueName = "tf test queue " + uuid.NewString() + userID string ) queueResource := fmt.Sprintf(` @@ -1116,12 +1127,26 @@ resource "genesyscloud_user" "%s" { { Config: queueResource + userResource, ExpectNonEmptyPlan: false, + Check: resource.ComposeTestCheckFunc( + func(s *terraform.State) error { + rs, ok := s.RootModule().Resources["genesyscloud_user."+userResourceId] + if !ok { + return fmt.Errorf("not found: %s", "genesyscloud_user."+userResourceId) + } + userID = rs.Primary.ID + log.Printf("User ID: %s\n", userID) // Print user ID + return nil + }, + ), }, { // Import/Read ResourceName: "genesyscloud_routing_queue." + queueResourceId, ImportState: true, ImportStateVerify: true, + Check: resource.ComposeTestCheckFunc( + checkUserDeleted(userID), + ), }, }, CheckDestroy: testVerifyQueuesDestroyed, @@ -1477,3 +1502,45 @@ func generateUserWithCustomAttrs(resourceID string, email string, name string, a } `, resourceID, email, name, strings.Join(attrs, "\n")) } + +func checkUserDeleted(id string) resource.TestCheckFunc { + log.Printf("Fetching user with ID: %s\n", id) + return func(s *terraform.State) error { + maxAttempts := 18 + for i := 0; i < maxAttempts; i++ { + + deleted, err := isUserDeleted(id) + if err != nil { + return err + } + if deleted { + return nil + } + time.Sleep(10 * time.Second) + } + return fmt.Errorf("user %s was not deleted properly", id) + } +} + +func isUserDeleted(id string) (bool, error) { + mu.Lock() + defer mu.Unlock() + + usersAPI := platformclientv2.NewUsersApiWithConfig(sdkConfig) + // Attempt to get the user + _, response, err := usersAPI.GetUser(id, nil, "", "") + + // Check if the user is not found (deleted) + if response != nil && response.StatusCode == 404 { + return true, nil // User is deleted + } + + // Handle other errors + if err != nil { + log.Printf("Error fetching user: %v", err) + return false, err + } + + // If user is found, it means the user is not deleted + return false, nil +} diff --git a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_test.go b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_test.go index a8abe0fa1..dadf085c8 100644 --- a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_test.go +++ b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_test.go @@ -330,6 +330,7 @@ func generateUserWithCustomAttrs(resourceID string, email string, name string, a } `, resourceID, email, name, strings.Join(attrs, "\n")) } + func checkUserDeleted(id string) resource.TestCheckFunc { log.Printf("Fetching user with ID: %s\n", id) return func(s *terraform.State) error { diff --git a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go index 772ae6f4f..c01d7e3ed 100644 --- a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go +++ b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go @@ -188,6 +188,7 @@ func TestAccResourcePhoneBasic(t *testing.T) { func TestAccResourcePhoneStandalone(t *testing.T) { number := "+12005538112" + deleteDidPoolWithNumber(number) didPoolResource1 := "test-didpool1" lineAddresses := []string{number} phoneRes := "phone_standalone1234" @@ -245,29 +246,6 @@ func TestAccResourcePhoneStandalone(t *testing.T) { "mac", []string{}, ) - config := didPool.GenerateDidPoolResource(&didPool.DidPoolStruct{ - ResourceID: didPoolResource1, - StartPhoneNumber: lineAddresses[0], - EndPhoneNumber: lineAddresses[0], - Description: util.NullValue, // No description - Comments: util.NullValue, // No comments - PoolProvider: util.NullValue, // No provider - }) - config += phoneBaseSettings.GeneratePhoneBaseSettingsResourceWithCustomAttrs( - phoneBaseSettingsRes, - phoneBaseSettingsName, - "phoneBaseSettings description", - "generic_sip.json", - ) + GeneratePhoneResourceWithCustomAttrs(&PhoneConfig{ - phoneRes, - name1, - stateActive, - "genesyscloud_telephony_providers_edges_site." + siteRes + ".id", - "genesyscloud_telephony_providers_edges_phonebasesettings." + phoneBaseSettingsRes + ".id", - lineAddresses, - "", // no web rtc user - "genesyscloud_telephony_providers_edges_did_pool." + didPoolResource1, - }, capabilities, generatePhoneProperties(uuid.NewString())) resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) }, @@ -277,7 +255,28 @@ func TestAccResourcePhoneStandalone(t *testing.T) { PreConfig: func() { time.Sleep(30 * time.Second) }, - Config: locationConfig + siteConfig + config, + Config: didPool.GenerateDidPoolResource(&didPool.DidPoolStruct{ + ResourceID: didPoolResource1, + StartPhoneNumber: lineAddresses[0], + EndPhoneNumber: lineAddresses[0], + Description: util.NullValue, // No description + Comments: util.NullValue, // No comments + PoolProvider: util.NullValue, // No provider + }) + locationConfig + siteConfig + phoneBaseSettings.GeneratePhoneBaseSettingsResourceWithCustomAttrs( + phoneBaseSettingsRes, + phoneBaseSettingsName, + "phoneBaseSettings description", + "generic_sip.json", + ) + GeneratePhoneResourceWithCustomAttrs(&PhoneConfig{ + phoneRes, + name1, + stateActive, + "genesyscloud_telephony_providers_edges_site." + siteRes + ".id", + "genesyscloud_telephony_providers_edges_phonebasesettings." + phoneBaseSettingsRes + ".id", + lineAddresses, + "", // no web rtc user + "genesyscloud_telephony_providers_edges_did_pool." + didPoolResource1, + }, capabilities, generatePhoneProperties(uuid.NewString())), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "name", name1), resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "state", stateActive), @@ -445,7 +444,6 @@ func TestAccResourceHardPhoneStandalone(t *testing.T) { CheckDestroy: TestVerifyWebRtcPhoneDestroyed, }) } - func generatePhoneCapabilities( provisions, registers, @@ -532,3 +530,32 @@ func deleteDidPool(config *platformclientv2.Configuration, id string) error { } return nil } + +func deleteDidPoolWithNumber(number string) { + edgesAPI := platformclientv2.NewTelephonyProvidersEdgeApiWithConfig(sdkConfig) + var didPoolsToDelete []string + + for pageNum := 1; ; pageNum++ { + const pageSize = 100 + didPools, _, getErr := edgesAPI.GetTelephonyProvidersEdgesDidpools(pageSize, pageNum, "", nil) + if getErr != nil { + return + } + + if didPools.Entities == nil || len(*didPools.Entities) == 0 { + break + } + + for _, didPool := range *didPools.Entities { + if (didPool.StartPhoneNumber != nil && *didPool.StartPhoneNumber == number) || + (didPool.EndPhoneNumber != nil && *didPool.EndPhoneNumber == number) { + didPoolsToDelete = append(didPoolsToDelete, *didPool.Id) + } + } + } + + for _, didPoolId := range didPoolsToDelete { + edgesAPI.DeleteTelephonyProvidersEdgesDidpool(didPoolId) + time.Sleep(5 * time.Second) + } +} diff --git a/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go b/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go index ac69c388b..4b91ebe6d 100644 --- a/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go +++ b/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go @@ -372,6 +372,9 @@ func TestAccResourceTfExportExcludeFilterResourcesByRegExExclusiveToResourceAndS ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), Steps: []resource.TestStep{ { + PreConfig: func() { + time.Sleep(30 * time.Second) + }, // Generate a queue as well and export it Config: config, Check: resource.ComposeTestCheckFunc( diff --git a/jenkins/tests/Jenkinsfile b/jenkins/tests/Jenkinsfile index 7fd3f102b..3884e0d17 100644 --- a/jenkins/tests/Jenkinsfile +++ b/jenkins/tests/Jenkinsfile @@ -20,7 +20,7 @@ pipeline { GOPATH = "$HOME/go" TF_LOG = "DEBUG" TF_LOG_PATH = "../test.log" - GENESYSCLOUD_REGION = "${region}" + GENESYSCLOUD_REGION = "${region}" GENESYSCLOUD_SDK_DEBUG = "true" GENESYSCLOUD_TOKEN_POOL_SIZE = 20 PATH = "${env.PATH}:${HOME}/go/bin:/home/jenkins/.local/bin" @@ -49,7 +49,7 @@ pipeline { sh 'go install github.com/nezorflame/junit-merger@latest' sh 'pip install xmltodict --user' } - } + } stage('Terraform Check') { steps { @@ -59,6 +59,27 @@ pipeline { } } + stage('Unit Tests') { + + environment { + TF_UNIT=1 + ENABLE_STANDALONE_EMAIL_ADDRESS=1 + ENABLE_STANDALONE_CGR=1 + } + + steps { + catchError(buildResult: 'FAILURE', stageResult:'FAILURE'){ + echo 'Attempting to Run Unit Tests' + withCredentials([usernamePassword(credentialsId: CREDENTIALS_ID, usernameVariable: 'GENESYSCLOUD_OAUTHCLIENT_ID',passwordVariable:'GENESYSCLOUD_OAUTHCLIENT_SECRET')]) + { + echo 'Loading Genesys OAuth Credentials' + sh "gotestsum --junitfile unit.xml --format standard-verbose ./genesyscloud/... -run 'Test|TestUnit' -skip 'TestAcc' -v -timeout 30m -count=1 -cover -coverprofile=coverageUnit.out" + + } + } + } + } + stage('Architect Tests') { environment { TF_ACC=1 @@ -330,16 +351,16 @@ pipeline { sh 'GOBIN=$HOME/bin go install github.com/wadey/gocovmerge@latest' // Generate merged coverage report - sh '$HOME/bin/gocovmerge coverageArchitect.out coverageIdp.out coverageAuth.out coverageIntegration.out coverageFlow.out coverageJourney.out coverageKnowledge.out coverageOutbound.out coverageResponseManagement.out coverageRouting.out coverageExport.out coverageLocation.out coverageWebDeployment.out coverageRemaining.out coverageSite.out coverageRoleTeam.out > merged_coverage.out' + sh '$HOME/bin/gocovmerge coverageArchitect.out coverageIdp.out coverageAuth.out coverageIntegration.out coverageFlow.out coverageJourney.out coverageKnowledge.out coverageOutbound.out coverageResponseManagement.out coverageRouting.out coverageExport.out coverageLocation.out coverageWebDeployment.out coverageRemaining.out coverageSite.out coverageRoleTeam.out coverageUnit.out > merged_coverage.out' // Convert merged coverage report to HTML - sh 'go tool cover -html merged_coverage.out -o coverageAcceptance.html' + sh 'go tool cover -html merged_coverage.out -o coverageReport.html' - sh 'junit-merger -o test-results.xml architect.xml idp.xml auth.xml integration.xml flow.xml journey.xml knowledge.xml outbound.xml response.xml routing.xml location.xml web.xml site.xml team.xml export.xml remaining.xml' + sh 'junit-merger -o test-results.xml unit.xml architect.xml idp.xml auth.xml integration.xml flow.xml journey.xml knowledge.xml outbound.xml response.xml routing.xml location.xml web.xml site.xml team.xml export.xml remaining.xml' script { // Read the generated HTML file - def htmlFile = readFile 'coverageAcceptance.html' + def htmlFile = readFile 'coverageReport.html' def selectStart = htmlFile.indexOf('', selectStart) def fileCoverageSection = htmlFile.substring(selectStart, selectEnd + 9) // +9 to include @@ -494,7 +515,7 @@ pipeline { updatedHtmlFile = updatedHtmlFile.replace('', "\n") updatedHtmlFile = updatedHtmlFile.replace('', tableHtml + '\n' + scriptHtml + '\n') - writeFile file: 'coverageAcceptance.html', text: updatedHtmlFile + writeFile file: 'coverageReport.html', text: updatedHtmlFile // Generate manual report def xmlContent = readFile 'test-results.xml' @@ -675,7 +696,7 @@ pipeline { // Optionally, print the location of the HTML report echo "HTML report generated: \${env.WORKSPACE}/test-report.html" } - archiveArtifacts artifacts: 'coverageAcceptance.html,test-report.html,test-results.xml', allowEmptyArchive: true + archiveArtifacts artifacts: 'coverageReport.html,test-report.html,test-results.xml', allowEmptyArchive: true } } } From f12909a0a598a8bbe736d9a3390bad288cffcf49 Mon Sep 17 00:00:00 2001 From: shrutisuryawanshigenesys Date: Mon, 24 Jun 2024 09:16:30 -0400 Subject: [PATCH 24/62] onholdprompt attribute added along with test case (#1114) --- docs/resources/routing_queue.md | 1 + .../genesyscloud_routing_queue_init_test.go | 2 + .../resource_genesyscloud_routing_queue.go | 3 ++ ...ource_genesyscloud_routing_queue_schema.go | 6 +++ ...esource_genesyscloud_routing_queue_test.go | 46 ++++++++++++++++++- 5 files changed, 56 insertions(+), 2 deletions(-) diff --git a/docs/resources/routing_queue.md b/docs/resources/routing_queue.md index 3921981d7..a3f89f294 100644 --- a/docs/resources/routing_queue.md +++ b/docs/resources/routing_queue.md @@ -105,6 +105,7 @@ resource "genesyscloud_routing_queue" "example_queue" { - `media_settings_message` (Block List, Max: 1) Message media settings. (see [below for nested schema](#nestedblock--media_settings_message)) - `members` (Set of Object) Users in the queue. If not set, this resource will not manage members. If a user is already assigned to this queue via a group, attempting to assign them using this field will cause an error to be thrown. (see [below for nested schema](#nestedatt--members)) - `message_in_queue_flow_id` (String) The in-queue flow ID to use for message conversations waiting in queue. +- `on_hold_prompt_id` (String) The audio to be played when calls on this queue are on hold. If not configured, the default on-hold music will play. - `outbound_email_address` (Block List, Max: 1, Deprecated) The outbound email address settings for this queue. (see [below for nested schema](#nestedblock--outbound_email_address)) - `outbound_messaging_sms_address_id` (String) The unique ID of the outbound messaging SMS address for the queue. - `queue_flow_id` (String) The in-queue flow ID to use for call conversations waiting in queue. diff --git a/genesyscloud/routing_queue/genesyscloud_routing_queue_init_test.go b/genesyscloud/routing_queue/genesyscloud_routing_queue_init_test.go index df495eba4..6a9d21473 100644 --- a/genesyscloud/routing_queue/genesyscloud_routing_queue_init_test.go +++ b/genesyscloud/routing_queue/genesyscloud_routing_queue_init_test.go @@ -4,6 +4,7 @@ import ( "sync" gcloud "terraform-provider-genesyscloud/genesyscloud" architectFlow "terraform-provider-genesyscloud/genesyscloud/architect_flow" + "terraform-provider-genesyscloud/genesyscloud/architect_user_prompt" "terraform-provider-genesyscloud/genesyscloud/group" "testing" @@ -38,6 +39,7 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_routing_wrapupcode"] = gcloud.ResourceRoutingWrapupCode() providerResources["genesyscloud_flow"] = architectFlow.ResourceArchitectFlow() providerResources["genesyscloud_routing_skill_group"] = gcloud.ResourceRoutingSkillGroup() + providerResources["genesyscloud_architect_user_prompt"] = architect_user_prompt.ResourceArchitectUserPrompt() } // registerTestDataSources registers all data sources used in the tests. diff --git a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue.go b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue.go index f1133b919..46ae0cba6 100644 --- a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue.go +++ b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue.go @@ -74,6 +74,7 @@ func createQueue(ctx context.Context, d *schema.ResourceData, meta interface{}) EmailInQueueFlow: util.BuildSdkDomainEntityRef(d, "email_in_queue_flow_id"), MessageInQueueFlow: util.BuildSdkDomainEntityRef(d, "message_in_queue_flow_id"), WhisperPrompt: util.BuildSdkDomainEntityRef(d, "whisper_prompt_id"), + OnHoldPrompt: util.BuildSdkDomainEntityRef(d, "on_hold_prompt_id"), AutoAnswerOnly: platformclientv2.Bool(d.Get("auto_answer_only").(bool)), CallingPartyName: platformclientv2.String(d.Get("calling_party_name").(string)), CallingPartyNumber: platformclientv2.String(d.Get("calling_party_number").(string)), @@ -192,6 +193,7 @@ func readQueue(ctx context.Context, d *schema.ResourceData, meta interface{}) di resourcedata.SetNillableReference(d, "message_in_queue_flow_id", currentQueue.MessageInQueueFlow) resourcedata.SetNillableReference(d, "email_in_queue_flow_id", currentQueue.EmailInQueueFlow) resourcedata.SetNillableReference(d, "whisper_prompt_id", currentQueue.WhisperPrompt) + resourcedata.SetNillableReference(d, "on_hold_prompt_id", currentQueue.OnHoldPrompt) resourcedata.SetNillableValue(d, "auto_answer_only", currentQueue.AutoAnswerOnly) resourcedata.SetNillableValue(d, "enable_transcription", currentQueue.EnableTranscription) resourcedata.SetNillableValue(d, "suppress_in_queue_call_recording", currentQueue.SuppressInQueueCallRecording) @@ -279,6 +281,7 @@ func updateQueue(ctx context.Context, d *schema.ResourceData, meta interface{}) EmailInQueueFlow: util.BuildSdkDomainEntityRef(d, "email_in_queue_flow_id"), MessageInQueueFlow: util.BuildSdkDomainEntityRef(d, "message_in_queue_flow_id"), WhisperPrompt: util.BuildSdkDomainEntityRef(d, "whisper_prompt_id"), + OnHoldPrompt: util.BuildSdkDomainEntityRef(d, "on_hold_prompt_id"), AutoAnswerOnly: platformclientv2.Bool(d.Get("auto_answer_only").(bool)), CallingPartyName: platformclientv2.String(d.Get("calling_party_name").(string)), CallingPartyNumber: platformclientv2.String(d.Get("calling_party_number").(string)), diff --git a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_schema.go b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_schema.go index 896ea6e8a..58d7e83af 100644 --- a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_schema.go +++ b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_schema.go @@ -380,6 +380,11 @@ func ResourceRoutingQueue() *schema.Resource { Type: schema.TypeString, Optional: true, }, + "on_hold_prompt_id": { + Description: "The audio to be played when calls on this queue are on hold. If not configured, the default on-hold music will play.", + Type: schema.TypeString, + Optional: true, + }, "auto_answer_only": { Description: "Specifies whether the configured whisper should play for all ACD calls, or only for those which are auto-answered.", Type: schema.TypeBool, @@ -507,6 +512,7 @@ func RoutingQueueExporter() *resourceExporter.ResourceExporter { "email_in_queue_flow_id": {RefType: "genesyscloud_flow"}, "message_in_queue_flow_id": {RefType: "genesyscloud_flow"}, "whisper_prompt_id": {RefType: "genesyscloud_architect_user_prompt"}, + "on_hold_prompt_id": {RefType: "genesyscloud_architect_user_prompt"}, "outbound_messaging_sms_address_id": {}, // Ref type not yet defined "default_script_ids.*": {RefType: "genesyscloud_script"}, // Ref type not yet defined "outbound_email_address.route_id": {RefType: "genesyscloud_routing_email_route"}, diff --git a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go index f212f3e3e..20252e1db 100644 --- a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go +++ b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go @@ -8,10 +8,12 @@ import ( "sync" "terraform-provider-genesyscloud/genesyscloud" "terraform-provider-genesyscloud/genesyscloud/architect_flow" + "terraform-provider-genesyscloud/genesyscloud/architect_user_prompt" "terraform-provider-genesyscloud/genesyscloud/group" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" featureToggles "terraform-provider-genesyscloud/genesyscloud/util/feature_toggles" + "terraform-provider-genesyscloud/genesyscloud/util/testrunner" "testing" "time" @@ -529,6 +531,32 @@ func TestAccResourceRoutingQueueFlows(t *testing.T) { queueFlowInboundcallConfig1 = fmt.Sprintf("inboundCall:\n name: %s\n defaultLanguage: en-us\n startUpRef: ./menus/menu[mainMenu]\n initialGreeting:\n tts: Archy says hi!!!\n menus:\n - menu:\n name: Main Menu\n audio:\n tts: You are at the Main Menu, press 9 to disconnect.\n refId: mainMenu\n choices:\n - menuDisconnect:\n name: Disconnect\n dtmf: digit_9", queueFlowName1) messageInQueueFlowInboundcallConfig3 = fmt.Sprintf("inboundCall:\n name: %s\n defaultLanguage: en-us\n startUpRef: ./menus/menu[mainMenu]\n initialGreeting:\n tts: Archy says hi!!!!!\n menus:\n - menu:\n name: Main Menu\n audio:\n tts: You are at the Main Menu, press 9 to disconnect.\n refId: mainMenu\n choices:\n - menuDisconnect:\n name: Disconnect\n dtmf: digit_9", queueFlowName3) + + //variables for testing 'on_hold_prompt_id' + userPromptResource1 = "test-user_prompt_1" + userPromptName1 = "TestUserPrompt_1" + strings.Replace(uuid.NewString(), "-", "", -1) + userPromptDescription1 = "Test description" + userPromptResourceLang1 = "en-us" + userPromptResourceText1 = "This is a test greeting!" + userPromptResourceFileName2 = "../" + testrunner.GetTestDataPath("test-prompt-02.wav") + userPromptResourceTTS1 = "This is a test greeting!" + userPromptAsset1 = architect_user_prompt.UserPromptResourceStruct{ + Language: userPromptResourceLang1, + Tts_string: strconv.Quote(userPromptResourceTTS1), + Text: util.NullValue, + Filename: util.NullValue, + FileContentHash: util.NullValue, + } + userPromptAsset2 = architect_user_prompt.UserPromptResourceStruct{ + Language: userPromptResourceLang1, + Tts_string: util.NullValue, + Text: strconv.Quote(userPromptResourceText1), + Filename: strconv.Quote(userPromptResourceFileName2), + FileContentHash: userPromptResourceFileName2, + } + + userPromptResources1 = []*architect_user_prompt.UserPromptResourceStruct{&userPromptAsset1} + userPromptResources2 = []*architect_user_prompt.UserPromptResourceStruct{&userPromptAsset2} ) var homeDivisionName string @@ -592,17 +620,24 @@ func TestAccResourceRoutingQueueFlows(t *testing.T) { queueFlowFilePath3, messageInQueueFlowInboundcallConfig3, false, - ) + GenerateRoutingQueueResourceBasic( + ) + architect_user_prompt.GenerateUserPromptResource(&architect_user_prompt.UserPromptStruct{ + ResourceID: userPromptResource1, + Name: userPromptName1, + Description: strconv.Quote(userPromptDescription1), + Resources: userPromptResources1, + }) + GenerateRoutingQueueResourceBasic( queueResource1, queueName1, "queue_flow_id = genesyscloud_flow."+queueFlowResource1+".id", "email_in_queue_flow_id = genesyscloud_flow."+emailInQueueFlowResource1+".id", "message_in_queue_flow_id = genesyscloud_flow."+messageInQueueFlowResource1+".id", + "on_hold_prompt_id = genesyscloud_architect_user_prompt."+userPromptResource1+".id", ), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair("genesyscloud_routing_queue."+queueResource1, "queue_flow_id", "genesyscloud_flow."+queueFlowResource1, "id"), resource.TestCheckResourceAttrPair("genesyscloud_routing_queue."+queueResource1, "email_in_queue_flow_id", "genesyscloud_flow."+emailInQueueFlowResource1, "id"), resource.TestCheckResourceAttrPair("genesyscloud_routing_queue."+queueResource1, "message_in_queue_flow_id", "genesyscloud_flow."+messageInQueueFlowResource1, "id"), + resource.TestCheckResourceAttrPair("genesyscloud_routing_queue."+queueResource1, "on_hold_prompt_id", "genesyscloud_architect_user_prompt."+userPromptResource1, "id"), ), }, { @@ -622,17 +657,24 @@ func TestAccResourceRoutingQueueFlows(t *testing.T) { queueFlowFilePath3, messageInQueueFlowInboundcallConfig3, false, - ) + GenerateRoutingQueueResourceBasic( + ) + architect_user_prompt.GenerateUserPromptResource(&architect_user_prompt.UserPromptStruct{ + ResourceID: userPromptResource1, + Name: userPromptName1, + Description: strconv.Quote(userPromptDescription1), + Resources: userPromptResources2, + }) + GenerateRoutingQueueResourceBasic( queueResource1, queueName1, "queue_flow_id = genesyscloud_flow."+queueFlowResource2+".id", "email_in_queue_flow_id = genesyscloud_flow."+emailInQueueFlowResource2+".id", "message_in_queue_flow_id = genesyscloud_flow."+messageInQueueFlowResource2+".id", + "on_hold_prompt_id = genesyscloud_architect_user_prompt."+userPromptResource1+".id", ), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair("genesyscloud_routing_queue."+queueResource1, "queue_flow_id", "genesyscloud_flow."+queueFlowResource2, "id"), resource.TestCheckResourceAttrPair("genesyscloud_routing_queue."+queueResource1, "email_in_queue_flow_id", "genesyscloud_flow."+emailInQueueFlowResource2, "id"), resource.TestCheckResourceAttrPair("genesyscloud_routing_queue."+queueResource1, "message_in_queue_flow_id", "genesyscloud_flow."+messageInQueueFlowResource2, "id"), + resource.TestCheckResourceAttrPair("genesyscloud_routing_queue."+queueResource1, "on_hold_prompt_id", "genesyscloud_architect_user_prompt."+userPromptResource1, "id"), func(s *terraform.State) error { time.Sleep(45 * time.Second) // Wait for 45 seconds for proper deletion of user return nil From 5290a354749a3d35d8ba7d9d6639c58f2ada71b0 Mon Sep 17 00:00:00 2001 From: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Date: Mon, 24 Jun 2024 14:52:05 +0100 Subject: [PATCH 25/62] refactor/Devtooling-190 [routing_utilization] + Devtooling-400 [routing_utilization_label] (#1105) * Refactored but waiting for cyclic dependency removal * refactor routing utilization label * Tidy up * Updated docs * fixing naming convention in tf_export * fixing user test * Requested changes * fixing merge conflicts * Refactored but waiting for cyclic dependency removal * refactor routing utilization label * Tidy up * Updated docs * fixing naming convention in tf_export * fixing user test * fixing merge * fixing docs * Made requested changes * changes * fixing tests --- ..._genesyscloud_routing_utilization_label.go | 53 --- genesyscloud/resource_genesyscloud_init.go | 5 - .../resource_genesyscloud_init_test.go | 11 +- ...source_genesyscloud_routing_skill_group.go | 12 +- ...e_genesyscloud_routing_skill_group_test.go | 6 +- ...source_genesyscloud_routing_utilization.go | 389 ------------------ ..._genesyscloud_routing_utilization_label.go | 162 -------- genesyscloud/resource_genesyscloud_user.go | 40 +- .../resource_genesyscloud_user_test.go | 94 ++--- ...esyscloud_routing_utilization_init_test.go | 47 +++ .../genesyscloud_routing_utilization_proxy.go | 99 +++++ ...source_genesyscloud_routing_utilization.go | 128 ++++++ ...genesyscloud_routing_utilization_schema.go | 167 ++++++++ ...e_genesyscloud_routing_utilization_test.go | 149 +++---- .../resource_routing_utilization_utils.go | 135 ++++++ ..._genesyscloud_routing_utilization_label.go | 33 ++ ...syscloud_routing_utilization_label_test.go | 4 +- ...oud_routing_utilization_label_init_test.go | 52 +++ ...yscloud_routing_utilization_label_proxy.go | 149 +++++++ ..._genesyscloud_routing_utilization_label.go | 123 ++++++ ...scloud_routing_utilization_label_schema.go | 61 +++ ...syscloud_routing_utilization_label_test.go | 27 +- ...yscloud_routing_utilization_label_utils.go | 54 +++ .../tfexporter/tf_exporter_resource_test.go | 12 +- main.go | 4 + 25 files changed, 1210 insertions(+), 806 deletions(-) delete mode 100644 genesyscloud/data_source_genesyscloud_routing_utilization_label.go delete mode 100644 genesyscloud/resource_genesyscloud_routing_utilization.go delete mode 100644 genesyscloud/resource_genesyscloud_routing_utilization_label.go create mode 100644 genesyscloud/routing_utilization/genesyscloud_routing_utilization_init_test.go create mode 100644 genesyscloud/routing_utilization/genesyscloud_routing_utilization_proxy.go create mode 100644 genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization.go create mode 100644 genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_schema.go rename genesyscloud/{ => routing_utilization}/resource_genesyscloud_routing_utilization_test.go (77%) create mode 100644 genesyscloud/routing_utilization/resource_routing_utilization_utils.go create mode 100644 genesyscloud/routing_utilization_label/data_source_genesyscloud_routing_utilization_label.go rename genesyscloud/{ => routing_utilization_label}/data_source_genesyscloud_routing_utilization_label_test.go (95%) create mode 100644 genesyscloud/routing_utilization_label/genesyscloud_routing_utilization_label_init_test.go create mode 100644 genesyscloud/routing_utilization_label/genesyscloud_routing_utilization_label_proxy.go create mode 100644 genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label.go create mode 100644 genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_schema.go rename genesyscloud/{ => routing_utilization_label}/resource_genesyscloud_routing_utilization_label_test.go (71%) create mode 100644 genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_utils.go diff --git a/genesyscloud/data_source_genesyscloud_routing_utilization_label.go b/genesyscloud/data_source_genesyscloud_routing_utilization_label.go deleted file mode 100644 index e23128c3a..000000000 --- a/genesyscloud/data_source_genesyscloud_routing_utilization_label.go +++ /dev/null @@ -1,53 +0,0 @@ -package genesyscloud - -import ( - "context" - "fmt" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" -) - -func dataSourceRoutingUtilizationLabel() *schema.Resource { - return &schema.Resource{ - Description: "Data source for Genesys Cloud Routing Utilization Labels. Select a label by name.", - ReadContext: provider.ReadWithPooledClient(dataSourceRoutingUtilizationLabelRead), - Schema: map[string]*schema.Schema{ - "name": { - Description: "Label name.", - Type: schema.TypeString, - ValidateFunc: validation.StringDoesNotContainAny("*"), - Required: true, - }, - }, - } -} - -func dataSourceRoutingUtilizationLabelRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - sdkConfig := m.(*provider.ProviderMeta).ClientConfig - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - - name := d.Get("name").(string) - - return util.WithRetries(ctx, 15*time.Second, func() *retry.RetryError { - labels, resp, getErr := routingAPI.GetRoutingUtilizationLabels(1, 1, "", name) - if getErr != nil { - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_utilization_label", fmt.Sprintf("Error requesting label %s | error: %s", name, getErr), resp)) - } - - if labels.Entities == nil || len(*labels.Entities) == 0 { - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_utilization_label", fmt.Sprintf("No labels found with name %s", name), resp)) - } - - label := (*labels.Entities)[0] - d.SetId(*label.Id) - return nil - }) -} diff --git a/genesyscloud/resource_genesyscloud_init.go b/genesyscloud/resource_genesyscloud_init.go index a501e4114..d526a8439 100644 --- a/genesyscloud/resource_genesyscloud_init.go +++ b/genesyscloud/resource_genesyscloud_init.go @@ -33,7 +33,6 @@ func registerDataSources(l registrar.Registrar) { l.RegisterDataSource("genesyscloud_routing_skill", dataSourceRoutingSkill()) l.RegisterDataSource("genesyscloud_routing_skill_group", dataSourceRoutingSkillGroup()) l.RegisterDataSource("genesyscloud_routing_email_domain", DataSourceRoutingEmailDomain()) - l.RegisterDataSource("genesyscloud_routing_utilization_label", dataSourceRoutingUtilizationLabel()) l.RegisterDataSource("genesyscloud_routing_wrapupcode", DataSourceRoutingWrapupcode()) l.RegisterDataSource("genesyscloud_user", DataSourceUser()) l.RegisterDataSource("genesyscloud_widget_deployment", dataSourceWidgetDeployments()) @@ -65,8 +64,6 @@ func registerResources(l registrar.Registrar) { l.RegisterResource("genesyscloud_routing_language", ResourceRoutingLanguage()) l.RegisterResource("genesyscloud_routing_skill", ResourceRoutingSkill()) l.RegisterResource("genesyscloud_routing_skill_group", ResourceRoutingSkillGroup()) - l.RegisterResource("genesyscloud_routing_utilization", ResourceRoutingUtilization()) - l.RegisterResource("genesyscloud_routing_utilization_label", ResourceRoutingUtilizationLabel()) l.RegisterResource("genesyscloud_routing_wrapupcode", ResourceRoutingWrapupCode()) l.RegisterResource("genesyscloud_user", ResourceUser()) l.RegisterResource("genesyscloud_widget_deployment", ResourceWidgetDeployment()) @@ -93,8 +90,6 @@ func registerExporters(l registrar.Registrar) { l.RegisterExporter("genesyscloud_routing_language", RoutingLanguageExporter()) l.RegisterExporter("genesyscloud_routing_skill", RoutingSkillExporter()) l.RegisterExporter("genesyscloud_routing_skill_group", ResourceSkillGroupExporter()) - l.RegisterExporter("genesyscloud_routing_utilization", RoutingUtilizationExporter()) - l.RegisterExporter("genesyscloud_routing_utilization_label", RoutingUtilizationLabelExporter()) l.RegisterExporter("genesyscloud_routing_wrapupcode", RoutingWrapupCodeExporter()) l.RegisterExporter("genesyscloud_user", UserExporter()) l.RegisterExporter("genesyscloud_widget_deployment", WidgetDeploymentExporter()) diff --git a/genesyscloud/resource_genesyscloud_init_test.go b/genesyscloud/resource_genesyscloud_init_test.go index 0a7bd0457..79c141fed 100644 --- a/genesyscloud/resource_genesyscloud_init_test.go +++ b/genesyscloud/resource_genesyscloud_init_test.go @@ -9,6 +9,9 @@ import ( "terraform-provider-genesyscloud/genesyscloud/group" "terraform-provider-genesyscloud/genesyscloud/provider" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" + routingSettings "terraform-provider-genesyscloud/genesyscloud/routing_settings" + routingUtilization "terraform-provider-genesyscloud/genesyscloud/routing_utilization" + routingUtilizationLabel "terraform-provider-genesyscloud/genesyscloud/routing_utilization_label" "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -58,13 +61,14 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_routing_language"] = ResourceRoutingLanguage() providerResources["genesyscloud_routing_skill"] = ResourceRoutingSkill() providerResources["genesyscloud_routing_skill_group"] = ResourceRoutingSkillGroup() - providerResources["genesyscloud_routing_utilization"] = ResourceRoutingUtilization() - providerResources["genesyscloud_routing_utilization_label"] = ResourceRoutingUtilizationLabel() + providerResources["genesyscloud_routing_settings"] = routingSettings.ResourceRoutingSettings() + providerResources["genesyscloud_routing_utilization"] = routingUtilization.ResourceRoutingUtilization() providerResources["genesyscloud_routing_wrapupcode"] = ResourceRoutingWrapupCode() providerResources["genesyscloud_user"] = ResourceUser() providerResources["genesyscloud_widget_deployment"] = ResourceWidgetDeployment() providerResources["genesyscloud_architect_schedulegroups"] = archScheduleGroup.ResourceArchitectSchedulegroups() providerResources["genesyscloud_architect_schedules"] = architectSchedules.ResourceArchitectSchedules() + providerResources["genesyscloud_routing_utilization_label"] = routingUtilizationLabel.ResourceRoutingUtilizationLabel() } @@ -96,11 +100,10 @@ func (r *registerTestInstance) registerTestDataSources() { providerDataSources["genesyscloud_routing_skill"] = dataSourceRoutingSkill() providerDataSources["genesyscloud_routing_skill_group"] = dataSourceRoutingSkillGroup() providerDataSources["genesyscloud_routing_email_domain"] = DataSourceRoutingEmailDomain() - providerDataSources["genesyscloud_routing_utilization_label"] = dataSourceRoutingUtilizationLabel() providerDataSources["genesyscloud_routing_wrapupcode"] = DataSourceRoutingWrapupcode() providerDataSources["genesyscloud_user"] = DataSourceUser() providerDataSources["genesyscloud_widget_deployment"] = dataSourceWidgetDeployments() - + providerResources["genesyscloud_routing_utilization_label"] = routingUtilizationLabel.DataSourceRoutingUtilizationLabel() } func initTestResources() { diff --git a/genesyscloud/resource_genesyscloud_routing_skill_group.go b/genesyscloud/resource_genesyscloud_routing_skill_group.go index c16f83937..6508806de 100644 --- a/genesyscloud/resource_genesyscloud_routing_skill_group.go +++ b/genesyscloud/resource_genesyscloud_routing_skill_group.go @@ -149,7 +149,7 @@ func createOrUpdateSkillGroups(ctx context.Context, d *schema.ResourceData, meta routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) apiClient := &routingAPI.Configuration.APIClient path := routingAPI.Configuration.BasePath + route - headerParams := buildHeaderParams(routingAPI) + headerParams := BuildHeaderParams(routingAPI) /* Since API Client expects either a struct or map of maps (of json), convert the JSON string to a map @@ -233,7 +233,7 @@ func postSkillGroupMemberDivisions(ctx context.Context, d *schema.ResourceData, skillGroupsMemberDivisionIdsPayload["addDivisionIds"] = toAdd } - headerParams := buildHeaderParams(routingAPI) + headerParams := BuildHeaderParams(routingAPI) apiClient := &routingAPI.Configuration.APIClient path := fmt.Sprintf("%s/api/v2/routing/skillgroups/%s/members/divisions", routingAPI.Configuration.BasePath, d.Id()) response, err := apiClient.CallAPI(path, "POST", skillGroupsMemberDivisionIdsPayload, headerParams, nil, nil, "", nil) @@ -329,7 +329,7 @@ func readSkillGroups(ctx context.Context, d *schema.ResourceData, meta interface path := routingAPI.Configuration.BasePath + "/api/v2/routing/skillgroups/" + d.Id() // add default headers if any - headerParams := buildHeaderParams(routingAPI) + headerParams := BuildHeaderParams(routingAPI) log.Printf("Reading skills group %s", d.Id()) @@ -408,7 +408,7 @@ func readSkillGroups(ctx context.Context, d *schema.ResourceData, meta interface }) } -func buildHeaderParams(routingAPI *platformclientv2.RoutingApi) map[string]string { +func BuildHeaderParams(routingAPI *platformclientv2.RoutingApi) map[string]string { headerParams := make(map[string]string) for key := range routingAPI.Configuration.DefaultHeader { @@ -438,7 +438,7 @@ func deleteSkillGroups(ctx context.Context, d *schema.ResourceData, meta interfa path := routingAPI.Configuration.BasePath + "/api/v2/routing/skillgroups/" + d.Id() // add default headers if any - headerParams := buildHeaderParams(routingAPI) + headerParams := BuildHeaderParams(routingAPI) log.Printf("Deleting skills group %s", name) response, err := apiClient.CallAPI(path, "DELETE", nil, headerParams, nil, nil, "", nil) @@ -469,7 +469,7 @@ func deleteSkillGroups(ctx context.Context, d *schema.ResourceData, meta interfa } func readSkillGroupMemberDivisionIds(d *schema.ResourceData, routingAPI *platformclientv2.RoutingApi) ([]string, diag.Diagnostics) { - headers := buildHeaderParams(routingAPI) + headers := BuildHeaderParams(routingAPI) apiClient := &routingAPI.Configuration.APIClient path := fmt.Sprintf("%s/api/v2/routing/skillgroups/%s/members/divisions", routingAPI.Configuration.BasePath, d.Id()) diff --git a/genesyscloud/resource_genesyscloud_routing_skill_group_test.go b/genesyscloud/resource_genesyscloud_routing_skill_group_test.go index 378de4ccc..311e08fc7 100644 --- a/genesyscloud/resource_genesyscloud_routing_skill_group_test.go +++ b/genesyscloud/resource_genesyscloud_routing_skill_group_test.go @@ -603,7 +603,7 @@ func testVerifySkillGroupMemberCount(resourceName string, count string) resource // get skill group via GET /api/v2/routing/skillgroups/{skillGroupId} path := fmt.Sprintf("%s/api/v2/routing/skillgroups/%s", routingAPI.Configuration.BasePath, resourceID) - headers := buildHeaderParams(routingAPI) + headers := BuildHeaderParams(routingAPI) apiClient := &routingAPI.Configuration.APIClient response, err := apiClient.CallAPI(path, "GET", nil, headers, nil, nil, "", nil) @@ -735,7 +735,7 @@ func testVerifySkillGroupDestroyed(state *terraform.State) error { // TODO Once this code has been released into the public API we should fix this and use the SDK - headerParams := buildHeaderParams(routingAPI) + headerParams := BuildHeaderParams(routingAPI) for _, rs := range state.RootModule().Resources { if rs.Type != "genesyscloud_routing_skill_group" { continue @@ -766,7 +766,7 @@ func testVerifySkillGroupDestroyed(state *terraform.State) error { } func getAllSkillGroupMemberDivisionIds(routingAPI *platformclientv2.RoutingApi, resourceId string) ([]string, diag.Diagnostics) { - headers := buildHeaderParams(routingAPI) + headers := BuildHeaderParams(routingAPI) apiClient := &routingAPI.Configuration.APIClient path := fmt.Sprintf("%s/api/v2/routing/skillgroups/%s/members/divisions", routingAPI.Configuration.BasePath, resourceId) response, err := apiClient.CallAPI(path, "GET", nil, headers, nil, nil, "", nil) diff --git a/genesyscloud/resource_genesyscloud_routing_utilization.go b/genesyscloud/resource_genesyscloud_routing_utilization.go deleted file mode 100644 index 3b097bcaf..000000000 --- a/genesyscloud/resource_genesyscloud_routing_utilization.go +++ /dev/null @@ -1,389 +0,0 @@ -package genesyscloud - -import ( - "context" - "encoding/json" - "fmt" - "log" - "sort" - "strings" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" - "terraform-provider-genesyscloud/genesyscloud/util/constants" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - - "terraform-provider-genesyscloud/genesyscloud/consistency_checker" - - resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" - lists "terraform-provider-genesyscloud/genesyscloud/util/lists" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" -) - -type MediaUtilization struct { - MaximumCapacity int32 `json:"maximumCapacity"` - InterruptableMediaTypes []string `json:"interruptableMediaTypes"` - IncludeNonAcd bool `json:"includeNonAcd"` -} - -type LabelUtilization struct { - MaximumCapacity int32 `json:"maximumCapacity"` - InterruptingLabelIds []string `json:"interruptingLabelIds"` -} - -type OrgUtilizationWithLabels struct { - Utilization map[string]MediaUtilization `json:"utilization"` - LabelUtilizations map[string]LabelUtilization `json:"labelUtilizations"` -} - -var ( - // Map of SDK media type name to schema media type name - utilizationMediaTypes = map[string]string{ - "call": "call", - "callback": "callback", - "chat": "chat", - "email": "email", - "message": "message", - } - - utilizationSettingsResource = &schema.Resource{ - Schema: map[string]*schema.Schema{ - "maximum_capacity": { - Description: "Maximum capacity of conversations of this media type. Value must be between 0 and 25.", - Type: schema.TypeInt, - Required: true, - ValidateFunc: validation.IntBetween(0, 25), - }, - "interruptible_media_types": { - Description: fmt.Sprintf("Set of other media types that can interrupt this media type (%s).", strings.Join(getSdkUtilizationTypes(), " | ")), - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "include_non_acd": { - Description: "Block this media type when on a non-ACD conversation.", - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - }, - } - - utilizationLabelResource = &schema.Resource{ - Schema: map[string]*schema.Schema{ - "label_id": { - Description: "Id of the label being configured.", - Type: schema.TypeString, - Required: true, - }, - "maximum_capacity": { - Description: "Maximum capacity of conversations with this label. Value must be between 0 and 25.", - Type: schema.TypeInt, - Required: true, - ValidateFunc: validation.IntBetween(0, 25), - }, - "interrupting_label_ids": { - Description: "Set of other labels that can interrupt this label.", - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - }, - } -) - -func getSdkUtilizationTypes() []string { - types := make([]string, 0, len(utilizationMediaTypes)) - for t := range utilizationMediaTypes { - types = append(types, t) - } - sort.Strings(types) - return types -} - -func getAllRoutingUtilization(_ context.Context, _ *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { - // Routing utilization config always exists - resources := make(resourceExporter.ResourceIDMetaMap) - resources["0"] = &resourceExporter.ResourceMeta{Name: "routing_utilization"} - return resources, nil -} - -func RoutingUtilizationExporter() *resourceExporter.ResourceExporter { - return &resourceExporter.ResourceExporter{ - GetResourcesFunc: provider.GetAllWithPooledClient(getAllRoutingUtilization), - RefAttrs: map[string]*resourceExporter.RefAttrSettings{}, // No references - AllowZeroValues: []string{"maximum_capacity"}, - } -} - -func ResourceRoutingUtilization() *schema.Resource { - return &schema.Resource{ - Description: "Genesys Cloud Org-wide Routing Utilization Settings.", - - CreateContext: provider.CreateWithPooledClient(createRoutingUtilization), - ReadContext: provider.ReadWithPooledClient(readRoutingUtilization), - UpdateContext: provider.UpdateWithPooledClient(updateRoutingUtilization), - DeleteContext: provider.DeleteWithPooledClient(deleteRoutingUtilization), - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - SchemaVersion: 1, - Timeouts: &schema.ResourceTimeout{ - Update: schema.DefaultTimeout(8 * time.Minute), - Read: schema.DefaultTimeout(8 * time.Minute), - }, - Schema: map[string]*schema.Schema{ - "call": { - Description: "Call media settings. If not set, this reverts to the default media type settings.", - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - Computed: true, - Elem: utilizationSettingsResource, - }, - "callback": { - Description: "Callback media settings. If not set, this reverts to the default media type settings.", - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - Computed: true, - Elem: utilizationSettingsResource, - }, - "message": { - Description: "Message media settings. If not set, this reverts to the default media type settings.", - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - Computed: true, - Elem: utilizationSettingsResource, - }, - "email": { - Description: "Email media settings. If not set, this reverts to the default media type settings.", - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - Computed: true, - Elem: utilizationSettingsResource, - }, - "chat": { - Description: "Chat media settings. If not set, this reverts to the default media type settings.", - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - Computed: true, - Elem: utilizationSettingsResource, - }, - "label_utilizations": { - Description: "Label utilization settings. If not set, default label settings will be applied. This is in PREVIEW and should not be used unless the feature is available to your organization.", - Type: schema.TypeList, - Optional: true, - Computed: true, - Elem: utilizationLabelResource, - }, - }, - } -} - -func createRoutingUtilization(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - log.Printf("Creating Routing Utilization") - d.SetId("routing_utilization") - return updateRoutingUtilization(ctx, d, meta) -} - -func readRoutingUtilization(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - // Calling the Utilization API directly while the label feature is not available. - // Once it is, this code can go back to using platformclientv2's RoutingApi to make the call. - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - apiClient := &routingAPI.Configuration.APIClient - cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceRoutingSkill(), constants.DefaultConsistencyChecks, "genesyscloud_routing_utilization") - - path := fmt.Sprintf("%s/api/v2/routing/utilization", routingAPI.Configuration.BasePath) - headerParams := buildHeaderParams(routingAPI) - - log.Printf("Reading Routing Utilization") - return util.WithRetriesForRead(ctx, d, func() *retry.RetryError { - response, err := apiClient.CallAPI(path, "GET", nil, headerParams, nil, nil, "", nil) - if err != nil { - if util.IsStatus404(response) { - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_utilization", fmt.Sprintf("Failed to read Routing Utilization: %s", err), response)) - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_utilization", fmt.Sprintf("Failed to read Routing Utilization: %s", err), response)) - } - - orgUtilization := &OrgUtilizationWithLabels{} - err = json.Unmarshal(response.RawBody, &orgUtilization) - - if orgUtilization.Utilization != nil { - for sdkType, schemaType := range utilizationMediaTypes { - if mediaSettings, ok := orgUtilization.Utilization[sdkType]; ok { - d.Set(schemaType, flattenUtilizationSetting(mediaSettings)) - } else { - d.Set(schemaType, nil) - } - } - } - - if orgUtilization.LabelUtilizations != nil { - originalLabelUtilizations := d.Get("label_utilizations").([]interface{}) - - // Only add to the state the configured labels, in the configured order, but not any extras, to help terraform with matching new and old state. - flattenedLabelUtilizations := filterAndFlattenLabelUtilizations(orgUtilization.LabelUtilizations, originalLabelUtilizations) - d.Set("label_utilizations", flattenedLabelUtilizations) - } - - log.Printf("Read Routing Utilization") - return cc.CheckState(d) - }) -} - -func updateRoutingUtilization(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - - var resp *platformclientv2.APIResponse - var err error - - log.Printf("Updating Routing Utilization") - - labelUtilizations := d.Get("label_utilizations").([]interface{}) - - // Retrying on 409s because if a label is created immediately before the utilization update, it can lead to a conflict while the utilization is being updated to handle the new label. - diagErr := util.RetryWhen(util.IsStatus409, func() (*platformclientv2.APIResponse, diag.Diagnostics) { - // If the resource has label(s), calls the Utilization API directly. - // This code can go back to using platformclientv2's RoutingApi to make the call once label utilization is available in platformclientv2's RoutingApi. - if labelUtilizations != nil && len(labelUtilizations) > 0 { - apiClient := &routingAPI.Configuration.APIClient - - path := fmt.Sprintf("%s/api/v2/routing/utilization", routingAPI.Configuration.BasePath) - headerParams := buildHeaderParams(routingAPI) - requestPayload := make(map[string]interface{}) - requestPayload["utilization"] = buildSdkMediaUtilizations(d) - requestPayload["labelUtilizations"] = buildLabelUtilizationsRequest(labelUtilizations) - resp, err = apiClient.CallAPI(path, "PUT", requestPayload, headerParams, nil, nil, "", nil) - } else { - _, resp, err = routingAPI.PutRoutingUtilization(platformclientv2.Utilizationrequest{ - Utilization: buildSdkMediaUtilizations(d), - }) - } - - if err != nil { - return resp, util.BuildAPIDiagnosticError("genesyscloud_routing_utilization", fmt.Sprintf("Failed to update Routing Utilization %s error: %s", d.Id(), err), resp) - } - return resp, nil - }) - - if diagErr != nil { - return diagErr - } - - log.Printf("Updated Routing Utilization") - return readRoutingUtilization(ctx, d, meta) -} - -func deleteRoutingUtilization(_ context.Context, _ *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - - // Resets to default values - log.Printf("Resetting Routing Utilization") - resp, err := routingAPI.DeleteRoutingUtilization() - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_routing_utilization", fmt.Sprintf("Failed to reset Routing Utilization error: %s", err), resp) - } - log.Printf("Reset Routing Utilization") - return nil -} - -func flattenUtilizationSetting(settings MediaUtilization) []interface{} { - settingsMap := make(map[string]interface{}) - - settingsMap["maximum_capacity"] = settings.MaximumCapacity - settingsMap["include_non_acd"] = settings.IncludeNonAcd - if settings.InterruptableMediaTypes != nil { - settingsMap["interruptible_media_types"] = lists.StringListToSet(settings.InterruptableMediaTypes) - } - - return []interface{}{settingsMap} -} - -func filterAndFlattenLabelUtilizations(labelUtilizations map[string]LabelUtilization, originalLabelUtilizations []interface{}) []interface{} { - flattenedLabelUtilizations := make([]interface{}, 0) - - for _, originalLabelUtilization := range originalLabelUtilizations { - originalLabelId := (originalLabelUtilization.(map[string]interface{}))["label_id"].(string) - - for currentLabelId, currentLabelUtilization := range labelUtilizations { - if currentLabelId == originalLabelId { - flattenedLabelUtilizations = append(flattenedLabelUtilizations, flattenLabelUtilization(currentLabelId, currentLabelUtilization)) - delete(labelUtilizations, currentLabelId) - break - } - } - } - - return flattenedLabelUtilizations -} - -func flattenLabelUtilization(labelId string, labelUtilization LabelUtilization) map[string]interface{} { - utilizationMap := make(map[string]interface{}) - - utilizationMap["label_id"] = labelId - utilizationMap["maximum_capacity"] = labelUtilization.MaximumCapacity - if labelUtilization.InterruptingLabelIds != nil { - utilizationMap["interrupting_label_ids"] = lists.StringListToSet(labelUtilization.InterruptingLabelIds) - } - - return utilizationMap -} - -func buildSdkMediaUtilizations(d *schema.ResourceData) *map[string]platformclientv2.Mediautilization { - settings := make(map[string]platformclientv2.Mediautilization) - - for sdkType, schemaType := range utilizationMediaTypes { - mediaSettings := d.Get(schemaType).([]interface{}) - if mediaSettings != nil && len(mediaSettings) > 0 { - settings[sdkType] = buildSdkMediaUtilization(mediaSettings) - } - } - - return &settings -} - -func buildSdkMediaUtilization(settings []interface{}) platformclientv2.Mediautilization { - settingsMap := settings[0].(map[string]interface{}) - - maxCapacity := settingsMap["maximum_capacity"].(int) - includeNonAcd := settingsMap["include_non_acd"].(bool) - - // Optional - interruptableMediaTypes := &[]string{} - if types, ok := settingsMap["interruptible_media_types"]; ok { - interruptableMediaTypes = lists.SetToStringList(types.(*schema.Set)) - } - - return platformclientv2.Mediautilization{ - MaximumCapacity: &maxCapacity, - IncludeNonAcd: &includeNonAcd, - InterruptableMediaTypes: interruptableMediaTypes, - } -} - -func buildLabelUtilizationsRequest(labelUtilizations []interface{}) map[string]LabelUtilization { - request := make(map[string]LabelUtilization) - for _, labelUtilization := range labelUtilizations { - labelUtilizationMap := labelUtilization.(map[string]interface{}) - interruptingLabelIds := lists.SetToStringList(labelUtilizationMap["interrupting_label_ids"].(*schema.Set)) - - request[labelUtilizationMap["label_id"].(string)] = LabelUtilization{ - MaximumCapacity: int32(labelUtilizationMap["maximum_capacity"].(int)), - InterruptingLabelIds: *interruptingLabelIds, - } - } - return request -} diff --git a/genesyscloud/resource_genesyscloud_routing_utilization_label.go b/genesyscloud/resource_genesyscloud_routing_utilization_label.go deleted file mode 100644 index 6a625e1e2..000000000 --- a/genesyscloud/resource_genesyscloud_routing_utilization_label.go +++ /dev/null @@ -1,162 +0,0 @@ -package genesyscloud - -import ( - "context" - "fmt" - "log" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" - "terraform-provider-genesyscloud/genesyscloud/util/constants" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - - "terraform-provider-genesyscloud/genesyscloud/consistency_checker" - - resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" -) - -func getAllRoutingUtilizationLabels(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { - resources := make(resourceExporter.ResourceIDMetaMap) - routingAPI := platformclientv2.NewRoutingApiWithConfig(clientConfig) - - for pageNum := 1; ; pageNum++ { - const pageSize = 100 - labels, resp, getErr := routingAPI.GetRoutingUtilizationLabels(pageSize, pageNum, "", "") - if getErr != nil { - return nil, util.BuildAPIDiagnosticError("genesyscloud_routing_utilization_label", fmt.Sprintf("Failed to get page of labels error: %s", getErr), resp) - } - - if labels.Entities == nil || len(*labels.Entities) == 0 { - break - } - - for _, label := range *labels.Entities { - resources[*label.Id] = &resourceExporter.ResourceMeta{Name: *label.Name} - } - } - - return resources, nil -} - -func RoutingUtilizationLabelExporter() *resourceExporter.ResourceExporter { - return &resourceExporter.ResourceExporter{ - GetResourcesFunc: provider.GetAllWithPooledClient(getAllRoutingUtilizationLabels), - RefAttrs: map[string]*resourceExporter.RefAttrSettings{}, // No references - } -} - -func ResourceRoutingUtilizationLabel() *schema.Resource { - return &schema.Resource{ - Description: "Genesys Cloud Routing Utilization Label. This resource is not yet widely available. Only use it if the feature is enabled.", - - CreateContext: provider.CreateWithPooledClient(createRoutingUtilizationLabel), - ReadContext: provider.ReadWithPooledClient(readRoutingUtilizationLabel), - UpdateContext: provider.UpdateWithPooledClient(updateRoutingUtilizationLabel), - DeleteContext: provider.DeleteWithPooledClient(deleteRoutingUtilizationLabel), - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - SchemaVersion: 1, - Schema: map[string]*schema.Schema{ - "name": { - Description: "Label name.", - Type: schema.TypeString, - Required: true, - }, - }, - } -} - -func createRoutingUtilizationLabel(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - name := d.Get("name").(string) - - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - - log.Printf("Creating label %s", name) - label, resp, err := routingAPI.PostRoutingUtilizationLabels(platformclientv2.Createutilizationlabelrequest{ - Name: &name, - }) - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_routing_utilization_label", fmt.Sprintf("Failed to create label %s error: %s", name, err), resp) - } - - d.SetId(*label.Id) - - log.Printf("Created label %s %s", name, *label.Id) - return readRoutingUtilizationLabel(ctx, d, meta) -} - -func updateRoutingUtilizationLabel(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - - id := d.Id() - name := d.Get("name").(string) - - log.Printf("Updating label %s with name %s", id, name) - - _, resp, err := routingAPI.PutRoutingUtilizationLabel(id, platformclientv2.Updateutilizationlabelrequest{ - Name: &name, - }) - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_routing_utilization_label", fmt.Sprintf("Failed to update label %s error: %s", id, err), resp) - } - - log.Printf("Updated label %s", id) - return readRoutingUtilizationLabel(ctx, d, meta) -} - -func readRoutingUtilizationLabel(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - routingApi := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceRoutingUtilizationLabel(), constants.DefaultConsistencyChecks, "genesyscloud_routing_utilization_label") - - log.Printf("Reading label %s", d.Id()) - return util.WithRetriesForRead(ctx, d, func() *retry.RetryError { - label, resp, getErr := routingApi.GetRoutingUtilizationLabel(d.Id()) - if getErr != nil { - if util.IsStatus404(resp) { - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_utilization_label", fmt.Sprintf("Failed to read label %s | error: %s", d.Id(), getErr), resp)) - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_utilization_label", fmt.Sprintf("Failed to read label %s | error: %s", d.Id(), getErr), resp)) - } - - d.Set("name", *label.Name) - log.Printf("Read label %s %s", d.Id(), *label.Name) - return cc.CheckState(d) - }) -} - -func deleteRoutingUtilizationLabel(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - name := d.Get("name").(string) - - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - routingApi := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - - log.Printf("Deleting label %s", name) - resp, err := routingApi.DeleteRoutingUtilizationLabel(d.Id(), true) - - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_routing_utilization_label", fmt.Sprintf("Failed to delete label %s error: %s", name, err), resp) - } - - return util.WithRetries(ctx, 30*time.Second, func() *retry.RetryError { - _, resp, err := routingApi.GetRoutingUtilizationLabel(d.Id()) - if err != nil { - if util.IsStatus404(resp) { - // Routing label deleted - log.Printf("Deleted Routing label %s", d.Id()) - return nil - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_utilization_label", fmt.Sprintf("Error deleting Routing label %s: %s", d.Id(), err), resp)) - } - - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_utilization_label", fmt.Sprintf("Routing label %s still exists", d.Id()), resp)) - }) -} diff --git a/genesyscloud/resource_genesyscloud_user.go b/genesyscloud/resource_genesyscloud_user.go index cde674ba8..79baca358 100644 --- a/genesyscloud/resource_genesyscloud_user.go +++ b/genesyscloud/resource_genesyscloud_user.go @@ -7,6 +7,7 @@ import ( "log" "strings" "terraform-provider-genesyscloud/genesyscloud/provider" + routingUtilization "terraform-provider-genesyscloud/genesyscloud/routing_utilization" "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/constants" "terraform-provider-genesyscloud/genesyscloud/validators" @@ -28,9 +29,9 @@ import ( ) type AgentUtilizationWithLabels struct { - Utilization map[string]MediaUtilization `json:"utilization"` - LabelUtilizations map[string]LabelUtilization `json:"labelUtilizations"` - Level string `json:"level"` + Utilization map[string]routingUtilization.MediaUtilization `json:"utilization"` + LabelUtilizations map[string]routingUtilization.LabelUtilization `json:"labelUtilizations"` + Level string `json:"level"` } var ( @@ -377,7 +378,7 @@ func ResourceUser() *schema.Resource { Optional: true, Computed: true, ConfigMode: schema.SchemaConfigModeAttr, - Elem: utilizationSettingsResource, + Elem: routingUtilization.UtilizationSettingsResource, }, "callback": { Description: "Callback media settings. If not set, this reverts to the default media type settings.", @@ -386,7 +387,7 @@ func ResourceUser() *schema.Resource { Optional: true, Computed: true, ConfigMode: schema.SchemaConfigModeAttr, - Elem: utilizationSettingsResource, + Elem: routingUtilization.UtilizationSettingsResource, }, "message": { Description: "Message media settings. If not set, this reverts to the default media type settings.", @@ -395,7 +396,7 @@ func ResourceUser() *schema.Resource { Optional: true, Computed: true, ConfigMode: schema.SchemaConfigModeAttr, - Elem: utilizationSettingsResource, + Elem: routingUtilization.UtilizationSettingsResource, }, "email": { Description: "Email media settings. If not set, this reverts to the default media type settings.", @@ -404,7 +405,7 @@ func ResourceUser() *schema.Resource { Optional: true, Computed: true, ConfigMode: schema.SchemaConfigModeAttr, - Elem: utilizationSettingsResource, + Elem: routingUtilization.UtilizationSettingsResource, }, "chat": { Description: "Chat media settings. If not set, this reverts to the default media type settings.", @@ -413,7 +414,7 @@ func ResourceUser() *schema.Resource { Optional: true, Computed: true, ConfigMode: schema.SchemaConfigModeAttr, - Elem: utilizationSettingsResource, + Elem: routingUtilization.UtilizationSettingsResource, }, "label_utilizations": { Description: "Label utilization settings. If not set, default label settings will be applied. This is in PREVIEW and should not be used unless the feature is available to your organization.", @@ -421,7 +422,7 @@ func ResourceUser() *schema.Resource { Optional: true, Computed: true, ConfigMode: schema.SchemaConfigModeAttr, - Elem: utilizationLabelResource, + Elem: routingUtilization.UtilizationLabelResource, }, }, }, @@ -1050,7 +1051,7 @@ func readUserRoutingUtilization(d *schema.ResourceData, sdkConfig *platformclien apiClient := &routingAPI.Configuration.APIClient path := fmt.Sprintf("%s/api/v2/routing/users/%s/utilization", routingAPI.Configuration.BasePath, d.Id()) - headerParams := buildHeaderParams(routingAPI) + headerParams := BuildHeaderParams(routingAPI) response, err := apiClient.CallAPI(path, "GET", nil, headerParams, nil, nil, "", nil) if err != nil { @@ -1073,9 +1074,9 @@ func readUserRoutingUtilization(d *schema.ResourceData, sdkConfig *platformclien allSettings := map[string]interface{}{} if agentUtilization.Utilization != nil { - for sdkType, schemaType := range utilizationMediaTypes { + for sdkType, schemaType := range routingUtilization.UtilizationMediaTypes { if mediaSettings, ok := agentUtilization.Utilization[sdkType]; ok { - allSettings[schemaType] = flattenUtilizationSetting(mediaSettings) + allSettings[schemaType] = routingUtilization.FlattenUtilizationSetting(mediaSettings) } } } @@ -1087,7 +1088,7 @@ func readUserRoutingUtilization(d *schema.ResourceData, sdkConfig *platformclien originalLabelUtilizations := originalSettings["label_utilizations"].([]interface{}) // Only add to the state the configured labels, in the configured order, but not any extras, to help terraform with matching new and old state. - filteredLabelUtilizations := filterAndFlattenLabelUtilizations(agentUtilization.LabelUtilizations, originalLabelUtilizations) + filteredLabelUtilizations := routingUtilization.FilterAndFlattenLabelUtilizations(agentUtilization.LabelUtilizations, originalLabelUtilizations) allSettings["label_utilizations"] = filteredLabelUtilizations } else { @@ -1293,16 +1294,17 @@ func updateUserRoutingUtilization(d *schema.ResourceData, usersAPI *platformclie apiClient := &routingAPI.Configuration.APIClient path := fmt.Sprintf("%s/api/v2/routing/users/%s/utilization", routingAPI.Configuration.BasePath, d.Id()) - headerParams := buildHeaderParams(routingAPI) + headerParams := BuildHeaderParams(routingAPI) requestPayload := make(map[string]interface{}) requestPayload["utilization"] = buildMediaTypeUtilizations(allSettings) - requestPayload["labelUtilizations"] = buildLabelUtilizationsRequest(labelUtilizations) + + requestPayload["labelUtilizations"] = routingUtilization.BuildLabelUtilizationsRequest(labelUtilizations) _, err = apiClient.CallAPI(path, "PUT", requestPayload, headerParams, nil, nil, "", nil) } else { sdkSettings := make(map[string]platformclientv2.Mediautilization) - for sdkType, schemaType := range utilizationMediaTypes { + for sdkType, schemaType := range routingUtilization.UtilizationMediaTypes { if mediaSettings, ok := allSettings[schemaType]; ok && len(mediaSettings.([]interface{})) > 0 { - sdkSettings[sdkType] = buildSdkMediaUtilization(mediaSettings.([]interface{})) + sdkSettings[sdkType] = routingUtilization.BuildSdkMediaUtilization(mediaSettings.([]interface{})) } } @@ -1391,10 +1393,10 @@ func flattenUserCertifications(certs *[]string) *schema.Set { func buildMediaTypeUtilizations(allUtilizations map[string]interface{}) *map[string]platformclientv2.Mediautilization { settings := make(map[string]platformclientv2.Mediautilization) - for sdkType, schemaType := range utilizationMediaTypes { + for sdkType, schemaType := range routingUtilization.UtilizationMediaTypes { mediaSettings := allUtilizations[schemaType].([]interface{}) if mediaSettings != nil && len(mediaSettings) > 0 { - settings[sdkType] = buildSdkMediaUtilization(mediaSettings) + settings[sdkType] = routingUtilization.BuildSdkMediaUtilization(mediaSettings) } } diff --git a/genesyscloud/resource_genesyscloud_user_test.go b/genesyscloud/resource_genesyscloud_user_test.go index 346726a7c..c064114ea 100644 --- a/genesyscloud/resource_genesyscloud_user_test.go +++ b/genesyscloud/resource_genesyscloud_user_test.go @@ -6,6 +6,8 @@ import ( "strconv" "strings" "terraform-provider-genesyscloud/genesyscloud/provider" + routingUtilization "terraform-provider-genesyscloud/genesyscloud/routing_utilization" + routingUtilizationLabel "terraform-provider-genesyscloud/genesyscloud/routing_utilization_label" "terraform-provider-genesyscloud/genesyscloud/util" "testing" "time" @@ -731,11 +733,11 @@ func TestAccResourceUserroutingUtil(t *testing.T) { email1, userName, generateUserRoutingUtil( - generateRoutingUtilMediaType("call", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("callback", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("chat", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("email", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("message", maxCapacity1, util.FalseValue), + routingUtilization.GenerateRoutingUtilMediaType("call", maxCapacity1, util.FalseValue), + routingUtilization.GenerateRoutingUtilMediaType("callback", maxCapacity1, util.FalseValue), + routingUtilization.GenerateRoutingUtilMediaType("chat", maxCapacity1, util.FalseValue), + routingUtilization.GenerateRoutingUtilMediaType("email", maxCapacity1, util.FalseValue), + routingUtilization.GenerateRoutingUtilMediaType("message", maxCapacity1, util.FalseValue), ), ), Check: resource.ComposeTestCheckFunc( @@ -764,11 +766,11 @@ func TestAccResourceUserroutingUtil(t *testing.T) { email1, userName, generateUserRoutingUtil( - generateRoutingUtilMediaType("call", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeEmail)), - generateRoutingUtilMediaType("callback", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("chat", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("email", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("message", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("call", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeEmail)), + routingUtilization.GenerateRoutingUtilMediaType("callback", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("chat", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("email", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("message", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), ), ), Check: resource.ComposeTestCheckFunc( @@ -797,11 +799,11 @@ func TestAccResourceUserroutingUtil(t *testing.T) { email1, userName, generateUserRoutingUtil( - generateRoutingUtilMediaType("call", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeEmail)), - generateRoutingUtilMediaType("callback", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("chat", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("email", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("message", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("call", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeEmail)), + routingUtilization.GenerateRoutingUtilMediaType("callback", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("chat", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("email", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("message", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), ), ), Check: resource.ComposeTestCheckFunc( @@ -864,7 +866,7 @@ func TestAccResourceUserroutingUtilWithLabels(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) - if err := checkIfLabelsAreEnabled(); err != nil { + if err := routingUtilizationLabel.CheckIfLabelsAreEnabled(); err != nil { t.Skipf("%v", err) // be sure to skip the test and not fail it } }, @@ -872,21 +874,21 @@ func TestAccResourceUserroutingUtilWithLabels(t *testing.T) { Steps: []resource.TestStep{ { // Create with utilization settings - Config: GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + - GenerateRoutingUtilizationLabelResource(blueLabelResource, blueLabelName, redLabelResource) + - GenerateRoutingUtilizationLabelResource(greenLabelResource, greenLabelName, blueLabelResource) + + Config: routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + + routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(blueLabelResource, blueLabelName, redLabelResource) + + routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(greenLabelResource, greenLabelName, blueLabelResource) + generateUserWithCustomAttrs( userResource1, email1, userName, generateUserRoutingUtil( - generateRoutingUtilMediaType("call", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("callback", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("chat", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("email", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("message", maxCapacity1, util.FalseValue), - generateLabelUtilization(redLabelResource, maxCapacity1), - generateLabelUtilization(blueLabelResource, maxCapacity1, redLabelResource), + routingUtilization.GenerateRoutingUtilMediaType("call", maxCapacity1, util.FalseValue), + routingUtilization.GenerateRoutingUtilMediaType("callback", maxCapacity1, util.FalseValue), + routingUtilization.GenerateRoutingUtilMediaType("chat", maxCapacity1, util.FalseValue), + routingUtilization.GenerateRoutingUtilMediaType("email", maxCapacity1, util.FalseValue), + routingUtilization.GenerateRoutingUtilMediaType("message", maxCapacity1, util.FalseValue), + routingUtilizationLabel.GenerateLabelUtilization(redLabelResource, maxCapacity1), + routingUtilizationLabel.GenerateLabelUtilization(blueLabelResource, maxCapacity1, redLabelResource), ), ), Check: resource.ComposeTestCheckFunc( @@ -914,21 +916,21 @@ func TestAccResourceUserroutingUtilWithLabels(t *testing.T) { }, { // Update utilization settings and set different org-level settings - Config: GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + - GenerateRoutingUtilizationLabelResource(blueLabelResource, blueLabelName, redLabelResource) + - GenerateRoutingUtilizationLabelResource(greenLabelResource, greenLabelName, blueLabelResource) + + Config: routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + + routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(blueLabelResource, blueLabelName, redLabelResource) + + routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(greenLabelResource, greenLabelName, blueLabelResource) + generateUserWithCustomAttrs( userResource1, email1, userName, generateUserRoutingUtil( - generateRoutingUtilMediaType("call", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeEmail)), - generateRoutingUtilMediaType("callback", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("chat", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("email", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("message", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateLabelUtilization(redLabelResource, maxCapacity2), - generateLabelUtilization(blueLabelResource, maxCapacity2, redLabelResource), + routingUtilization.GenerateRoutingUtilMediaType("call", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeEmail)), + routingUtilization.GenerateRoutingUtilMediaType("callback", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("chat", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("email", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("message", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilizationLabel.GenerateLabelUtilization(redLabelResource, maxCapacity2), + routingUtilizationLabel.GenerateLabelUtilization(blueLabelResource, maxCapacity2, redLabelResource), ), ), Check: resource.ComposeTestCheckFunc( @@ -956,21 +958,21 @@ func TestAccResourceUserroutingUtilWithLabels(t *testing.T) { }, { // Ensure max capacity can be set to 0 - Config: GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + - GenerateRoutingUtilizationLabelResource(blueLabelResource, blueLabelName, redLabelResource) + - GenerateRoutingUtilizationLabelResource(greenLabelResource, greenLabelName, blueLabelResource) + + Config: routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + + routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(blueLabelResource, blueLabelName, redLabelResource) + + routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(greenLabelResource, greenLabelName, blueLabelResource) + generateUserWithCustomAttrs( userResource1, email1, userName, generateUserRoutingUtil( - generateRoutingUtilMediaType("call", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeEmail)), - generateRoutingUtilMediaType("callback", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("chat", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("email", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("message", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), - generateLabelUtilization(redLabelResource, maxCapacity0), - generateLabelUtilization(blueLabelResource, maxCapacity0, redLabelResource), + routingUtilization.GenerateRoutingUtilMediaType("call", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeEmail)), + routingUtilization.GenerateRoutingUtilMediaType("callback", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("chat", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("email", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("message", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilizationLabel.GenerateLabelUtilization(redLabelResource, maxCapacity0), + routingUtilizationLabel.GenerateLabelUtilization(blueLabelResource, maxCapacity0, redLabelResource), ), ), Check: resource.ComposeTestCheckFunc( diff --git a/genesyscloud/routing_utilization/genesyscloud_routing_utilization_init_test.go b/genesyscloud/routing_utilization/genesyscloud_routing_utilization_init_test.go new file mode 100644 index 000000000..3a9ec469f --- /dev/null +++ b/genesyscloud/routing_utilization/genesyscloud_routing_utilization_init_test.go @@ -0,0 +1,47 @@ +package routing_utilization + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "sync" + "terraform-provider-genesyscloud/genesyscloud/routing_utilization_label" + "testing" +) + +/* +The genesyscloud_routing_utilization_init_test.go file is used to initialize the data sources and resources +used in testing the routing_utilization resource. +*/ + +// providerResources holds a map of all registered resources +var providerResources map[string]*schema.Resource + +type registerTestInstance struct { + resourceMapMutex sync.RWMutex +} + +// registerTestResources registers all resources used in the tests +func (r *registerTestInstance) registerTestResources() { + r.resourceMapMutex.Lock() + defer r.resourceMapMutex.Unlock() + + providerResources[resourceName] = ResourceRoutingUtilization() + providerResources["genesyscloud_routing_utilization_label"] = routing_utilization_label.ResourceRoutingUtilizationLabel() +} + +// initTestResources initializes all test resources and data sources. +func initTestResources() { + providerResources = make(map[string]*schema.Resource) + + regInstance := ®isterTestInstance{} + + regInstance.registerTestResources() +} + +// TestMain is a "setup" function called by the testing framework when run the test +func TestMain(m *testing.M) { + // Run setup function before starting the test suite for the package + initTestResources() + + // Run the test suite for the package + m.Run() +} diff --git a/genesyscloud/routing_utilization/genesyscloud_routing_utilization_proxy.go b/genesyscloud/routing_utilization/genesyscloud_routing_utilization_proxy.go new file mode 100644 index 000000000..776d9664a --- /dev/null +++ b/genesyscloud/routing_utilization/genesyscloud_routing_utilization_proxy.go @@ -0,0 +1,99 @@ +package routing_utilization + +import ( + "context" + "fmt" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" +) + +var internalProxy *routingUtilizationProxy + +type getRoutingUtilizationFunc func(ctx context.Context, p *routingUtilizationProxy) (*platformclientv2.APIResponse, error) +type updateRoutingUtilizationFunc func(ctx context.Context, p *routingUtilizationProxy, request *platformclientv2.Utilizationrequest) (*platformclientv2.Utilizationresponse, *platformclientv2.APIResponse, error) +type deleteRoutingUtilizationFunc func(ctx context.Context, p *routingUtilizationProxy) (*platformclientv2.APIResponse, error) + +type updateDirectlyFunc func(ctx context.Context, p *routingUtilizationProxy, d *schema.ResourceData, utilizationRequest []interface{}) (*platformclientv2.APIResponse, error) + +type routingUtilizationProxy struct { + clientConfig *platformclientv2.Configuration + routingApi *platformclientv2.RoutingApi + getRoutingUtilizationAttr getRoutingUtilizationFunc + updateRoutingUtilizationAttr updateRoutingUtilizationFunc + deleteRoutingUtilizationAttr deleteRoutingUtilizationFunc + + updateDirectlyAttr updateDirectlyFunc +} + +func newRoutingUtilizationProxy(clientConfig *platformclientv2.Configuration) *routingUtilizationProxy { + api := platformclientv2.NewRoutingApiWithConfig(clientConfig) + return &routingUtilizationProxy{ + clientConfig: clientConfig, + routingApi: api, + getRoutingUtilizationAttr: getRoutingUtilizationFn, + updateRoutingUtilizationAttr: updateRoutingUtilizationFn, + deleteRoutingUtilizationAttr: deleteRoutingUtilizationFn, + + updateDirectlyAttr: updateDirectlyFn, + } +} + +func getRoutingUtilizationProxy(clientConfig *platformclientv2.Configuration) *routingUtilizationProxy { + if internalProxy == nil { + internalProxy = newRoutingUtilizationProxy(clientConfig) + } + return internalProxy +} + +func (p *routingUtilizationProxy) getRoutingUtilization(ctx context.Context) (*platformclientv2.APIResponse, error) { + return p.getRoutingUtilizationAttr(ctx, p) +} +func (p *routingUtilizationProxy) updateRoutingUtilization(ctx context.Context, request *platformclientv2.Utilizationrequest) (*platformclientv2.Utilizationresponse, *platformclientv2.APIResponse, error) { + return p.updateRoutingUtilizationAttr(ctx, p, request) +} +func (p *routingUtilizationProxy) deleteRoutingUtilization(ctx context.Context) (*platformclientv2.APIResponse, error) { + return p.deleteRoutingUtilizationAttr(ctx, p) +} + +func (p *routingUtilizationProxy) updateDirectly(ctx context.Context, d *schema.ResourceData, utilizationRequest []interface{}) (*platformclientv2.APIResponse, error) { + return p.updateDirectlyAttr(ctx, p, d, utilizationRequest) +} + +// Calling the Utilization API directly while the label feature is not available. +// Once it is, this code can go back to using platformclientv2's RoutingApi to make the call. +func getRoutingUtilizationFn(ctx context.Context, p *routingUtilizationProxy) (*platformclientv2.APIResponse, error) { + apiClient := &p.routingApi.Configuration.APIClient + path := fmt.Sprintf("%s/api/v2/routing/utilization", p.routingApi.Configuration.BasePath) + headerParams := buildHeaderParams(p.routingApi) + resp, err := apiClient.CallAPI(path, "GET", nil, headerParams, nil, nil, "", nil) + if err != nil { + return resp, fmt.Errorf("failed to get routing utilization %s ", err) + } + return resp, nil +} + +func updateRoutingUtilizationFn(ctx context.Context, p *routingUtilizationProxy, utilizationRequest *platformclientv2.Utilizationrequest) (*platformclientv2.Utilizationresponse, *platformclientv2.APIResponse, error) { + return p.routingApi.PutRoutingUtilization(*utilizationRequest) +} + +func deleteRoutingUtilizationFn(ctx context.Context, p *routingUtilizationProxy) (*platformclientv2.APIResponse, error) { + return p.routingApi.DeleteRoutingUtilization() +} + +// If the resource has label(s), calls the Utilization API directly. +// This code can go back to using platformclientv2's RoutingApi to make the call once label utilization is available in platformclientv2's RoutingApi +func updateDirectlyFn(ctx context.Context, p *routingUtilizationProxy, d *schema.ResourceData, utilizationRequest []interface{}) (*platformclientv2.APIResponse, error) { + apiClient := &p.routingApi.Configuration.APIClient + + path := fmt.Sprintf("%s/api/v2/routing/utilization", p.routingApi.Configuration.BasePath) + headerParams := buildHeaderParams(p.routingApi) + requestPayload := make(map[string]interface{}) + requestPayload["utilization"] = buildSdkMediaUtilizations(d) + requestPayload["labelUtilizations"] = BuildLabelUtilizationsRequest(utilizationRequest) + + resp, err := apiClient.CallAPI(path, "PUT", requestPayload, headerParams, nil, nil, "", nil) + if err != nil { + return resp, fmt.Errorf("error updating directly %s", err) + } + return resp, nil +} diff --git a/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization.go b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization.go new file mode 100644 index 000000000..27acc28ba --- /dev/null +++ b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization.go @@ -0,0 +1,128 @@ +package routing_utilization + +import ( + "context" + "encoding/json" + "fmt" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "log" + "terraform-provider-genesyscloud/genesyscloud/provider" + "terraform-provider-genesyscloud/genesyscloud/util" + "terraform-provider-genesyscloud/genesyscloud/util/constants" + + "terraform-provider-genesyscloud/genesyscloud/consistency_checker" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" +) + +func getAllRoutingUtilization(_ context.Context, _ *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { + // Routing utilization config always exists + resources := make(resourceExporter.ResourceIDMetaMap) + resources["0"] = &resourceExporter.ResourceMeta{Name: "routing_utilization"} + return resources, nil +} + +func createRoutingUtilization(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + log.Printf("Creating Routing Utilization") + d.SetId("routing_utilization") + return updateRoutingUtilization(ctx, d, meta) +} + +func readRoutingUtilization(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + // Calling the Utilization API directly while the label feature is not available. + // Once it is, this code can go back to using platformclientv2's RoutingApi to make the call. + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingUtilizationProxy(sdkConfig) + cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceRoutingUtilization(), constants.DefaultConsistencyChecks, resourceName) + orgUtilization := &OrgUtilizationWithLabels{} + + log.Printf("Reading Routing Utilization") + + return util.WithRetriesForRead(ctx, d, func() *retry.RetryError { + resp, err := proxy.getRoutingUtilization(ctx) + if err != nil { + if util.IsStatus404(resp) { + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read Routing Utilization: %s", err), resp)) + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read Routing Utilization: %s", err), resp)) + } + + err = json.Unmarshal(resp.RawBody, &orgUtilization) + + if orgUtilization.Utilization != nil { + for sdkType, schemaType := range UtilizationMediaTypes { + if mediaSettings, ok := orgUtilization.Utilization[sdkType]; ok { + _ = d.Set(schemaType, FlattenUtilizationSetting(mediaSettings)) + } else { + _ = d.Set(schemaType, nil) + } + } + } + + if orgUtilization.LabelUtilizations != nil { + originalLabelUtilizations := d.Get("label_utilizations").([]interface{}) + // Only add to the state the configured labels, in the configured order, but not any extras, to help terraform with matching new and old state. + flattenedLabelUtilizations := FilterAndFlattenLabelUtilizations(orgUtilization.LabelUtilizations, originalLabelUtilizations) + _ = d.Set("label_utilizations", flattenedLabelUtilizations) + } + + log.Printf("Read Routing Utilization") + return cc.CheckState(d) + }) +} + +func updateRoutingUtilization(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingUtilizationProxy(sdkConfig) + + labelUtilizations := d.Get("label_utilizations").([]interface{}) + var resp *platformclientv2.APIResponse + var err error + + log.Printf("Updating Routing Utilization") + + // Retrying on 409s because if a label is created immediately before the utilization update, it can lead to a conflict while the utilization is being updated to handle the new label. + diagErr := util.RetryWhen(util.IsStatus409, func() (*platformclientv2.APIResponse, diag.Diagnostics) { + // If the resource has label(s), calls the Utilization API directly. + // This code can go back to using platformclientv2's RoutingApi to make the call once label utilization is available in platformclientv2's RoutingApi. + if labelUtilizations != nil && len(labelUtilizations) > 0 { + resp, err := proxy.updateDirectly(ctx, d, labelUtilizations) + if err != nil { + return resp, util.BuildAPIDiagnosticError(resourceName, "Failed to update routing utilization directly", resp) + } + } else { + _, resp, err = proxy.updateRoutingUtilization(ctx, &platformclientv2.Utilizationrequest{ + Utilization: buildSdkMediaUtilizations(d), + }) + } + + if err != nil { + return resp, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to update Routing Utilization %s error: %s", d.Id(), err), resp) + } + return resp, nil + }) + if diagErr != nil { + return diagErr + } + + log.Printf("Updated Routing Utilization") + return readRoutingUtilization(ctx, d, meta) +} + +func deleteRoutingUtilization(ctx context.Context, _ *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingUtilizationProxy(sdkConfig) + + // Resets to default values + log.Printf("Resetting Routing Utilization") + + resp, err := proxy.deleteRoutingUtilization(ctx) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to reset Routing Utilization | error: %s", err), resp) + } + log.Printf("Reset Routing Utilization") + return nil +} diff --git a/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_schema.go b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_schema.go new file mode 100644 index 000000000..0ebba6209 --- /dev/null +++ b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_schema.go @@ -0,0 +1,167 @@ +package routing_utilization + +import ( + "fmt" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "strings" + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" + "time" +) + +const resourceName = "genesyscloud_routing_utilization" + +// SetRegistrar registers all the resources and exporters in the package +func SetRegistrar(regInstance registrar.Registrar) { + regInstance.RegisterResource(resourceName, ResourceRoutingUtilization()) + regInstance.RegisterExporter(resourceName, RoutingUtilizationExporter()) +} + +type MediaUtilization struct { + MaximumCapacity int32 `json:"maximumCapacity"` + InterruptableMediaTypes []string `json:"interruptableMediaTypes"` + IncludeNonAcd bool `json:"includeNonAcd"` +} + +type LabelUtilization struct { + MaximumCapacity int32 `json:"maximumCapacity"` + InterruptingLabelIds []string `json:"interruptingLabelIds"` +} + +type OrgUtilizationWithLabels struct { + Utilization map[string]MediaUtilization `json:"utilization"` + LabelUtilizations map[string]LabelUtilization `json:"labelUtilizations"` +} + +var ( + // Map of SDK media type name to schema media type name + UtilizationMediaTypes = map[string]string{ + "call": "call", + "callback": "callback", + "chat": "chat", + "email": "email", + "message": "message", + } + + UtilizationSettingsResource = &schema.Resource{ + Schema: map[string]*schema.Schema{ + "maximum_capacity": { + Description: "Maximum capacity of conversations of this media type. Value must be between 0 and 25.", + Type: schema.TypeInt, + Required: true, + ValidateFunc: validation.IntBetween(0, 25), + }, + "interruptible_media_types": { + Description: fmt.Sprintf("Set of other media types that can interrupt this media type (%s).", strings.Join(getSdkUtilizationTypes(), " | ")), + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "include_non_acd": { + Description: "Block this media type when on a non-ACD conversation.", + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + }, + } + + UtilizationLabelResource = &schema.Resource{ + Schema: map[string]*schema.Schema{ + "label_id": { + Description: "Id of the label being configured.", + Type: schema.TypeString, + Required: true, + }, + "maximum_capacity": { + Description: "Maximum capacity of conversations with this label. Value must be between 0 and 25.", + Type: schema.TypeInt, + Required: true, + ValidateFunc: validation.IntBetween(0, 25), + }, + "interrupting_label_ids": { + Description: "Set of other labels that can interrupt this label.", + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + }, + } +) + +func ResourceRoutingUtilization() *schema.Resource { + return &schema.Resource{ + Description: "Genesys Cloud Org-wide Routing Utilization Settings.", + + CreateContext: provider.CreateWithPooledClient(createRoutingUtilization), + ReadContext: provider.ReadWithPooledClient(readRoutingUtilization), + UpdateContext: provider.UpdateWithPooledClient(updateRoutingUtilization), + DeleteContext: provider.DeleteWithPooledClient(deleteRoutingUtilization), + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + SchemaVersion: 1, + Timeouts: &schema.ResourceTimeout{ + Update: schema.DefaultTimeout(8 * time.Minute), + Read: schema.DefaultTimeout(8 * time.Minute), + }, + Schema: map[string]*schema.Schema{ + "call": { + Description: "Call media settings. If not set, this reverts to the default media type settings.", + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Computed: true, + Elem: UtilizationSettingsResource, + }, + "callback": { + Description: "Callback media settings. If not set, this reverts to the default media type settings.", + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Computed: true, + Elem: UtilizationSettingsResource, + }, + "message": { + Description: "Message media settings. If not set, this reverts to the default media type settings.", + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Computed: true, + Elem: UtilizationSettingsResource, + }, + "email": { + Description: "Email media settings. If not set, this reverts to the default media type settings.", + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Computed: true, + Elem: UtilizationSettingsResource, + }, + "chat": { + Description: "Chat media settings. If not set, this reverts to the default media type settings.", + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Computed: true, + Elem: UtilizationSettingsResource, + }, + "label_utilizations": { + Description: "Label utilization settings. If not set, default label settings will be applied. This is in PREVIEW and should not be used unless the feature is available to your organization.", + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: UtilizationLabelResource, + }, + }, + } +} + +func RoutingUtilizationExporter() *resourceExporter.ResourceExporter { + return &resourceExporter.ResourceExporter{ + GetResourcesFunc: provider.GetAllWithPooledClient(getAllRoutingUtilization), + AllowZeroValues: []string{"maximum_capacity"}, + } +} diff --git a/genesyscloud/resource_genesyscloud_routing_utilization_test.go b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_test.go similarity index 77% rename from genesyscloud/resource_genesyscloud_routing_utilization_test.go rename to genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_test.go index 09b7c8b73..0e5019ce6 100644 --- a/genesyscloud/resource_genesyscloud_routing_utilization_test.go +++ b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_test.go @@ -1,4 +1,4 @@ -package genesyscloud +package routing_utilization import ( "fmt" @@ -6,6 +6,7 @@ import ( "strconv" "strings" "terraform-provider-genesyscloud/genesyscloud/provider" + routingUtilizationLabel "terraform-provider-genesyscloud/genesyscloud/routing_utilization_label" "terraform-provider-genesyscloud/genesyscloud/util" "testing" "time" @@ -27,16 +28,16 @@ func TestAccResourceBasicRoutingUtilization(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) }, - ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + ProviderFactories: provider.GetProviderFactories(providerResources, nil), Steps: []resource.TestStep{ { // Create Config: generateRoutingUtilizationResource( - generateRoutingUtilMediaType("call", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("callback", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("chat", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("email", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("message", maxCapacity1, util.FalseValue), + GenerateRoutingUtilMediaType("call", maxCapacity1, util.FalseValue), + GenerateRoutingUtilMediaType("callback", maxCapacity1, util.FalseValue), + GenerateRoutingUtilMediaType("chat", maxCapacity1, util.FalseValue), + GenerateRoutingUtilMediaType("email", maxCapacity1, util.FalseValue), + GenerateRoutingUtilMediaType("message", maxCapacity1, util.FalseValue), ), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("genesyscloud_routing_utilization.routing-util", "call.0.maximum_capacity", maxCapacity1), @@ -59,11 +60,11 @@ func TestAccResourceBasicRoutingUtilization(t *testing.T) { { // Update with a new max capacities and interruptible media types Config: generateRoutingUtilizationResource( - generateRoutingUtilMediaType("call", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeEmail)), - generateRoutingUtilMediaType("callback", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("chat", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("email", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("message", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + GenerateRoutingUtilMediaType("call", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeEmail)), + GenerateRoutingUtilMediaType("callback", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + GenerateRoutingUtilMediaType("chat", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + GenerateRoutingUtilMediaType("email", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + GenerateRoutingUtilMediaType("message", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), ), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("genesyscloud_routing_utilization.routing-util", "call.0.maximum_capacity", maxCapacity2), @@ -108,30 +109,32 @@ func TestAccResourceRoutingUtilizationWithLabels(t *testing.T) { greenLabelName = "Terraform Green Label" + uuid.NewString() ) - CleanupRoutingUtilizationLabel() + if err := CleanupRoutingUtilizationLabel(); err != nil { + t.Skipf("%v", err) // Skip the test and not fail it + } resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) - if err := checkIfLabelsAreEnabled(); err != nil { + if err := routingUtilizationLabel.CheckIfLabelsAreEnabled(); err != nil { t.Skipf("%v", err) // be sure to skip the test and not fail it } }, - ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + ProviderFactories: provider.GetProviderFactories(providerResources, nil), Steps: []resource.TestStep{ { // Create - Config: GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + - GenerateRoutingUtilizationLabelResource(blueLabelResource, blueLabelName, redLabelResource) + - GenerateRoutingUtilizationLabelResource(greenLabelResource, greenLabelName, blueLabelResource) + + Config: routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + + routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(blueLabelResource, blueLabelName, redLabelResource) + + routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(greenLabelResource, greenLabelName, blueLabelResource) + generateRoutingUtilizationResource( - generateRoutingUtilMediaType("call", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("callback", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("chat", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("email", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("message", maxCapacity1, util.FalseValue), - generateLabelUtilization(redLabelResource, maxCapacity1), - generateLabelUtilization(blueLabelResource, maxCapacity1, redLabelResource), + GenerateRoutingUtilMediaType("call", maxCapacity1, util.FalseValue), + GenerateRoutingUtilMediaType("callback", maxCapacity1, util.FalseValue), + GenerateRoutingUtilMediaType("chat", maxCapacity1, util.FalseValue), + GenerateRoutingUtilMediaType("email", maxCapacity1, util.FalseValue), + GenerateRoutingUtilMediaType("message", maxCapacity1, util.FalseValue), + routingUtilizationLabel.GenerateLabelUtilization(redLabelResource, maxCapacity1), + routingUtilizationLabel.GenerateLabelUtilization(blueLabelResource, maxCapacity1, redLabelResource), ), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("genesyscloud_routing_utilization.routing-util", "call.0.maximum_capacity", maxCapacity1), @@ -157,17 +160,17 @@ func TestAccResourceRoutingUtilizationWithLabels(t *testing.T) { }, { // Update with a new max capacities and interruptible media types - Config: GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + - GenerateRoutingUtilizationLabelResource(blueLabelResource, blueLabelName, redLabelResource) + - GenerateRoutingUtilizationLabelResource(greenLabelResource, greenLabelName, blueLabelResource) + + Config: routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + + routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(blueLabelResource, blueLabelName, redLabelResource) + + routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(greenLabelResource, greenLabelName, blueLabelResource) + generateRoutingUtilizationResource( - generateRoutingUtilMediaType("call", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeEmail)), - generateRoutingUtilMediaType("callback", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("chat", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("email", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("message", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateLabelUtilization(redLabelResource, maxCapacity2), - generateLabelUtilization(blueLabelResource, maxCapacity2, redLabelResource), + GenerateRoutingUtilMediaType("call", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeEmail)), + GenerateRoutingUtilMediaType("callback", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + GenerateRoutingUtilMediaType("chat", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + GenerateRoutingUtilMediaType("email", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + GenerateRoutingUtilMediaType("message", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilizationLabel.GenerateLabelUtilization(redLabelResource, maxCapacity2), + routingUtilizationLabel.GenerateLabelUtilization(blueLabelResource, maxCapacity2, redLabelResource), ), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("genesyscloud_routing_utilization.routing-util", "call.0.maximum_capacity", maxCapacity2), @@ -192,27 +195,27 @@ func TestAccResourceRoutingUtilizationWithLabels(t *testing.T) { ), }, { //Delete one by one to avoid conflict - Config: GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + - GenerateRoutingUtilizationLabelResource(blueLabelResource, blueLabelName, redLabelResource) + + Config: routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + + routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(blueLabelResource, blueLabelName, redLabelResource) + generateRoutingUtilizationResource( - generateRoutingUtilMediaType("call", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeEmail)), - generateRoutingUtilMediaType("callback", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("chat", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("email", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("message", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateLabelUtilization(redLabelResource, maxCapacity2), - generateLabelUtilization(blueLabelResource, maxCapacity2, redLabelResource), + GenerateRoutingUtilMediaType("call", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeEmail)), + GenerateRoutingUtilMediaType("callback", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + GenerateRoutingUtilMediaType("chat", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + GenerateRoutingUtilMediaType("email", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + GenerateRoutingUtilMediaType("message", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilizationLabel.GenerateLabelUtilization(redLabelResource, maxCapacity2), + routingUtilizationLabel.GenerateLabelUtilization(blueLabelResource, maxCapacity2, redLabelResource), ), }, { - Config: GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + + Config: routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + generateRoutingUtilizationResource( - generateRoutingUtilMediaType("call", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeEmail)), - generateRoutingUtilMediaType("callback", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("chat", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("email", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("message", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateLabelUtilization(redLabelResource, maxCapacity2), + GenerateRoutingUtilMediaType("call", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeEmail)), + GenerateRoutingUtilMediaType("callback", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + GenerateRoutingUtilMediaType("chat", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + GenerateRoutingUtilMediaType("email", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + GenerateRoutingUtilMediaType("message", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilizationLabel.GenerateLabelUtilization(redLabelResource, maxCapacity2), ), }, { @@ -273,37 +276,6 @@ func assertAttributeEquals(state *terraform.InstanceState, attributeName, expect } } -func generateRoutingUtilMediaType( - mediaType string, - maxCapacity string, - includeNonAcd string, - interruptTypes ...string) string { - return fmt.Sprintf(`%s { - maximum_capacity = %s - include_non_acd = %s - interruptible_media_types = [%s] - } - `, mediaType, maxCapacity, includeNonAcd, strings.Join(interruptTypes, ",")) -} - -func generateLabelUtilization( - labelResource string, - maxCapacity string, - interruptingLabelResourceNames ...string) string { - - interruptingLabelResources := make([]string, 0) - for _, resourceName := range interruptingLabelResourceNames { - interruptingLabelResources = append(interruptingLabelResources, "genesyscloud_routing_utilization_label."+resourceName+".id") - } - - return fmt.Sprintf(`label_utilizations { - label_id = genesyscloud_routing_utilization_label.%s.id - maximum_capacity = %s - interrupting_label_ids = [%s] - } - `, labelResource, maxCapacity, strings.Join(interruptingLabelResources, ",")) -} - func generateRoutingUtilizationResource(attributes ...string) string { return fmt.Sprintf(`resource "genesyscloud_routing_utilization" "routing-util" { %s @@ -311,19 +283,24 @@ func generateRoutingUtilizationResource(attributes ...string) string { `, strings.Join(attributes, "\n")) } -func CleanupRoutingUtilizationLabel() { - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) +func CleanupRoutingUtilizationLabel() error { + config, err := provider.AuthorizeSdk() + if err != nil { + return err + } + + routingAPI := platformclientv2.NewRoutingApiWithConfig(config) for pageNum := 1; ; pageNum++ { const pageSize = 100 labels, _, getErr := routingAPI.GetRoutingUtilizationLabels(pageSize, pageNum, "", "") if getErr != nil { log.Printf("failed to get page %v of routing email domains: %v", pageNum, getErr) - return + return getErr } if labels.Entities == nil || len(*labels.Entities) == 0 { - return + return nil } for _, label := range *labels.Entities { diff --git a/genesyscloud/routing_utilization/resource_routing_utilization_utils.go b/genesyscloud/routing_utilization/resource_routing_utilization_utils.go new file mode 100644 index 000000000..060d857b8 --- /dev/null +++ b/genesyscloud/routing_utilization/resource_routing_utilization_utils.go @@ -0,0 +1,135 @@ +package routing_utilization + +import ( + "fmt" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "sort" + "strings" + "terraform-provider-genesyscloud/genesyscloud/util/lists" +) + +func buildSdkMediaUtilizations(d *schema.ResourceData) *map[string]platformclientv2.Mediautilization { + settings := make(map[string]platformclientv2.Mediautilization) + + for sdkType, schemaType := range UtilizationMediaTypes { + mediaSettings := d.Get(schemaType).([]interface{}) + if mediaSettings != nil && len(mediaSettings) > 0 { + settings[sdkType] = BuildSdkMediaUtilization(mediaSettings) + } + } + + return &settings +} + +func BuildSdkMediaUtilization(settings []interface{}) platformclientv2.Mediautilization { + settingsMap := settings[0].(map[string]interface{}) + + maxCapacity := settingsMap["maximum_capacity"].(int) + includeNonAcd := settingsMap["include_non_acd"].(bool) + + // Optional + interruptableMediaTypes := &[]string{} + if types, ok := settingsMap["interruptible_media_types"]; ok { + interruptableMediaTypes = lists.SetToStringList(types.(*schema.Set)) + } + + return platformclientv2.Mediautilization{ + MaximumCapacity: &maxCapacity, + IncludeNonAcd: &includeNonAcd, + InterruptableMediaTypes: interruptableMediaTypes, + } +} + +func BuildLabelUtilizationsRequest(labelUtilizations []interface{}) map[string]LabelUtilization { + request := make(map[string]LabelUtilization) + for _, labelUtilization := range labelUtilizations { + labelUtilizationMap := labelUtilization.(map[string]interface{}) + interruptingLabelIds := lists.SetToStringList(labelUtilizationMap["interrupting_label_ids"].(*schema.Set)) + + request[labelUtilizationMap["label_id"].(string)] = LabelUtilization{ + MaximumCapacity: int32(labelUtilizationMap["maximum_capacity"].(int)), + InterruptingLabelIds: *interruptingLabelIds, + } + } + return request +} + +func FlattenUtilizationSetting(settings MediaUtilization) []interface{} { + settingsMap := make(map[string]interface{}) + + settingsMap["maximum_capacity"] = settings.MaximumCapacity + settingsMap["include_non_acd"] = settings.IncludeNonAcd + if settings.InterruptableMediaTypes != nil { + settingsMap["interruptible_media_types"] = lists.StringListToSet(settings.InterruptableMediaTypes) + } + + return []interface{}{settingsMap} +} + +func FilterAndFlattenLabelUtilizations(labelUtilizations map[string]LabelUtilization, originalLabelUtilizations []interface{}) []interface{} { + flattenedLabelUtilizations := make([]interface{}, 0) + + for _, originalLabelUtilization := range originalLabelUtilizations { + originalLabelId := (originalLabelUtilization.(map[string]interface{}))["label_id"].(string) + + for currentLabelId, currentLabelUtilization := range labelUtilizations { + if currentLabelId == originalLabelId { + flattenedLabelUtilizations = append(flattenedLabelUtilizations, flattenLabelUtilization(currentLabelId, currentLabelUtilization)) + delete(labelUtilizations, currentLabelId) + break + } + } + } + + return flattenedLabelUtilizations +} + +func flattenLabelUtilization(labelId string, labelUtilization LabelUtilization) map[string]interface{} { + utilizationMap := make(map[string]interface{}) + + utilizationMap["label_id"] = labelId + utilizationMap["maximum_capacity"] = labelUtilization.MaximumCapacity + if labelUtilization.InterruptingLabelIds != nil { + utilizationMap["interrupting_label_ids"] = lists.StringListToSet(labelUtilization.InterruptingLabelIds) + } + + return utilizationMap +} + +func GenerateRoutingUtilMediaType( + mediaType string, + maxCapacity string, + includeNonAcd string, + interruptTypes ...string) string { + return fmt.Sprintf(`%s { + maximum_capacity = %s + include_non_acd = %s + interruptible_media_types = [%s] + } + `, mediaType, maxCapacity, includeNonAcd, strings.Join(interruptTypes, ",")) +} + +func getSdkUtilizationTypes() []string { + types := make([]string, 0, len(UtilizationMediaTypes)) + for t := range UtilizationMediaTypes { + types = append(types, t) + } + sort.Strings(types) + return types +} + +// TODO: remove when routing skill group is refactored +func buildHeaderParams(routingAPI *platformclientv2.RoutingApi) map[string]string { + headerParams := make(map[string]string) + + for key := range routingAPI.Configuration.DefaultHeader { + headerParams[key] = routingAPI.Configuration.DefaultHeader[key] + } + + headerParams["Authorization"] = "Bearer " + routingAPI.Configuration.AccessToken + headerParams["Content-Type"] = "application/json" + headerParams["Accept"] = "application/json" + + return headerParams +} diff --git a/genesyscloud/routing_utilization_label/data_source_genesyscloud_routing_utilization_label.go b/genesyscloud/routing_utilization_label/data_source_genesyscloud_routing_utilization_label.go new file mode 100644 index 000000000..f4c1e55a9 --- /dev/null +++ b/genesyscloud/routing_utilization_label/data_source_genesyscloud_routing_utilization_label.go @@ -0,0 +1,33 @@ +package routing_utilization_label + +import ( + "context" + "fmt" + "terraform-provider-genesyscloud/genesyscloud/provider" + "terraform-provider-genesyscloud/genesyscloud/util" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceRoutingUtilizationLabelRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + sdkConfig := m.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingUtilizationLabelProxy(sdkConfig) + name := d.Get("name").(string) + + return util.WithRetries(ctx, 15*time.Second, func() *retry.RetryError { + label, retryable, resp, getErr := proxy.getRoutingUtilizationLabelByName(ctx, name) + + if getErr != nil && !retryable{ + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Error requesting label %s | error: %s", name, getErr), resp)) + } + + if retryable { + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("No labels found with name %s", name), resp)) + } + d.SetId(*label.Id) + return nil + }) +} diff --git a/genesyscloud/data_source_genesyscloud_routing_utilization_label_test.go b/genesyscloud/routing_utilization_label/data_source_genesyscloud_routing_utilization_label_test.go similarity index 95% rename from genesyscloud/data_source_genesyscloud_routing_utilization_label_test.go rename to genesyscloud/routing_utilization_label/data_source_genesyscloud_routing_utilization_label_test.go index 7822c81e5..d30634274 100644 --- a/genesyscloud/data_source_genesyscloud_routing_utilization_label_test.go +++ b/genesyscloud/routing_utilization_label/data_source_genesyscloud_routing_utilization_label_test.go @@ -1,4 +1,4 @@ -package genesyscloud +package routing_utilization_label import ( "fmt" @@ -20,7 +20,7 @@ func TestAccDataSourceRoutingUtilizationLabel(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) - if err := checkIfLabelsAreEnabled(); err != nil { + if err := CheckIfLabelsAreEnabled(); err != nil { t.Skipf("%v", err) // be sure to skip the test and not fail it } }, diff --git a/genesyscloud/routing_utilization_label/genesyscloud_routing_utilization_label_init_test.go b/genesyscloud/routing_utilization_label/genesyscloud_routing_utilization_label_init_test.go new file mode 100644 index 000000000..4de37bfab --- /dev/null +++ b/genesyscloud/routing_utilization_label/genesyscloud_routing_utilization_label_init_test.go @@ -0,0 +1,52 @@ +package routing_utilization_label + +import ( + "sync" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +var providerDataSources map[string]*schema.Resource +var providerResources map[string]*schema.Resource + +type registerTestInstance struct { + resourceMapMutex sync.RWMutex + datasourceMapMutex sync.RWMutex +} + +// registerTestResources registers all resources used in the tests +func (r *registerTestInstance) registerTestResources() { + r.resourceMapMutex.Lock() + defer r.resourceMapMutex.Unlock() + + providerResources[resourceName] = ResourceRoutingUtilizationLabel() +} + +// registerTestDataSources registers all data sources used in the tests. +func (r *registerTestInstance) registerTestDataSources() { + r.datasourceMapMutex.Lock() + defer r.datasourceMapMutex.Unlock() + + providerDataSources[resourceName] = DataSourceRoutingUtilizationLabel() +} + +// initTestResources initializes all test resources and data sources. +func initTestResources() { + providerDataSources = make(map[string]*schema.Resource) + providerResources = make(map[string]*schema.Resource) + + regInstance := ®isterTestInstance{} + + regInstance.registerTestDataSources() + regInstance.registerTestResources() +} + +// TestMain is a "setup" function called by the testing framework when run the test +func TestMain(m *testing.M) { + // Run setup function before starting the test suite for routing_utilization_label package + initTestResources() + + // Run the test suite for the routing_utilization_label package + m.Run() +} diff --git a/genesyscloud/routing_utilization_label/genesyscloud_routing_utilization_label_proxy.go b/genesyscloud/routing_utilization_label/genesyscloud_routing_utilization_label_proxy.go new file mode 100644 index 000000000..fc19feb6c --- /dev/null +++ b/genesyscloud/routing_utilization_label/genesyscloud_routing_utilization_label_proxy.go @@ -0,0 +1,149 @@ +package routing_utilization_label + +import ( + "context" + "fmt" + "log" + rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" + + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" +) + +var internalProxy *routingUtilizationLabelProxy + +type getAllRoutingUtilizationLabelsFunc func(ctx context.Context, p *routingUtilizationLabelProxy, name string) (*[]platformclientv2.Utilizationlabel, *platformclientv2.APIResponse, error) +type createRoutingUtilizationLabelFunc func(ctx context.Context, p *routingUtilizationLabelProxy, req *platformclientv2.Createutilizationlabelrequest) (*platformclientv2.Utilizationlabel, *platformclientv2.APIResponse, error) +type getRoutingUtilizationLabelFunc func(ctx context.Context, p *routingUtilizationLabelProxy, id string) (*platformclientv2.Utilizationlabel, *platformclientv2.APIResponse, error) +type getRoutingUtilizationLabelByNameFunc func(ctx context.Context, p *routingUtilizationLabelProxy, name string) (*platformclientv2.Utilizationlabel, bool, *platformclientv2.APIResponse, error) +type updateRoutingUtilizationLabelFunc func(ctx context.Context, p *routingUtilizationLabelProxy, id string, updateutilizationlabelrequest *platformclientv2.Updateutilizationlabelrequest) (*platformclientv2.Utilizationlabel, *platformclientv2.APIResponse, error) +type deleteRoutingUtilizationLabelFunc func(ctx context.Context, p *routingUtilizationLabelProxy, id string, forceDelete bool) (*platformclientv2.APIResponse, error) + +type routingUtilizationLabelProxy struct { + clientConfig *platformclientv2.Configuration + routingApi *platformclientv2.RoutingApi + getAllRoutingUtilizationLabelsAttr getAllRoutingUtilizationLabelsFunc + createRoutingUtilizationLabelAttr createRoutingUtilizationLabelFunc + getRoutingUtilizationLabelAttr getRoutingUtilizationLabelFunc + getRoutingUtilizationLabelByNameAttr getRoutingUtilizationLabelByNameFunc + updateRoutingUtilizationLabelAttr updateRoutingUtilizationLabelFunc + deleteRoutingUtilizationLabelAttr deleteRoutingUtilizationLabelFunc + routingCache rc.CacheInterface[platformclientv2.Utilizationlabel] +} + +func newRoutingUtilizationLabelProxy(clientConfig *platformclientv2.Configuration) *routingUtilizationLabelProxy { + api := platformclientv2.NewRoutingApiWithConfig(clientConfig) + routingCache := rc.NewResourceCache[platformclientv2.Utilizationlabel]() + return &routingUtilizationLabelProxy{ + clientConfig: clientConfig, + routingApi: api, + getAllRoutingUtilizationLabelsAttr: getAllRoutingUtilizationLabelsFn, + createRoutingUtilizationLabelAttr: createRoutingUtilizationLabelFn, + getRoutingUtilizationLabelAttr: getRoutingUtilizationLabelFn, + getRoutingUtilizationLabelByNameAttr: getRoutingUtilizationLabelByNameFn, + updateRoutingUtilizationLabelAttr: updateRoutingUtilizationLabelFn, + deleteRoutingUtilizationLabelAttr: deleteRoutingUtilizationLabelFn, + routingCache: routingCache, + } +} + +func getRoutingUtilizationLabelProxy(clientConfig *platformclientv2.Configuration) *routingUtilizationLabelProxy { + if internalProxy == nil { + internalProxy = newRoutingUtilizationLabelProxy(clientConfig) + } + return internalProxy +} + +func (p *routingUtilizationLabelProxy) getAllRoutingUtilizationLabels(ctx context.Context, name string) (*[]platformclientv2.Utilizationlabel, *platformclientv2.APIResponse, error) { + return p.getAllRoutingUtilizationLabelsAttr(ctx, p, name) +} + +func (p *routingUtilizationLabelProxy) createRoutingUtilizationLabel(ctx context.Context, req *platformclientv2.Createutilizationlabelrequest) (*platformclientv2.Utilizationlabel, *platformclientv2.APIResponse, error) { + return p.createRoutingUtilizationLabelAttr(ctx, p, req) +} + +func (p *routingUtilizationLabelProxy) getRoutingUtilizationLabel(ctx context.Context, id string) (*platformclientv2.Utilizationlabel, *platformclientv2.APIResponse, error) { + return p.getRoutingUtilizationLabelAttr(ctx, p, id) +} + +func (p *routingUtilizationLabelProxy) getRoutingUtilizationLabelByName(ctx context.Context, name string) (*platformclientv2.Utilizationlabel, bool, *platformclientv2.APIResponse, error) { + return p.getRoutingUtilizationLabelByNameAttr(ctx, p, name) +} + +func (p *routingUtilizationLabelProxy) updateRoutingUtilizationLabel(ctx context.Context, id string, req *platformclientv2.Updateutilizationlabelrequest) (*platformclientv2.Utilizationlabel, *platformclientv2.APIResponse, error) { + return p.updateRoutingUtilizationLabelAttr(ctx, p, id, req) +} + +func (p *routingUtilizationLabelProxy) deleteRoutingUtilizationLabel(ctx context.Context, id string, forceDelete bool) (*platformclientv2.APIResponse, error) { + return p.deleteRoutingUtilizationLabelAttr(ctx, p, id, forceDelete) +} + +func getAllRoutingUtilizationLabelsFn(_ context.Context, p *routingUtilizationLabelProxy, name string) (*[]platformclientv2.Utilizationlabel, *platformclientv2.APIResponse, error) { + var allUtilizationLabels []platformclientv2.Utilizationlabel + const pageSize = 100 + + labels, resp, err := p.routingApi.GetRoutingUtilizationLabels(100, 1, "", name) + if err != nil { + return nil, resp, fmt.Errorf("failed to get routing utilization labels | error: %s", err) + } + + if labels.Entities == nil || len(*labels.Entities) == 0 { + return &allUtilizationLabels, resp, nil + } + allUtilizationLabels = append(allUtilizationLabels, *labels.Entities...) + + for pageNum := 2; pageNum <= *labels.PageCount; pageNum++ { + labels, resp, err := p.routingApi.GetRoutingUtilizationLabels(pageSize, pageNum, "", name) + if err != nil { + return nil, resp, fmt.Errorf("failed to get routing utilization labels | error: %s", err) + } + + if labels.Entities == nil || len(*labels.Entities) == 0 { + break + } + allUtilizationLabels = append(allUtilizationLabels, *labels.Entities...) + } + + for _, label := range allUtilizationLabels { + rc.SetCache(p.routingCache, *label.Id, label) + } + + return &allUtilizationLabels, resp, nil +} + +func createRoutingUtilizationLabelFn(_ context.Context, p *routingUtilizationLabelProxy, req *platformclientv2.Createutilizationlabelrequest) (*platformclientv2.Utilizationlabel, *platformclientv2.APIResponse, error) { + return p.routingApi.PostRoutingUtilizationLabels(*req) +} + +func getRoutingUtilizationLabelFn(_ context.Context, p *routingUtilizationLabelProxy, id string) (*platformclientv2.Utilizationlabel, *platformclientv2.APIResponse, error) { + if label := rc.GetCacheItem(p.routingCache, id); label != nil { + return label, nil, nil + } + return p.routingApi.GetRoutingUtilizationLabel(id) +} + +func getRoutingUtilizationLabelByNameFn(ctx context.Context, p *routingUtilizationLabelProxy, name string) (*platformclientv2.Utilizationlabel, bool, *platformclientv2.APIResponse, error) { + labels, resp, err := getAllRoutingUtilizationLabelsFn(ctx, p, name) + if err != nil { + return nil, false, resp, fmt.Errorf("error retrieving routing utilization label by name %s", err) + } + + if labels == nil || len(*labels) == 0{ + return nil, true, resp, fmt.Errorf("no routing utilization labels found with name %s", name) + } + + for _, label := range *labels { + if *label.Name == name { + log.Printf("Retrieved routing utilization label %s by name %s", *label.Id, name) + return &label, false, resp, nil + } + } + return nil, true, resp, fmt.Errorf("no routing utilization label found with name: %s", name) +} + +func updateRoutingUtilizationLabelFn(_ context.Context, p *routingUtilizationLabelProxy, id string, req *platformclientv2.Updateutilizationlabelrequest) (*platformclientv2.Utilizationlabel, *platformclientv2.APIResponse, error) { + return p.routingApi.PutRoutingUtilizationLabel(id, *req) +} + +func deleteRoutingUtilizationLabelFn(_ context.Context, p *routingUtilizationLabelProxy, id string, forceDelete bool) (*platformclientv2.APIResponse, error) { + return p.routingApi.DeleteRoutingUtilizationLabel(id, forceDelete) +} diff --git a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label.go b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label.go new file mode 100644 index 000000000..c4ca7d422 --- /dev/null +++ b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label.go @@ -0,0 +1,123 @@ +package routing_utilization_label + +import ( + "context" + "fmt" + "log" + "terraform-provider-genesyscloud/genesyscloud/provider" + "terraform-provider-genesyscloud/genesyscloud/util" + "terraform-provider-genesyscloud/genesyscloud/util/constants" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + + "terraform-provider-genesyscloud/genesyscloud/consistency_checker" + + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" +) + +func getAllRoutingUtilizationLabels(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { + resources := make(resourceExporter.ResourceIDMetaMap) + proxy := getRoutingUtilizationLabelProxy(clientConfig) + + labels, resp, getErr := proxy.getAllRoutingUtilizationLabels(ctx, "") + if getErr != nil { + return nil, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to get page of labels error: %s", getErr), resp) + } + + for _, label := range *labels { + resources[*label.Id] = &resourceExporter.ResourceMeta{Name: *label.Name} + } + return resources, nil +} + +func createRoutingUtilizationLabel(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + name := d.Get("name").(string) + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingUtilizationLabelProxy(sdkConfig) + + log.Printf("Creating label %s", name) + + label, resp, err := proxy.createRoutingUtilizationLabel(ctx, &platformclientv2.Createutilizationlabelrequest{ + Name: &name, + }) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to create label %s error: %s", name, err), resp) + } + + d.SetId(*label.Id) + + log.Printf("Created label %s %s", name, *label.Id) + return readRoutingUtilizationLabel(ctx, d, meta) +} + +func readRoutingUtilizationLabel(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingUtilizationLabelProxy(sdkConfig) + cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceRoutingUtilizationLabel(), constants.DefaultConsistencyChecks, resourceName) + + log.Printf("Reading label %s", d.Id()) + return util.WithRetriesForRead(ctx, d, func() *retry.RetryError { + label, resp, getErr := proxy.getRoutingUtilizationLabel(ctx, d.Id()) + + if getErr != nil { + if util.IsStatus404(resp) { + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read label %s | error: %s", d.Id(), getErr), resp)) + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read label %s | error: %s", d.Id(), getErr), resp)) + } + + _ = d.Set("name", *label.Name) + log.Printf("Read label %s %s", d.Id(), *label.Name) + return cc.CheckState(d) + }) +} + +func updateRoutingUtilizationLabel(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingUtilizationLabelProxy(sdkConfig) + + id := d.Id() + name := d.Get("name").(string) + + log.Printf("Updating label %s with name %s", id, name) + _, resp, err := proxy.updateRoutingUtilizationLabel(ctx, id, &platformclientv2.Updateutilizationlabelrequest{ + Name: &name, + }) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to update label %s error: %s", id, err), resp) + } + + log.Printf("Updated label %s", id) + return readRoutingUtilizationLabel(ctx, d, meta) +} + +func deleteRoutingUtilizationLabel(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + name := d.Get("name").(string) + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingUtilizationLabelProxy(sdkConfig) + + log.Printf("Deleting label %s %s", d.Id(), name) + resp, err := proxy.deleteRoutingUtilizationLabel(ctx, d.Id(), true) + + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to delete label %s error: %s", name, err), resp) + } + + return util.WithRetries(ctx, 30*time.Second, func() *retry.RetryError { + _, resp, err := proxy.getRoutingUtilizationLabel(ctx, d.Id()) + + if err != nil { + if util.IsStatus404(resp) { + log.Printf("Deleted Routing label %s", d.Id()) + return nil + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Error deleting Routing label %s: %s", d.Id(), err), resp)) + } + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Routing label %s still exists", d.Id()), resp)) + }) +} diff --git a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_schema.go b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_schema.go new file mode 100644 index 000000000..92761f50a --- /dev/null +++ b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_schema.go @@ -0,0 +1,61 @@ +package routing_utilization_label + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" +) + +const resourceName = "genesyscloud_routing_utilization_label" + +// SetRegistrar registers all the resources and exporters in the package +func SetRegistrar(regInstance registrar.Registrar) { + regInstance.RegisterResource(resourceName, ResourceRoutingUtilizationLabel()) + regInstance.RegisterDataSource(resourceName, DataSourceRoutingUtilizationLabel()) + regInstance.RegisterExporter(resourceName, RoutingUtilizationLabelExporter()) +} + +func ResourceRoutingUtilizationLabel() *schema.Resource { + return &schema.Resource{ + Description: "Genesys Cloud Routing Utilization Label. This resource is not yet widely available. Only use it if the feature is enabled.", + + CreateContext: provider.CreateWithPooledClient(createRoutingUtilizationLabel), + ReadContext: provider.ReadWithPooledClient(readRoutingUtilizationLabel), + UpdateContext: provider.UpdateWithPooledClient(updateRoutingUtilizationLabel), + DeleteContext: provider.DeleteWithPooledClient(deleteRoutingUtilizationLabel), + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + SchemaVersion: 1, + Schema: map[string]*schema.Schema{ + "name": { + Description: "Label name.", + Type: schema.TypeString, + Required: true, + }, + }, + } +} + +func DataSourceRoutingUtilizationLabel() *schema.Resource { + return &schema.Resource{ + Description: "Data source for Genesys Cloud Routing Utilization Labels. Select a label by name.", + ReadContext: provider.ReadWithPooledClient(dataSourceRoutingUtilizationLabelRead), + Schema: map[string]*schema.Schema{ + "name": { + Description: "Label name.", + Type: schema.TypeString, + ValidateFunc: validation.StringDoesNotContainAny("*"), + Required: true, + }, + }, + } +} + +func RoutingUtilizationLabelExporter() *resourceExporter.ResourceExporter { + return &resourceExporter.ResourceExporter{ + GetResourcesFunc: provider.GetAllWithPooledClient(getAllRoutingUtilizationLabels), + } +} diff --git a/genesyscloud/resource_genesyscloud_routing_utilization_label_test.go b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_test.go similarity index 71% rename from genesyscloud/resource_genesyscloud_routing_utilization_label_test.go rename to genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_test.go index 83c153f26..793fb3f3f 100644 --- a/genesyscloud/resource_genesyscloud_routing_utilization_label_test.go +++ b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_test.go @@ -1,4 +1,4 @@ -package genesyscloud +package routing_utilization_label import ( "fmt" @@ -22,7 +22,7 @@ func TestAccResourceRoutingUtilizationLabelBasic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) - if err := checkIfLabelsAreEnabled(); err != nil { + if err := CheckIfLabelsAreEnabled(); err != nil { t.Skipf("%v", err) // be sure to skip the test and not fail it } }, @@ -61,20 +61,6 @@ func TestAccResourceRoutingUtilizationLabelBasic(t *testing.T) { }) } -func GenerateRoutingUtilizationLabelResource(resourceID string, name string, dependsOnResource string) string { - dependsOn := "" - - if dependsOnResource != "" { - dependsOn = fmt.Sprintf("depends_on=[genesyscloud_routing_utilization_label.%s]", dependsOnResource) - } - - return fmt.Sprintf(`resource "genesyscloud_routing_utilization_label" "%s" { - name = "%s" - %s - } - `, resourceID, name, dependsOn) -} - func validateTestLabelDestroyed(state *terraform.State) error { routingApi := platformclientv2.NewRoutingApi() @@ -98,12 +84,3 @@ func validateTestLabelDestroyed(state *terraform.State) error { return fmt.Errorf("No label resource found") } - -func checkIfLabelsAreEnabled() error { // remove once the feature is globally enabled - api := platformclientv2.NewRoutingApiWithConfig(sdkConfig) // the variable sdkConfig exists at a package level in ./genesyscloud and is already authorized - _, resp, _ := api.GetRoutingUtilizationLabels(100, 1, "", "") - if resp.StatusCode == 501 { - return fmt.Errorf("feature is not yet implemented in this org.") - } - return nil -} diff --git a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_utils.go b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_utils.go new file mode 100644 index 000000000..22322c59d --- /dev/null +++ b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_utils.go @@ -0,0 +1,54 @@ +package routing_utilization_label + +import ( + "fmt" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "strings" + "terraform-provider-genesyscloud/genesyscloud/provider" +) + +func GenerateRoutingUtilizationLabelResource(resourceID string, name string, dependsOnResource string) string { + dependsOn := "" + + if dependsOnResource != "" { + dependsOn = fmt.Sprintf("depends_on=[genesyscloud_routing_utilization_label.%s]", dependsOnResource) + } + + return fmt.Sprintf(`resource "genesyscloud_routing_utilization_label" "%s" { + name = "%s" + %s + } + `, resourceID, name, dependsOn) +} + +func CheckIfLabelsAreEnabled() error { // remove once the feature is globally enabled + sdkConfig, err := provider.AuthorizeSdk() + if err != nil { + return err + } + + api := platformclientv2.NewRoutingApiWithConfig(sdkConfig) + _, resp, _ := api.GetRoutingUtilizationLabels(100, 1, "", "") + if resp.StatusCode == 501 { + return fmt.Errorf("feature is not yet implemented in this org.") + } + return nil +} + +func GenerateLabelUtilization( + labelResource string, + maxCapacity string, + interruptingLabelResourceNames ...string) string { + + interruptingLabelResources := make([]string, 0) + for _, resourceName := range interruptingLabelResourceNames { + interruptingLabelResources = append(interruptingLabelResources, "genesyscloud_routing_utilization_label."+resourceName+".id") + } + + return fmt.Sprintf(`label_utilizations { + label_id = genesyscloud_routing_utilization_label.%s.id + maximum_capacity = %s + interrupting_label_ids = [%s] + } + `, labelResource, maxCapacity, strings.Join(interruptingLabelResources, ",")) +} diff --git a/genesyscloud/tfexporter/tf_exporter_resource_test.go b/genesyscloud/tfexporter/tf_exporter_resource_test.go index e9edddbbb..e2bb97141 100644 --- a/genesyscloud/tfexporter/tf_exporter_resource_test.go +++ b/genesyscloud/tfexporter/tf_exporter_resource_test.go @@ -9,9 +9,9 @@ import ( flowLogLevel "terraform-provider-genesyscloud/genesyscloud/flow_loglevel" outboundContactListContact "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list_contact" routingSettings "terraform-provider-genesyscloud/genesyscloud/routing_settings" - + routingUtilization "terraform-provider-genesyscloud/genesyscloud/routing_utilization" + routingUtilizationLabel "terraform-provider-genesyscloud/genesyscloud/routing_utilization_label" outboundRoute "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site_outbound_route" - grammar "terraform-provider-genesyscloud/genesyscloud/architect_grammar" grammarLanguage "terraform-provider-genesyscloud/genesyscloud/architect_grammar_language" archIvr "terraform-provider-genesyscloud/genesyscloud/architect_ivr" @@ -155,8 +155,8 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_routing_queue_outbound_email_address"] = routingQueueOutboundEmailAddress.ResourceRoutingQueueOutboundEmailAddress() providerResources["genesyscloud_routing_skill"] = gcloud.ResourceRoutingSkill() providerResources["genesyscloud_routing_settings"] = routingSettings.ResourceRoutingSettings() - providerResources["genesyscloud_routing_utilization"] = gcloud.ResourceRoutingUtilization() - + providerResources["genesyscloud_routing_utilization"] = routingUtilization.ResourceRoutingUtilization() + providerResources["genesyscloud_routing_utilization_label"] = routingUtilizationLabel.ResourceRoutingUtilizationLabel() providerResources["genesyscloud_routing_wrapupcode"] = gcloud.ResourceRoutingWrapupCode() providerResources["genesyscloud_telephony_providers_edges_extension_pool"] = edgeExtension.ResourceTelephonyExtensionPool() providerResources["genesyscloud_telephony_providers_edges_phone"] = edgePhone.ResourcePhone() @@ -245,7 +245,6 @@ func (r *registerTestInstance) registerTestExporters() { RegisterExporter("genesyscloud_outbound_campaign", obCampaign.OutboundCampaignExporter()) RegisterExporter("genesyscloud_outbound_contact_list", outboundContactList.OutboundContactListExporter()) RegisterExporter("genesyscloud_outbound_contact_list_contact", outboundContactListContact.ContactExporter()) - RegisterExporter("genesyscloud_outbound_contactlistfilter", obContactListFilter.OutboundContactlistfilterExporter()) RegisterExporter("genesyscloud_outbound_messagingcampaign", ob.OutboundMessagingcampaignExporter()) RegisterExporter("genesyscloud_outbound_sequence", obSequence.OutboundSequenceExporter()) @@ -270,7 +269,8 @@ func (r *registerTestInstance) registerTestExporters() { RegisterExporter("genesyscloud_routing_skill", gcloud.RoutingSkillExporter()) RegisterExporter("genesyscloud_routing_skill_group", gcloud.ResourceSkillGroupExporter()) RegisterExporter("genesyscloud_routing_sms_address", routingSmsAddress.RoutingSmsAddressExporter()) - RegisterExporter("genesyscloud_routing_utilization", gcloud.RoutingUtilizationExporter()) + RegisterExporter("genesyscloud_routing_utilization", routingUtilization.RoutingUtilizationExporter()) + RegisterExporter("genesyscloud_routing_utilization_label", routingUtilizationLabel.RoutingUtilizationLabelExporter()) RegisterExporter("genesyscloud_routing_wrapupcode", gcloud.RoutingWrapupCodeExporter()) RegisterExporter("genesyscloud_telephony_providers_edges_edge_group", edgeGroup.EdgeGroupExporter()) RegisterExporter("genesyscloud_telephony_providers_edges_extension_pool", edgeExtension.TelephonyExtensionPoolExporter()) diff --git a/main.go b/main.go index e8ce504d5..01df3ea64 100644 --- a/main.go +++ b/main.go @@ -60,6 +60,8 @@ import ( responsemanagementResponseasset "terraform-provider-genesyscloud/genesyscloud/responsemanagement_responseasset" routingEmailRoute "terraform-provider-genesyscloud/genesyscloud/routing_email_route" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" + routingUtilization "terraform-provider-genesyscloud/genesyscloud/routing_utilization" + routingUtilizationLabel "terraform-provider-genesyscloud/genesyscloud/routing_utilization_label" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/plugin" @@ -226,6 +228,8 @@ func registerResources() { routingQueueOutboundEmailAddress.SetRegistrar(regInstance) //Registering routing queue outbound email address outboundContactListContact.SetRegistrar(regInstance) //Registering outbound contact list contact routingSettings.SetRegistrar(regInstance) //Registering routing Settings + routingUtilization.SetRegistrar(regInstance) // Registering routing utilization + routingUtilizationLabel.SetRegistrar(regInstance) // Registering routing utilization label journeyViews.SetRegistrar(regInstance) //Registering journey views // setting resources for Use cases like TF export where provider is used in resource classes. From da751e2db8b33dde76080fe2d7aac9fea75dcfcd Mon Sep 17 00:00:00 2001 From: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Date: Tue, 25 Jun 2024 09:36:08 +0100 Subject: [PATCH 26/62] Merge Dev to Main for Release v1.41.0 (#1118) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 (#1008) * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.1 to 0.19.2. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.1...v0.19.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * ran go generate --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * DEVTOOLING-352 - provider oauth credential rate limit exceeded (#1004) * Testing something * Adding retry * Fixed retry * Moved functionality to retries package * Fixed inport cycle * Extending sleep * Added retry to AuthorizeSdk * Using with retries * Remving old function * Feat/devtooling 461 - WithRetries errors include improved logging (#1012) * calling diag func * Changed retryable functions to call Diagnostic function * Converted all withRetries errors to have improved wrapper * Made requested Changes * fixing unit test * Bump golang.org/x/net from 0.23.0 to 0.25.0 (#1017) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.25.0. - [Commits](https://github.com/golang/net/compare/v0.23.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix for issue 993 : Changed message_column to optional and add verification logic (#1013) * Changed message_column to optional and add verification logic * applied safer nil value handling * go generate (#1018) * bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1015) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Revert "bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1…" (#1019) This reverts commit 3ff66d472071905b18b4f66f6ee4b3d3725600e7. * bug/devtooling 560 - CX as Code crash when creating phones (#1020) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Made requested Change * feat/devtooling 579 - Improved Logging for Non-API errors (#1021) * Adding improved non-api diag errors * Pulling Merged PR * Added improved error * Added more logging * Ran go vet * Updated docs * Bump hashicorp/setup-terraform from 3.1.0 to 3.1.1 (#1024) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bug/devtooling 362 - Evaluation forms incorrectly assigning published attribute (#1022) * Correctly sets published feature * Added functionality to set published field correctly * Fixed docs * Bug/devtooling 444: Custom resolver function for outbound campaign script_id (#1014) * Resolving campaign script_id to default outbound script data source when appropriate * Created constants package * editing scripts proxy so that the datasource catches Default scripts * Finished writing tests for new campaign field custom resolver * Fixed linting errors in campaigns package * implemented caching for campaigns exporter * minor changes to a comment * Add deleteCacheItem func + some refactoring work * Refactoring call to resolveToDataSource function and added unit test * Fixing script data source test * Bump github.com/nyaruka/phonenumbers from 1.3.4 to 1.3.5 (#1026) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.4 to 1.3.5. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.4...v1.3.5) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Devtooling-162: Refactored idp salesforce (#999) * Refactored idp salesforce * Fixing docs * Changed function name * Removed original file * Changed Build Function Call to fix type difference (#1029) * fixing test for published attribute (#1030) * No jira: fixing up a few acceptance tests (#1031) * fixed journey segment update * Adding check to journey segment tests to validate is feature is supported * preventing panic in export helper function * Adding sleep to milestone data source test * Cleaning up fmt.Print statements appearing in export tests * undoing changes to segment resource file * Fix routing queue (#1028) * README update (#1025) * Pre-verify if the tfState is in sync with the exporter (#1027) * Add state comapartors * Upddate review comments * Devtooling-591: Consistency Checker Refactor (#1032) * Moved where consistency checker is created in resources * Cleaned up consitency checker file * Added resource name to message * Conditionally adding name * Made requested changes * Feature/devtooling 589 1 (#1035) * update doc * fix reviews * Fix acceptance tests - TCA and Prod (#1033) * Fix edge,export,script test,Jenkin to run tca&prod * Fix export & integration tests * Fix auth tests Fix auth tests * fix tests * resolve conflicts * move assignregion func, remove commented function modify to return empty string - assignregion func return default region --------- Co-authored-by: Monisha Padmavathi Ragavan * Bug/devtooling 597 - Routing email route test failing (#1039) * Added call to cleanup function * linter * adding hotfix to pr labeler config file (#1042) * bug/DEVTOOLING-436 - Added cleanup function for webdeployments resources (#1038) * Added cleanup function for webdeployments resources * fixing conflict * Made requested changes * Made requested changes * Bump github.com/hashicorp/terraform-plugin-sdk/v2 from 2.33.0 to 2.34.0 (#1047) Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.33.0 to 2.34.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.33.0...v2.34.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bug/devtooling 287 temp disable cchecker (#1037) * removed consistency checker * changed DID number * phoneUpdated * Merging dev to main for v1.38.0 (#1036) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 (#1008) * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.1 to 0.19.2. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.1...v0.19.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * ran go generate --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * DEVTOOLING-352 - provider oauth credential rate limit exceeded (#1004) * Testing something * Adding retry * Fixed retry * Moved functionality to retries package * Fixed inport cycle * Extending sleep * Added retry to AuthorizeSdk * Using with retries * Remving old function * Feat/devtooling 461 - WithRetries errors include improved logging (#1012) * calling diag func * Changed retryable functions to call Diagnostic function * Converted all withRetries errors to have improved wrapper * Made requested Changes * fixing unit test * Bump golang.org/x/net from 0.23.0 to 0.25.0 (#1017) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.25.0. - [Commits](https://github.com/golang/net/compare/v0.23.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix for issue 993 : Changed message_column to optional and add verification logic (#1013) * Changed message_column to optional and add verification logic * applied safer nil value handling * go generate (#1018) * bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1015) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Revert "bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1…" (#1019) This reverts commit 3ff66d472071905b18b4f66f6ee4b3d3725600e7. * bug/devtooling 560 - CX as Code crash when creating phones (#1020) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Made requested Change * feat/devtooling 579 - Improved Logging for Non-API errors (#1021) * Adding improved non-api diag errors * Pulling Merged PR * Added improved error * Added more logging * Ran go vet * Updated docs * Bump hashicorp/setup-terraform from 3.1.0 to 3.1.1 (#1024) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bug/devtooling 362 - Evaluation forms incorrectly assigning published attribute (#1022) * Correctly sets published feature * Added functionality to set published field correctly * Fixed docs * Bug/devtooling 444: Custom resolver function for outbound campaign script_id (#1014) * Resolving campaign script_id to default outbound script data source when appropriate * Created constants package * editing scripts proxy so that the datasource catches Default scripts * Finished writing tests for new campaign field custom resolver * Fixed linting errors in campaigns package * implemented caching for campaigns exporter * minor changes to a comment * Add deleteCacheItem func + some refactoring work * Refactoring call to resolveToDataSource function and added unit test * Fixing script data source test * Bump github.com/nyaruka/phonenumbers from 1.3.4 to 1.3.5 (#1026) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.4 to 1.3.5. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.4...v1.3.5) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Devtooling-162: Refactored idp salesforce (#999) * Refactored idp salesforce * Fixing docs * Changed function name * Removed original file * Changed Build Function Call to fix type difference (#1029) * fixing test for published attribute (#1030) * No jira: fixing up a few acceptance tests (#1031) * fixed journey segment update * Adding check to journey segment tests to validate is feature is supported * preventing panic in export helper function * Adding sleep to milestone data source test * Cleaning up fmt.Print statements appearing in export tests * undoing changes to segment resource file * Fix routing queue (#1028) * README update (#1025) * Pre-verify if the tfState is in sync with the exporter (#1027) * Add state comapartors * Upddate review comments * Devtooling-591: Consistency Checker Refactor (#1032) * Moved where consistency checker is created in resources * Cleaned up consitency checker file * Added resource name to message * Conditionally adding name * Made requested changes * Feature/devtooling 589 1 (#1035) * update doc * fix reviews --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * NO-JIRA: Fixing nil pointer in consistency checker (#1041) * Fixed nil pointer in consistency checker * Fixed a few more nil pointers * Fixing nil pointer (#1045) * merged with dev --------- Signed-off-by: dependabot[bot] Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * Fixing up provider docs (#1046) * Fix Export Version problem (#1049) * Logging error in queue create/update instead of failing (#1050) * Refactor/devtooling 395 (#1044) * refactor/DEVTOOLING-395 - adding architect_schedules package * Addressed PR comments * added caching in schedules * Report Generation & testcase fix (#1051) * Report generation generate report generate report * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests * fix tests * fix tests fix tests fix tests * fix tests * fix report * fix report * fix tests fix tests * Bump github.com/hashicorp/terraform-plugin-sdk/v2 from 2.33.0 to 2.34.0 (#1047) Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.33.0 to 2.34.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.33.0...v2.34.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bug/devtooling 287 temp disable cchecker (#1037) * removed consistency checker * changed DID number * phoneUpdated * Merging dev to main for v1.38.0 (#1036) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 (#1008) * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.1 to 0.19.2. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.1...v0.19.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * ran go generate --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * DEVTOOLING-352 - provider oauth credential rate limit exceeded (#1004) * Testing something * Adding retry * Fixed retry * Moved functionality to retries package * Fixed inport cycle * Extending sleep * Added retry to AuthorizeSdk * Using with retries * Remving old function * Feat/devtooling 461 - WithRetries errors include improved logging (#1012) * calling diag func * Changed retryable functions to call Diagnostic function * Converted all withRetries errors to have improved wrapper * Made requested Changes * fixing unit test * Bump golang.org/x/net from 0.23.0 to 0.25.0 (#1017) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.25.0. - [Commits](https://github.com/golang/net/compare/v0.23.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix for issue 993 : Changed message_column to optional and add verification logic (#1013) * Changed message_column to optional and add verification logic * applied safer nil value handling * go generate (#1018) * bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1015) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Revert "bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1…" (#1019) This reverts commit 3ff66d472071905b18b4f66f6ee4b3d3725600e7. * bug/devtooling 560 - CX as Code crash when creating phones (#1020) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Made requested Change * feat/devtooling 579 - Improved Logging for Non-API errors (#1021) * Adding improved non-api diag errors * Pulling Merged PR * Added improved error * Added more logging * Ran go vet * Updated docs * Bump hashicorp/setup-terraform from 3.1.0 to 3.1.1 (#1024) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bug/devtooling 362 - Evaluation forms incorrectly assigning published attribute (#1022) * Correctly sets published feature * Added functionality to set published field correctly * Fixed docs * Bug/devtooling 444: Custom resolver function for outbound campaign script_id (#1014) * Resolving campaign script_id to default outbound script data source when appropriate * Created constants package * editing scripts proxy so that the datasource catches Default scripts * Finished writing tests for new campaign field custom resolver * Fixed linting errors in campaigns package * implemented caching for campaigns exporter * minor changes to a comment * Add deleteCacheItem func + some refactoring work * Refactoring call to resolveToDataSource function and added unit test * Fixing script data source test * Bump github.com/nyaruka/phonenumbers from 1.3.4 to 1.3.5 (#1026) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.4 to 1.3.5. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.4...v1.3.5) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Devtooling-162: Refactored idp salesforce (#999) * Refactored idp salesforce * Fixing docs * Changed function name * Removed original file * Changed Build Function Call to fix type difference (#1029) * fixing test for published attribute (#1030) * No jira: fixing up a few acceptance tests (#1031) * fixed journey segment update * Adding check to journey segment tests to validate is feature is supported * preventing panic in export helper function * Adding sleep to milestone data source test * Cleaning up fmt.Print statements appearing in export tests * undoing changes to segment resource file * Fix routing queue (#1028) * README update (#1025) * Pre-verify if the tfState is in sync with the exporter (#1027) * Add state comapartors * Upddate review comments * Devtooling-591: Consistency Checker Refactor (#1032) * Moved where consistency checker is created in resources * Cleaned up consitency checker file * Added resource name to message * Conditionally adding name * Made requested changes * Feature/devtooling 589 1 (#1035) * update doc * fix reviews --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * NO-JIRA: Fixing nil pointer in consistency checker (#1041) * Fixed nil pointer in consistency checker * Fixed a few more nil pointers * Fixing nil pointer (#1045) * merged with dev --------- Signed-off-by: dependabot[bot] Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * Fixing up provider docs (#1046) * fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests --------- Signed-off-by: dependabot[bot] Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * Add extra check for dependency resolution (#1052) * Devtooling 604: Infinite loop retrieving knowledge documents (#1053) * DEVTOOLING-282 * Adding log message indicating we're hitting the specific scenario for which the integration no longer exist * working around cycling dependencies per charliecon recommendation * adding implementation function getIntegrationByIdFn * Export integration credential only if it matches the expected format - DEVTOOLING-310 * infite loop bugfix --------- Co-authored-by: Will <37446330+williamjeuniaux@users.noreply.github.com> * Feat/COBROWSE-2404 add cobrowse config field (#1054) * made changes similar to what Mateusz did for other fields * updated version * mod and sum fix --------- Co-authored-by: ivan * No jira: Fixing dev with go generate & go mod tidy (#1057) * Fixed go.mod + removed refs to old sdk version * Small refactoring + go generate * DEVTOOLING-592: Changed team members logic (#1055) * Changed team members logic * moved function * Updated docs * Updated docs * Updated docs * Updated docs * Rand go generate * Bump github.com/nyaruka/phonenumbers from 1.3.5 to 1.3.6 (#1056) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.5 to 1.3.6. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.5...v1.3.6) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Feat/devtooling-477: Site Outbound Routes Resource (#1048) * Moving outbound routes to own package * Continued with outbound routes * Finished outboudn routes resource * Ran linter and added exporter * Added api to doc * Added caching * Fixed small bug * Made requested changes * Fixed go version * No jira: fix dev (#1059) * removed ref to old sdk * logging outbound route export error instead of failing * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.2 to 0.19.3 (#1062) Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.2 to 0.19.3. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.2...v0.19.3) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Cache for Data Sources (#1064) * Cache for Data Sources * fix context issue during actual run * DEVTOOLING-603: Media recording poilicies missing from export (#1063) * Caling api manually instead of using sdk * Small change to data source * Bump golang.org/x/net from 0.25.0 to 0.26.0 (#1072) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.25.0 to 0.26.0. - [Commits](https://github.com/golang/net/compare/v0.25.0...v0.26.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.3 to 0.19.4 (#1073) Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.3 to 0.19.4. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.3...v0.19.4) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Feat/devtooling 610 (#1065) * added data source for routing email route * added data source files * changes for name to pattern * updated docs * conflicts resolved * comments resolved for feat/DEVTOOLING-610 * Fixing Tests By removing unsupported arguments (#1070) * Fixing test (#1074) * Refactor/devtooling 156 (#1060) * idp_adfs refactoring * made changes for the getalladfs func * error handling changes * changes done according to unrefractor resource * changes return type * did changes for test idp_adfs * bug fixes * resolved comments * resolved comments * resolved comments * Bug/devtooling 584 (#1071) * Cache for Data Sources * fix context issue during actual run * pushing changes * removed debugging logger * addressed PR changes * updated note * resolved merge conflicts --------- Co-authored-by: HemanthDogiparthi12 Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * fix api call strategy (#1075) * [JM-1457]: Add resource for journey views (#1067) * Merging dev to main for v1.39.0 (#1061) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 (#1008) * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.1 to 0.19.2. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.1...v0.19.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * ran go generate --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * DEVTOOLING-352 - provider oauth credential rate limit exceeded (#1004) * Testing something * Adding retry * Fixed retry * Moved functionality to retries package * Fixed inport cycle * Extending sleep * Added retry to AuthorizeSdk * Using with retries * Remving old function * Feat/devtooling 461 - WithRetries errors include improved logging (#1012) * calling diag func * Changed retryable functions to call Diagnostic function * Converted all withRetries errors to have improved wrapper * Made requested Changes * fixing unit test * Bump golang.org/x/net from 0.23.0 to 0.25.0 (#1017) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.25.0. - [Commits](https://github.com/golang/net/compare/v0.23.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix for issue 993 : Changed message_column to optional and add verification logic (#1013) * Changed message_column to optional and add verification logic * applied safer nil value handling * go generate (#1018) * bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1015) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Revert "bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1…" (#1019) This reverts commit 3ff66d472071905b18b4f66f6ee4b3d3725600e7. * bug/devtooling 560 - CX as Code crash when creating phones (#1020) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Made requested Change * feat/devtooling 579 - Improved Logging for Non-API errors (#1021) * Adding improved non-api diag errors * Pulling Merged PR * Added improved error * Added more logging * Ran go vet * Updated docs * Bump hashicorp/setup-terraform from 3.1.0 to 3.1.1 (#1024) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bug/devtooling 362 - Evaluation forms incorrectly assigning published attribute (#1022) * Correctly sets published feature * Added functionality to set published field correctly * Fixed docs * Bug/devtooling 444: Custom resolver function for outbound campaign script_id (#1014) * Resolving campaign script_id to default outbound script data source when appropriate * Created constants package * editing scripts proxy so that the datasource catches Default scripts * Finished writing tests for new campaign field custom resolver * Fixed linting errors in campaigns package * implemented caching for campaigns exporter * minor changes to a comment * Add deleteCacheItem func + some refactoring work * Refactoring call to resolveToDataSource function and added unit test * Fixing script data source test * Bump github.com/nyaruka/phonenumbers from 1.3.4 to 1.3.5 (#1026) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.4 to 1.3.5. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.4...v1.3.5) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Devtooling-162: Refactored idp salesforce (#999) * Refactored idp salesforce * Fixing docs * Changed function name * Removed original file * Changed Build Function Call to fix type difference (#1029) * fixing test for published attribute (#1030) * No jira: fixing up a few acceptance tests (#1031) * fixed journey segment update * Adding check to journey segment tests to validate is feature is supported * preventing panic in export helper function * Adding sleep to milestone data source test * Cleaning up fmt.Print statements appearing in export tests * undoing changes to segment resource file * Fix routing queue (#1028) * README update (#1025) * Pre-verify if the tfState is in sync with the exporter (#1027) * Add state comapartors * Upddate review comments * Devtooling-591: Consistency Checker Refactor (#1032) * Moved where consistency checker is created in resources * Cleaned up consitency checker file * Added resource name to message * Conditionally adding name * Made requested changes * Feature/devtooling 589 1 (#1035) * update doc * fix reviews * Fix acceptance tests - TCA and Prod (#1033) * Fix edge,export,script test,Jenkin to run tca&prod * Fix export & integration tests * Fix auth tests Fix auth tests * fix tests * resolve conflicts * move assignregion func, remove commented function modify to return empty string - assignregion func return default region --------- Co-authored-by: Monisha Padmavathi Ragavan * Bug/devtooling 597 - Routing email route test failing (#1039) * Added call to cleanup function * linter * adding hotfix to pr labeler config file (#1042) * bug/DEVTOOLING-436 - Added cleanup function for webdeployments resources (#1038) * Added cleanup function for webdeployments resources * fixing conflict * Made requested changes * Made requested changes * Bump github.com/hashicorp/terraform-plugin-sdk/v2 from 2.33.0 to 2.34.0 (#1047) Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.33.0 to 2.34.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.33.0...v2.34.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bug/devtooling 287 temp disable cchecker (#1037) * removed consistency checker * changed DID number * phoneUpdated * Merging dev to main for v1.38.0 (#1036) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to rou… * Fixes #1078 (#1079) * Coverage Report and fixing tests (#1080) * Report generation generate report generate report * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests * fix tests * fix tests fix tests fix tests * fix tests * fix report * fix report * fix tests fix tests * Bump github.com/hashicorp/terraform-plugin-sdk/v2 from 2.33.0 to 2.34.0 (#1047) Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.33.0 to 2.34.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.33.0...v2.34.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bug/devtooling 287 temp disable cchecker (#1037) * removed consistency checker * changed DID number * phoneUpdated * Merging dev to main for v1.38.0 (#1036) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 (#1008) * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.1 to 0.19.2. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.1...v0.19.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * ran go generate --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * DEVTOOLING-352 - provider oauth credential rate limit exceeded (#1004) * Testing something * Adding retry * Fixed retry * Moved functionality to retries package * Fixed inport cycle * Extending sleep * Added retry to AuthorizeSdk * Using with retries * Remving old function * Feat/devtooling 461 - WithRetries errors include improved logging (#1012) * calling diag func * Changed retryable functions to call Diagnostic function * Converted all withRetries errors to have improved wrapper * Made requested Changes * fixing unit test * Bump golang.org/x/net from 0.23.0 to 0.25.0 (#1017) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.25.0. - [Commits](https://github.com/golang/net/compare/v0.23.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix for issue 993 : Changed message_column to optional and add verification logic (#1013) * Changed message_column to optional and add verification logic * applied safer nil value handling * go generate (#1018) * bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1015) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Revert "bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1…" (#1019) This reverts commit 3ff66d472071905b18b4f66f6ee4b3d3725600e7. * bug/devtooling 560 - CX as Code crash when creating phones (#1020) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Made requested Change * feat/devtooling 579 - Improved Logging for Non-API errors (#1021) * Adding improved non-api diag errors * Pulling Merged PR * Added improved error * Added more logging * Ran go vet * Updated docs * Bump hashicorp/setup-terraform from 3.1.0 to 3.1.1 (#1024) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bug/devtooling 362 - Evaluation forms incorrectly assigning published attribute (#1022) * Correctly sets published feature * Added functionality to set published field correctly * Fixed docs * Bug/devtooling 444: Custom resolver function for outbound campaign script_id (#1014) * Resolving campaign script_id to default outbound script data source when appropriate * Created constants package * editing scripts proxy so that the datasource catches Default scripts * Finished writing tests for new campaign field custom resolver * Fixed linting errors in campaigns package * implemented caching for campaigns exporter * minor changes to a comment * Add deleteCacheItem func + some refactoring work * Refactoring call to resolveToDataSource function and added unit test * Fixing script data source test * Bump github.com/nyaruka/phonenumbers from 1.3.4 to 1.3.5 (#1026) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.4 to 1.3.5. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.4...v1.3.5) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Devtooling-162: Refactored idp salesforce (#999) * Refactored idp salesforce * Fixing docs * Changed function name * Removed original file * Changed Build Function Call to fix type difference (#1029) * fixing test for published attribute (#1030) * No jira: fixing up a few acceptance tests (#1031) * fixed journey segment update * Adding check to journey segment tests to validate is feature is supported * preventing panic in export helper function * Adding sleep to milestone data source test * Cleaning up fmt.Print statements appearing in export tests * undoing changes to segment resource file * Fix routing queue (#1028) * README update (#1025) * Pre-verify if the tfState is in sync with the exporter (#1027) * Add state comapartors * Upddate review comments * Devtooling-591: Consistency Checker Refactor (#1032) * Moved where consistency checker is created in resources * Cleaned up consitency checker file * Added resource name to message * Conditionally adding name * Made requested changes * Feature/devtooling 589 1 (#1035) * update doc * fix reviews --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * NO-JIRA: Fixing nil pointer in consistency checker (#1041) * Fixed nil pointer in consistency checker * Fixed a few more nil pointers * Fixing nil pointer (#1045) * merged with dev --------- Signed-off-by: dependabot[bot] Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * Fixing up provider docs (#1046) * fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * Package wise coverage report * Package wise coverage report * fix tests * fix tests * fix tests * fix tests * fix tests * fix tests * Modify coverage report to list all data * Display coverage report, data in same page * fix newly added tests * fix newly added tests * fix user tests * fix failing tests * Cache for Data Sources (#1064) * Cache for Data Sources * fix context issue during actual run * fix tests Fix failing tests fix tests * Add didpool for phoneresource * fix tests * fix tests * modify logging modify logging modify logging modify logging --------- Signed-off-by: dependabot[bot] Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * fixing go vet warnings/errors (#1081) * refactored idp_okta resource (#1069) * refactored idp_okta resource * updated the docs * comments resolved * comments resolved * ran go generate * updated docs and bug fix * fix update issues for workType (#1076) * fix update issues for workType * Delete genesyscloud/task_management_worktype/WorkType.go * Fix caching issue (#1082) * Fix caching issue * fix docs * Feature/fix unit tests (#1090) * Update worktype * fix test case * fix exporter crash (#1101) * fix exporter crash problem * review comment * added caching capabilities (#1088) * Update Description (#1104) * [JM-1466]: Upgrade the platform client version (#1100) * [JM-1457]: Add resource for journey views * [JM-1457]: import journey view as variable in main.go * [JM-1457]: Remove print statements * [JM-1457]: Refactor code * Remove default values from optional fields * [JM-1457]: Refactor and generate the doc * Remove default value from eventCountType * [JM-1457]: Filter should be nil if not given * Merge with dev * [JM-1457]: Filter should be nil if not given * [JM-1466]: Upgrade platform client version --------- Co-authored-by: Mohammed Islam * Devtooling 501: Removing support for v1 and v1-http widget deployments (#1097) * Updated widget_deployment schema to reflect API changes * updated example widget deployment resource * Removed old client_config field from schema and fixed data source test * Returned client_config field and marked it as deprecated * refactor/Tidy up journey_segment resource tests/doc (#1103) * Fix issues identified in DEVTOOLING-662 as a result of testing DEVTOOLING-477 (#1109) * Updating docs (#1110) * feat/devtooling 71: Outbound contact list contact resource (#1084) * Creating contact_list_contact resource * Defined contact list contact resource schema * Defined more boiler plate code for contact package + started working on create func * implemented read function for contact resource * finished crud operations and started testing * Refactored calls to GenerateMap test util function * Necessary refactoring to get contact test passing * extending contact_list_contact tests * Removed id field from schema + added example data * go generate * Adding contact_list_contact exporter * Updated gc sdk version and finished contact exporter * finishing contact exporter * DEVTOOLING-643 : Adds support for using sanitized names in export. (#1106) * Adds support for using sanitized names in export. This allows you to copy the names from the results of an export and reuse them as include/exclude filters in a new export * Fix Typo * Fix quotes * Bug/devtooling 659 (#1108) * added nil check * added nil check for line properties * Bump github.com/hashicorp/hcl/v2 from 2.20.1 to 2.21.0 (#1113) Bumps [github.com/hashicorp/hcl/v2](https://github.com/hashicorp/hcl) from 2.20.1 to 2.21.0. - [Release notes](https://github.com/hashicorp/hcl/releases) - [Changelog](https://github.com/hashicorp/hcl/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/hcl/compare/v2.20.1...v2.21.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/hcl/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Feat/devtooling 187 - Refactor routing settings (#1089) * Refactored Routing Settings * Added missing attributes to schema * Removed data source * Made requested Changes * Fixing merge conflicts * DEVTOOLING-601: Queue member assignment taking long time (#1107) * Sped up member assignment * Used diag error wrapper * Fixes #1086 + some minor refactoring (#1111) * Feat/devtooling 618 (#1083) * code for compression * added compression logic in generateoutput func * added fields compress and passphrase * removed passphrase flag * updated docs * moved the compression logic to a function * added test case for compress flag * comments resolved * updated docs * resolved comments * commenting RefAttr in trunkbasesettings exporter to fix unit test (#1115) * Merge unit tests & fix failing testcases (#1116) * run unit tests * run unit tests * add unit test * Fix failing tests * fix failed tests * Fix failing tests * Fix webdeployment testcases * Fix webdeployment testcases * Run remaining unit tests * Revert export changes * Fix export tests * Fix widget tests * Modify to delete list of didpool --------- Co-authored-by: Monisha Padmavathi Ragavan * onholdprompt attribute added along with test case (#1114) * refactor/Devtooling-190 [routing_utilization] + Devtooling-400 [routing_utilization_label] (#1105) * Refactored but waiting for cyclic dependency removal * refactor routing utilization label * Tidy up * Updated docs * fixing naming convention in tf_export * fixing user test * Requested changes * fixing merge conflicts * Refactored but waiting for cyclic dependency removal * refactor routing utilization label * Tidy up * Updated docs * fixing naming convention in tf_export * fixing user test * fixing merge * fixing docs * Made requested changes * changes * fixing tests --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: Charlie Conneely Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> Co-authored-by: sureshperiyappan <61573777+sureshperiyappan@users.noreply.github.com> Co-authored-by: willjeuniaux-genesys <153622483+willjeuniaux-genesys@users.noreply.github.com> Co-authored-by: Will <37446330+williamjeuniaux@users.noreply.github.com> Co-authored-by: Ivan Mikhalchenko Co-authored-by: ivan Co-authored-by: shrutisuryawanshigenesys Co-authored-by: HemanthDogiparthi12 Co-authored-by: Majharul Islam Rafat Co-authored-by: Mohammed Islam Co-authored-by: tsantos-genesys <154342374+tsantos-genesys@users.noreply.github.com> Co-authored-by: Brian Goad --- docs/data-sources/routing_settings.md | 44 -- docs/resources/journey_segment.md | 2 +- .../outbound_contact_list_contact.md | 115 ++++++ docs/resources/routing_queue.md | 1 + docs/resources/routing_settings.md | 2 + docs/resources/tf_export.md | 1 + docs/resources/widget_deployment.md | 16 +- .../apis.md | 4 + .../resource.tf | 37 ++ .../resource.tf | 5 +- ...source_genesyscloud_architect_datatable.go | 2 +- ...source_genesyscloud_architect_datatable.go | 2 +- ..._genesyscloud_architect_datatable_proxy.go | 2 +- ...e_genesyscloud_architect_datatable_test.go | 2 +- ...esyscloud_architect_datatable_row_utils.go | 2 +- ...ce_genesyscloud_architect_datatable_row.go | 2 +- ...esyscloud_architect_datatable_row_proxy.go | 2 +- ...nesyscloud_architect_datatable_row_test.go | 2 +- ...syscloud_architect_emergencygroup_proxy.go | 2 +- ...e_genesyscloud_architect_emergencygroup.go | 2 +- ...esyscloud_architect_emergencygroup_test.go | 2 +- ...syscloud_architect_emergencygroup_utils.go | 2 +- ...ource_genesyscloud_architect_flow_proxy.go | 2 +- .../resource_genesyscloud_flow.go | 2 +- .../resource_genesyscloud_flow_test.go | 2 +- .../genesyscloud_architect_grammar_proxy.go | 2 +- ...resource_genesyscloud_architect_grammar.go | 2 +- ...rce_genesyscloud_architect_grammar_test.go | 2 +- ...scloud_architect_grammar_language_proxy.go | 2 +- ...genesyscloud_architect_grammar_language.go | 2 +- ...yscloud_architect_grammar_language_test.go | 2 +- ...scloud_architect_grammar_language_utils.go | 2 +- ..._source_genesyscloud_architect_ivr_test.go | 2 +- .../genesyscloud_architect_ivr_proxy.go | 2 +- ...esyscloud_architect_ivr_proxy_unit_test.go | 2 +- .../resource_genesyscloud_architect_ivr.go | 2 +- ...ource_genesyscloud_architect_ivr_schema.go | 4 +- ...esource_genesyscloud_architect_ivr_test.go | 2 +- ...ce_genesyscloud_architect_ivr_unit_test.go | 2 +- ...source_genesyscloud_architect_ivr_utils.go | 2 +- ...syscloud_architect_schedulegroups_proxy.go | 2 +- ...e_genesyscloud_architect_schedulegroups.go | 2 +- ...esyscloud_architect_schedulegroups_test.go | 2 +- .../genesyscloud_architect_schedules_proxy.go | 2 +- ...source_genesyscloud_architect_schedules.go | 2 +- ...e_genesyscloud_architect_schedules_test.go | 2 +- ...enesyscloud_architect_user_prompt_proxy.go | 2 +- ...urce_genesyscloud_architect_user_prompt.go | 2 +- ...genesyscloud_architect_user_prompt_test.go | 2 +- ...enesyscloud_architect_user_prompt_utils.go | 2 +- .../data_source_genesyscloud_auth_role.go | 2 +- .../auth_role/genesyscloud_auth_role_proxy.go | 19 +- .../resource_genesyscloud_auth_role.go | 2 +- .../resource_genesyscloud_auth_role_test.go | 2 +- .../resource_genesyscloud_auth_role_utils.go | 2 +- ...genesyscloud_authorization_product_test.go | 2 +- ...enesyscloud_authorization_product_proxy.go | 2 +- ...source_genesyscloud_architect_schedules.go | 2 +- .../data_source_genesyscloud_auth_division.go | 2 +- ..._source_genesyscloud_auth_division_home.go | 2 +- ..._source_genesyscloud_journey_action_map.go | 2 +- ...ce_genesyscloud_journey_action_template.go | 2 +- ...ata_source_genesyscloud_journey_outcome.go | 2 +- ...ata_source_genesyscloud_journey_segment.go | 2 +- ..._source_genesyscloud_knowledge_category.go | 2 +- ...ce_genesyscloud_knowledge_knowledgebase.go | 2 +- ...ata_source_genesyscloud_knowledge_label.go | 2 +- .../data_source_genesyscloud_location.go | 2 +- ...ta_source_genesyscloud_organizations_me.go | 2 +- ...e_genesyscloud_quality_forms_evaluation.go | 2 +- ...ource_genesyscloud_quality_forms_survey.go | 2 +- ...ource_genesyscloud_routing_email_domain.go | 2 +- ..._genesyscloud_routing_email_domain_test.go | 2 +- ...ta_source_genesyscloud_routing_language.go | 2 +- ...urce_genesyscloud_routing_language_test.go | 6 + ...ta_source_genesyscloud_routing_settings.go | 45 -- ...urce_genesyscloud_routing_settings_test.go | 65 --- .../data_source_genesyscloud_routing_skill.go | 2 +- ...source_genesyscloud_routing_skill_group.go | 100 +++-- ...e_genesyscloud_routing_skill_group_test.go | 4 +- ..._genesyscloud_routing_utilization_label.go | 53 --- ..._source_genesyscloud_routing_wrapupcode.go | 2 +- genesyscloud/data_source_genesyscloud_user.go | 2 +- ...a_source_genesyscloud_widget_deployment.go | 2 +- ...rce_genesyscloud_widget_deployment_test.go | 20 +- .../genesyscloud_dependent_consumer_proxy.go | 2 +- ...mance_externalmetrics_definitions_proxy.go | 2 +- ...performance_externalmetrics_definitions.go | 2 +- ...rmance_externalmetrics_definitions_test.go | 2 +- ...loud_externalcontacts_contact_init_test.go | 1 - ...syscloud_externalcontacts_contact_proxy.go | 16 +- ...e_genesyscloud_externalcontacts_contact.go | 2 +- ...yscloud_externalcontacts_contact_schema.go | 6 +- ...esyscloud_externalcontacts_contact_test.go | 2 +- ...syscloud_externalcontacts_contact_utils.go | 2 +- .../genesyscloud_flow_loglevel_proxy.go | 2 +- .../resource_genesyscloud_flow_loglevel.go | 2 +- ...esource_genesyscloud_flow_loglevel_test.go | 2 +- .../genesyscloud_flow_milestone_proxy.go | 2 +- .../resource_genesyscloud_flow_milestone.go | 2 +- ...source_genesyscloud_flow_milestone_test.go | 2 +- ...ource_genesyscloud_flow_milestone_utils.go | 2 +- .../genesyscloud_flow_outcome_proxy.go | 2 +- .../resource_genesyscloud_flow_outcome.go | 2 +- ...esource_genesyscloud_flow_outcome_utils.go | 2 +- .../data_source_genesyscloud_group_test.go | 2 +- .../group/genesyscloud_group_proxy.go | 2 +- .../group/resource_genesyscloud_group.go | 2 +- .../group/resource_genesyscloud_group_test.go | 2 +- .../resource_genesyscloud_group_utils.go | 2 +- .../genesyscloud_group_roles_proxy.go | 2 +- ...esource_genesyscloud_group_roles_schema.go | 2 +- ...resource_genesyscloud_group_roles_utils.go | 2 +- .../idp_adfs/genesyscloud_idp_adfs_proxy.go | 2 +- .../resource_genesyscloud_idp_adfs.go | 2 +- .../resource_genesyscloud_idp_adfs_test.go | 2 +- .../idp_okta/genesyscloud_idp_okta_proxy.go | 2 +- .../resource_genesyscloud_idp_okta.go | 2 +- .../resource_genesyscloud_idp_okta_test.go | 2 +- .../genesyscloud_idp_salesforce_proxy.go | 2 +- .../resource_genesyscloud_idp_salesforce.go | 2 +- ...source_genesyscloud_idp_salesforce_test.go | 2 +- .../genesyscloud_integration_proxy.go | 2 +- .../resource_genesyscloud_integration.go | 2 +- .../resource_genesyscloud_integration_test.go | 10 +- ...resource_genesyscloud_integration_utils.go | 2 +- .../genesyscloud_integration_action_proxy.go | 2 +- ...esource_genesyscloud_integration_action.go | 2 +- ...ce_genesyscloud_integration_action_test.go | 38 +- ...e_genesyscloud_integration_action_utils.go | 2 +- ...enesyscloud_integration_credential_test.go | 4 +- ...nesyscloud_integration_credential_proxy.go | 2 +- ...rce_genesyscloud_integration_credential.go | 2 +- ...enesyscloud_integration_credential_test.go | 36 +- ...nesyscloud_integration_credential_utils.go | 4 +- ...oud_integration_custom_auth_action_test.go | 2 +- ...ud_integration_custom_auth_action_proxy.go | 2 +- ...syscloud_integration_custom_auth_action.go | 2 +- ...oud_integration_custom_auth_action_test.go | 6 +- ...ud_integration_custom_auth_action_utils.go | 2 +- ...yscloud_journey_outcome_predictor_proxy.go | 2 +- ..._genesyscloud_journey_outcome_predictor.go | 2 +- ...syscloud_journey_outcome_predictor_test.go | 2 +- .../genesyscloud_journey_views_proxy.go | 2 +- .../resource_genesyscloud_journey_views.go | 4 +- ...esource_genesyscloud_journey_views_test.go | 2 +- ...source_genesyscloud_journey_views_utils.go | 2 +- .../resource_genesyscloud_oauth_client.go | 2 +- ...esource_genesyscloud_oauth_client_proxy.go | 2 +- ...esource_genesyscloud_oauth_client_utils.go | 2 +- ...ce_genesyscloude_oauth_client_unit_test.go | 2 +- ...anization_authentication_settings_proxy.go | 2 +- ...ud_organization_authentication_settings.go | 2 +- ...ation_authentication_settings_unit_test.go | 2 +- ...anization_authentication_settings_utils.go | 2 +- ...syscloud_orgauthorization_pairing_proxy.go | 2 +- ...e_genesyscloud_orgauthorization_pairing.go | 2 +- ...rce_genesyscloud_outbound_cattemptlimit.go | 2 +- ...genesyscloud_outbound_messagingcampaign.go | 2 +- ...yscloud_outbound_messagingcampaign_test.go | 2 +- ...genesyscloud_outbound_messagingcampaign.go | 2 +- ...yscloud_outbound_messagingcampaign_test.go | 2 +- ...urce_genesyscloud_outbound_attemptlimit.go | 2 +- ...urce_genesyscloud_outbound_attemptlimit.go | 2 +- ...genesyscloud_outbound_attemptlimit_test.go | 2 +- ...syscloud_outbound_callabletimeset_proxy.go | 2 +- ...e_genesyscloud_outbound_callabletimeset.go | 2 +- ...yscloud_outbound_callabletimeset_schema.go | 6 +- ...esyscloud_outbound_callabletimeset_test.go | 2 +- ...syscloud_outbound_callabletimeset_utils.go | 2 +- ..._outbound_callanalysisresponseset_proxy.go | 2 +- ...scloud_outbound_callanalysisresponseset.go | 2 +- ...d_outbound_callanalysisresponseset_test.go | 2 +- ..._outbound_callanalysisresponseset_utils.go | 2 +- ...enesyscloud_outbound_campaign_init_test.go | 2 +- .../genesyscloud_outbound_campaign_proxy.go | 2 +- ...resource_genesyscloud_outbound_campaign.go | 2 +- ...rce_genesyscloud_outbound_campaign_test.go | 2 +- ...ce_genesyscloud_outbound_campaign_utils.go | 2 +- ...urce_genesyscloud_outbound_campaignrule.go | 2 +- ...enesyscloud_outbound_campaignrule_proxy.go | 2 +- ...urce_genesyscloud_outbound_campaignrule.go | 2 +- ...genesyscloud_outbound_campaignrule_test.go | 2 +- ...yscloud_outbound_campaignrule_unit_test.go | 2 +- ...enesyscloud_outbound_campaignrule_utils.go | 2 +- ...ource_genesyscloud_outbound_contactlist.go | 2 +- ...ource_genesyscloud_outbound_contactlist.go | 12 +- ..._genesyscloud_outbound_contactlist_test.go | 28 +- ...outbound_contact_list_contact_init_test.go | 42 ++ ...oud_outbound_contact_list_contact_proxy.go | 179 ++++++++ ...esyscloud_outbound_contact_list_contact.go | 153 +++++++ ...ud_outbound_contact_list_contact_schema.go | 147 +++++++ ...loud_outbound_contact_list_contact_test.go | 176 ++++++++ ...oud_outbound_contact_list_contact_utils.go | 182 ++++++++ ...scloud_outbound_contactlistfilter_proxy.go | 2 +- ...genesyscloud_outbound_contactlistfilter.go | 2 +- ...yscloud_outbound_contactlistfilter_test.go | 2 +- ...scloud_outbound_contactlistfilter_utils.go | 2 +- .../genesyscloud_outbound_dnclist_proxy.go | 2 +- .../resource_genesyscloud_outbound_dnclist.go | 2 +- ...ce_genesyscloud_outbound_dnclist_schema.go | 6 +- ...urce_genesyscloud_outbound_dnclist_test.go | 2 +- ...utbound_filespecificationtemplate_proxy.go | 2 +- ...loud_outbound_filespecificationtemplate.go | 2 +- ...outbound_filespecificationtemplate_test.go | 2 +- ...utbound_filespecificationtemplate_utils.go | 2 +- .../genesyscloud_outbound_ruleset_proxy.go | 2 +- .../resource_genesyscloud_outbound_ruleset.go | 2 +- ...urce_genesyscloud_outbound_ruleset_test.go | 2 +- ...genesyscloud_outbound_ruleset_unit_test.go | 2 +- ...rce_genesyscloud_outbound_ruleset_utils.go | 2 +- ...enesyscloud_outbound_sequence_init_test.go | 2 +- .../genesyscloud_outbound_sequence_proxy.go | 2 +- ...resource_genesyscloud_outbound_sequence.go | 2 +- ...rce_genesyscloud_outbound_sequence_test.go | 2 +- ...ce_genesyscloud_outbound_sequence_utils.go | 2 +- .../genesyscloud_outbound_settings_proxy.go | 2 +- ...resource_genesyscloud_outbound_settings.go | 2 +- ...e_genesyscloud_outbound_settings_schema.go | 10 +- ...ce_genesyscloud_outbound_settings_utils.go | 2 +- .../genesyscloud_wrapupcode_mappings_proxy.go | 2 +- ...loud_outbound_wrapupcode_mappings_utils.go | 2 +- ...enesyscloud_outbound_wrapupcodemappings.go | 2 +- ..._genesyscloud_processautomation_trigger.go | 2 +- .../process_automation_triggers_proxy.go | 2 +- .../process_automations_triggers_struct.go | 2 +- ..._genesyscloud_processautomation_trigger.go | 2 +- ...syscloud_processautomation_trigger_test.go | 2 +- genesyscloud/provider/division.go | 2 +- genesyscloud/provider/provider.go | 2 +- genesyscloud/provider/sdk_client_pool.go | 2 +- ...ording_media_retention_policy_init_test.go | 2 +- ..._recording_media_retention_policy_proxy.go | 3 +- ...scloud_recording_media_retention_policy.go | 2 +- ...d_recording_media_retention_policy_test.go | 2 +- ..._recording_media_retention_policy_utils.go | 2 +- .../resource_cache/datasource_cache.go | 2 +- .../resource_exporter/resource_exporter.go | 10 +- .../resource_exporter_custom.go | 8 +- ...source_genesyscloud_architect_schedules.go | 2 +- .../resource_genesyscloud_auth_division.go | 2 +- ...esource_genesyscloud_auth_division_test.go | 5 +- .../resource_genesyscloud_idp_generic.go | 2 +- .../resource_genesyscloud_idp_generic_test.go | 2 +- .../resource_genesyscloud_idp_gsuite.go | 2 +- .../resource_genesyscloud_idp_gsuite_test.go | 2 +- .../resource_genesyscloud_idp_onelogin.go | 2 +- ...resource_genesyscloud_idp_onelogin_test.go | 2 +- .../resource_genesyscloud_idp_ping.go | 2 +- .../resource_genesyscloud_idp_ping_test.go | 2 +- genesyscloud/resource_genesyscloud_init.go | 8 - .../resource_genesyscloud_init_test.go | 15 +- ...esource_genesyscloud_journey_action_map.go | 2 +- ...ce_genesyscloud_journey_action_map_test.go | 2 +- ...ce_genesyscloud_journey_action_template.go | 2 +- ...nesyscloud_journey_action_template_test.go | 2 +- .../resource_genesyscloud_journey_outcome.go | 2 +- ...ource_genesyscloud_journey_outcome_test.go | 2 +- .../resource_genesyscloud_journey_segment.go | 5 +- ...ource_genesyscloud_journey_segment_test.go | 78 ++-- ...esource_genesyscloud_knowledge_category.go | 2 +- ...ce_genesyscloud_knowledge_category_test.go | 2 +- ...esource_genesyscloud_knowledge_document.go | 2 +- ...ce_genesyscloud_knowledge_document_test.go | 2 +- ...nesyscloud_knowledge_document_variation.go | 2 +- ...cloud_knowledge_document_variation_test.go | 2 +- ...ce_genesyscloud_knowledge_knowledgebase.go | 2 +- ...nesyscloud_knowledge_knowledgebase_test.go | 2 +- .../resource_genesyscloud_knowledge_label.go | 2 +- ...ource_genesyscloud_knowledge_label_test.go | 2 +- ...urce_genesyscloud_knowledge_v1_category.go | 2 +- ...genesyscloud_knowledge_v1_category_test.go | 2 +- ...urce_genesyscloud_knowledge_v1_document.go | 2 +- ...genesyscloud_knowledge_v1_document_test.go | 2 +- .../resource_genesyscloud_location.go | 2 +- .../resource_genesyscloud_location_test.go | 2 +- ...e_genesyscloud_quality_forms_evaluation.go | 2 +- ...esyscloud_quality_forms_evaluation_test.go | 2 +- ...ource_genesyscloud_quality_forms_survey.go | 2 +- ..._genesyscloud_quality_forms_survey_test.go | 2 +- ...ource_genesyscloud_routing_email_domain.go | 2 +- ..._genesyscloud_routing_email_domain_test.go | 2 +- .../resource_genesyscloud_routing_language.go | 2 +- ...urce_genesyscloud_routing_language_test.go | 2 +- .../resource_genesyscloud_routing_settings.go | 308 -------------- .../resource_genesyscloud_routing_skill.go | 2 +- ...source_genesyscloud_routing_skill_group.go | 102 ++--- ...e_genesyscloud_routing_skill_group_test.go | 81 +++- ...esource_genesyscloud_routing_skill_test.go | 2 +- ...source_genesyscloud_routing_utilization.go | 389 ------------------ ..._genesyscloud_routing_utilization_label.go | 162 -------- ...esource_genesyscloud_routing_wrapupcode.go | 2 +- ...ce_genesyscloud_routing_wrapupcode_test.go | 2 +- genesyscloud/resource_genesyscloud_user.go | 42 +- .../resource_genesyscloud_user_test.go | 96 ++--- ...resource_genesyscloud_widget_deployment.go | 337 +++++---------- ...rce_genesyscloud_widget_deployment_test.go | 230 ++++------- ...scloud_responsemanagement_library_proxy.go | 2 +- ...genesyscloud_responsemanagement_library.go | 2 +- ...yscloud_responsemanagement_library_test.go | 2 +- ...cloud_responsemanagement_response_proxy.go | 2 +- ...enesyscloud_responsemanagement_response.go | 2 +- ...scloud_responsemanagement_response_test.go | 2 +- ...cloud_responsemanagement_response_utils.go | 2 +- ..._responsemanagement_responseasset_proxy.go | 2 +- ...scloud_responsemanagement_responseasset.go | 2 +- ...d_responsemanagement_responseasset_test.go | 2 +- .../genesyscloud_routing_email_route_proxy.go | 2 +- ...source_genesyscloud_routing_email_route.go | 2 +- ...e_genesyscloud_routing_email_route_test.go | 2 +- ..._genesyscloud_routing_email_route_utils.go | 2 +- .../data_source_genesyscloud_routing_queue.go | 5 +- .../genesyscloud_routing_queue_init_test.go | 2 + .../genesyscloud_routing_queue_proxy.go | 2 +- .../resource_genesyscloud_routing_queue.go | 63 +-- ...ource_genesyscloud_routing_queue_schema.go | 6 + ...esource_genesyscloud_routing_queue_test.go | 115 +++++- ...g_queue_conditional_group_routing_proxy.go | 2 +- ...routing_queue_conditional_group_routing.go | 2 +- ...ng_queue_conditional_group_routing_test.go | 3 +- ...eue_conditional_group_routing_unit_test.go | 2 +- ...ting_queue_outbound_email_address_proxy.go | 2 +- ...ud_routing_queue_outbound_email_address.go | 2 +- ...uting_queue_outbound_email_address_test.go | 2 +- ..._queue_outbound_email_address_unit_test.go | 2 +- ...genesyscloud_routing_settings_init_test.go | 40 ++ .../genesyscloud_routing_settings_proxy.go | 110 +++++ .../resource_genesyscloud_routing_settings.go | 216 ++++++++++ ...ce_genesyscloud_routing_settings_schema.go | 101 +++++ ...urce_genesyscloud_routing_settings_test.go | 8 +- ...enesyscloud_routing_sms_addresses_proxy.go | 2 +- ...nesyscloud_routing_sms_addresses_schema.go | 4 +- ...urce_genesyscloud_routing_sms_addresses.go | 2 +- ...genesyscloud_routing_sms_addresses_test.go | 2 +- ...esyscloud_routing_utilization_init_test.go | 47 +++ .../genesyscloud_routing_utilization_proxy.go | 99 +++++ ...source_genesyscloud_routing_utilization.go | 128 ++++++ ...genesyscloud_routing_utilization_schema.go | 167 ++++++++ ...e_genesyscloud_routing_utilization_test.go | 151 +++---- .../resource_routing_utilization_utils.go | 135 ++++++ ..._genesyscloud_routing_utilization_label.go | 33 ++ ...syscloud_routing_utilization_label_test.go | 4 +- ...oud_routing_utilization_label_init_test.go | 52 +++ ...yscloud_routing_utilization_label_proxy.go | 149 +++++++ ..._genesyscloud_routing_utilization_label.go | 123 ++++++ ...scloud_routing_utilization_label_schema.go | 61 +++ ...syscloud_routing_utilization_label_test.go | 29 +- ...yscloud_routing_utilization_label_utils.go | 54 +++ .../scripts/genesyscloud_scripts_proxy.go | 2 +- .../scripts/resource_genesyscloud_script.go | 2 +- .../resource_genesyscloud_script_test.go | 2 +- .../scripts/resource_scripts_schema.go | 4 +- .../station/genesyscloud_station_init_test.go | 2 +- .../station/genesyscloud_station_proxy.go | 2 +- ...esyscloud_task_management_workbin_proxy.go | 2 +- ...ce_genesyscloud_task_management_workbin.go | 2 +- ...nesyscloud_task_management_workbin_test.go | 2 +- ...syscloud_task_management_workitem_proxy.go | 2 +- ...e_genesyscloud_task_management_workitem.go | 2 +- ...yscloud_task_management_workitem_schema.go | 6 +- ...esyscloud_task_management_workitem_test.go | 2 +- ...loud_task_management_workitem_unit_test.go | 2 +- ...syscloud_task_management_workitem_utils.go | 2 +- ...d_task_management_workitem_schema_proxy.go | 2 +- ...yscloud_task_management_workitem_schema.go | 2 +- ...ud_task_management_workitem_schema_test.go | 2 +- ...sk_management_workitem_schema_unit_test.go | 2 +- ...d_task_management_workitem_schema_utils.go | 2 +- ..._genesyscloud_task_management_unit_test.go | 2 +- ...syscloud_task_management_worktype_proxy.go | 2 +- ...e_genesyscloud_task_management_worktype.go | 2 +- ...yscloud_task_management_worktype_schema.go | 4 +- ...esyscloud_task_management_worktype_test.go | 2 +- ...loud_task_management_worktype_unit_test.go | 2 +- ...syscloud_task_management_worktype_utils.go | 4 +- genesyscloud/team/genesyscloud_team_proxy.go | 2 +- .../team/resource_genesyscloud_team.go | 2 +- .../team/resource_genesyscloud_team_test.go | 2 +- .../resource_genesyscloud_team_unit_test.go | 2 +- .../team/resource_genesyscloud_team_utils.go | 2 +- ...phony_providers_edges_trunkbasesettings.go | 8 +- ..._providers_edges_trunkbasesettings_test.go | 2 +- ...oud_telephony_providers_edges_did_proxy.go | 2 +- ...ud_telephony_providers_edges_did_schema.go | 4 +- ...elephony_providers_edges_did_pool_proxy.go | 2 +- ...loud_telephony_providers_edges_did_pool.go | 2 +- ...lephony_providers_edges_did_pool_schema.go | 10 +- ...telephony_providers_edges_did_pool_test.go | 2 +- ...elephony_providers_edges_did_pool_utils.go | 2 +- ...ephony_providers_edges_edge_group_proxy.go | 2 +- ...ud_telephony_providers_edges_edge_group.go | 2 +- ...lephony_providers_edges_edge_group_test.go | 2 +- ...ephony_providers_edges_edge_group_utils.go | 2 +- ...ny_providers_edges_extension_pool_proxy.go | 2 +- ...y_providers_edges_extension_pool_schema.go | 16 +- ...elephony_providers_edges_extension_pool.go | 2 +- ...ony_providers_edges_extension_pool_test.go | 2 +- ...ephony_providers_edges_linebasesettings.go | 2 +- ...lephony_providers_edges_phone_init_test.go | 2 +- ...d_telephony_providers_edges_phone_proxy.go | 13 +- ...yscloud_telephony_providers_edges_phone.go | 12 +- ..._telephony_providers_edges_phone_schema.go | 4 +- ...ud_telephony_providers_edges_phone_test.go | 79 ++-- ...d_telephony_providers_edges_phone_utils.go | 5 +- ...phony_providers_edges_phonebasesettings.go | 2 +- ...providers_edges_phonebasesettings_proxy.go | 2 +- ...phony_providers_edges_phonebasesettings.go | 2 +- ..._providers_edges_phonebasesettings_test.go | 2 +- ...providers_edges_phonebasesettings_utils.go | 2 +- ...oud_telephony_providers_edges_site_test.go | 2 +- ...ud_telephony_providers_edges_site_proxy.go | 2 +- ...syscloud_telephony_providers_edges_site.go | 25 +- ...d_telephony_providers_edges_site_schema.go | 8 +- ...oud_telephony_providers_edges_site_test.go | 2 +- ...ud_telephony_providers_edges_site_utils.go | 2 +- ...ers_edges_site_outbound_route_init_test.go | 2 +- ...oviders_edges_site_outbound_route_proxy.go | 2 +- ...ony_providers_edges_site_outbound_route.go | 2 +- ...viders_edges_site_outbound_route_schema.go | 6 +- ...oviders_edges_site_outbound_route_utils.go | 2 +- ...yscloud_telephony_providers_edges_trunk.go | 2 +- ...d_telephony_providers_edges_trunk_proxy.go | 2 +- ...yscloud_telephony_providers_edges_trunk.go | 2 +- genesyscloud/tfexporter/export_common.go | 21 +- .../genesyscloud_resource_exporter.go | 69 +++- .../genesyscloud_resource_exporter_test.go | 2 +- .../resource_genesyscloud_tf_export.go | 23 +- .../resource_genesyscloud_tf_export_test.go | 274 +++++++++++- .../tfexporter/tf_exporter_resource_test.go | 18 +- .../genesyscloud_user_roles_proxy.go | 2 +- .../resource_genesyscloud_user_roles_utils.go | 2 +- .../util/feature_toggles/outbound_routes.go | 6 +- genesyscloud/util/lists/util_lists.go | 12 + .../util/resourcedata/resourcedata.go | 18 +- genesyscloud/util/test_utils.go | 3 +- .../util/util_basesetting_properties.go | 2 +- .../util/util_diagnostic_unit_test.go | 2 +- genesyscloud/util/util_diagnostics.go | 2 +- genesyscloud/util/util_divisions.go | 2 +- genesyscloud/util/util_domainentities.go | 2 +- genesyscloud/util/util_retries.go | 2 +- genesyscloud/validators/validators.go | 20 +- ...loud_webdeployments_configuration_proxy.go | 2 +- ...nesyscloud_webdeployments_configuration.go | 2 +- ...oud_webdeployments_configuration_schema.go | 16 +- ...cloud_webdeployments_configuration_test.go | 2 +- ...ud_webdeployments_configuration_journey.go | 2 +- ..._webdeployments_configuration_messenger.go | 2 +- ...eployments_configuration_support_center.go | 2 +- ...loud_webdeployments_configuration_utils.go | 4 +- ...yscloud_webdeployments_deployment_proxy.go | 2 +- ..._genesyscloud_webdeployments_deployment.go | 2 +- ...syscloud_webdeployments_deployment_test.go | 2 +- ...yscloud_webdeployments_deployment_utils.go | 2 +- go.mod | 4 +- go.sum | 10 +- jenkins/tests/Jenkinsfile | 37 +- main.go | 8 + .../05_update_remove_ignore_frequency_cap.tf | 2 +- .../01_basic_resource.tf} | 0 .../02_update_attributes.tf | 0 .../01_create_customer_scope.tf | 19 - ...2_recreate_external_segment_update_name.tf | 19 - ..._recreate_external_segment_id_force_new.tf | 20 - .../04_update_color_change.tf | 20 - .../03_recreate_scope_change_force_new.tf | 20 - ...pdate_remove_assignment_expirition_days.tf | 20 - 467 files changed, 4377 insertions(+), 2573 deletions(-) delete mode 100644 docs/data-sources/routing_settings.md create mode 100644 docs/resources/outbound_contact_list_contact.md create mode 100644 examples/resources/genesyscloud_outbound_contact_list_contact/apis.md create mode 100644 examples/resources/genesyscloud_outbound_contact_list_contact/resource.tf delete mode 100644 genesyscloud/data_source_genesyscloud_routing_settings.go delete mode 100644 genesyscloud/data_source_genesyscloud_routing_settings_test.go delete mode 100644 genesyscloud/data_source_genesyscloud_routing_utilization_label.go create mode 100644 genesyscloud/outbound_contact_list_contact/genesyscloud_outbound_contact_list_contact_init_test.go create mode 100644 genesyscloud/outbound_contact_list_contact/genesyscloud_outbound_contact_list_contact_proxy.go create mode 100644 genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact.go create mode 100644 genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_schema.go create mode 100644 genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_test.go create mode 100644 genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_utils.go delete mode 100644 genesyscloud/resource_genesyscloud_routing_settings.go delete mode 100644 genesyscloud/resource_genesyscloud_routing_utilization.go delete mode 100644 genesyscloud/resource_genesyscloud_routing_utilization_label.go create mode 100644 genesyscloud/routing_settings/genesyscloud_routing_settings_init_test.go create mode 100644 genesyscloud/routing_settings/genesyscloud_routing_settings_proxy.go create mode 100644 genesyscloud/routing_settings/resource_genesyscloud_routing_settings.go create mode 100644 genesyscloud/routing_settings/resource_genesyscloud_routing_settings_schema.go rename genesyscloud/{ => routing_settings}/resource_genesyscloud_routing_settings_test.go (98%) create mode 100644 genesyscloud/routing_utilization/genesyscloud_routing_utilization_init_test.go create mode 100644 genesyscloud/routing_utilization/genesyscloud_routing_utilization_proxy.go create mode 100644 genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization.go create mode 100644 genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_schema.go rename genesyscloud/{ => routing_utilization}/resource_genesyscloud_routing_utilization_test.go (77%) create mode 100644 genesyscloud/routing_utilization/resource_routing_utilization_utils.go create mode 100644 genesyscloud/routing_utilization_label/data_source_genesyscloud_routing_utilization_label.go rename genesyscloud/{ => routing_utilization_label}/data_source_genesyscloud_routing_utilization_label_test.go (95%) create mode 100644 genesyscloud/routing_utilization_label/genesyscloud_routing_utilization_label_init_test.go create mode 100644 genesyscloud/routing_utilization_label/genesyscloud_routing_utilization_label_proxy.go create mode 100644 genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label.go create mode 100644 genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_schema.go rename genesyscloud/{ => routing_utilization_label}/resource_genesyscloud_routing_utilization_label_test.go (69%) create mode 100644 genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_utils.go rename test/data/resource/genesyscloud_journey_segment/{basic_session_attributes/01_create_session_scope.tf => basic_attributes/01_basic_resource.tf} (100%) rename test/data/resource/genesyscloud_journey_segment/{basic_session_attributes => basic_attributes}/02_update_attributes.tf (100%) delete mode 100644 test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/01_create_customer_scope.tf delete mode 100644 test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/02_recreate_external_segment_update_name.tf delete mode 100644 test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/03_recreate_external_segment_id_force_new.tf delete mode 100644 test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/04_update_color_change.tf delete mode 100644 test/data/resource/genesyscloud_journey_segment/basic_session_attributes/03_recreate_scope_change_force_new.tf delete mode 100644 test/data/resource/genesyscloud_journey_segment/optional_attributes/04_update_remove_assignment_expirition_days.tf diff --git a/docs/data-sources/routing_settings.md b/docs/data-sources/routing_settings.md deleted file mode 100644 index 18d93fc8f..000000000 --- a/docs/data-sources/routing_settings.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -# generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "genesyscloud_routing_settings Data Source - terraform-provider-genesyscloud" -subcategory: "" -description: |- - An organization's routing settings ---- - -# genesyscloud_routing_settings (Data Source) - -An organization's routing settings - - - - -## Schema - -### Optional - -- `contactcenter` (Block List, Max: 1) Contact center settings (see [below for nested schema](#nestedblock--contactcenter)) -- `reset_agent_on_presence_change` (Boolean) Reset agent score when agent presence changes from off-queue to on-queue -- `transcription` (Block List, Max: 1) Transcription settings (see [below for nested schema](#nestedblock--transcription)) - -### Read-Only - -- `id` (String) The ID of this resource. - - -### Nested Schema for `contactcenter` - -Optional: - -- `remove_skills_from_blind_transfer` (Boolean) Strip skills from transfer - - - -### Nested Schema for `transcription` - -Optional: - -- `content_search_enabled` (Boolean) Setting to enable/disable content search -- `low_latency_transcription_enabled` (Boolean) Boolean flag indicating whether low latency transcription via Notification API is enabled -- `transcription` (String) Setting to enable/disable transcription capability.Valid values: Disabled, EnabledGlobally, EnabledQueueFlow -- `transcription_confidence_threshold` (Number) Configure confidence threshold. The possible values are from 1 to 100 diff --git a/docs/resources/journey_segment.md b/docs/resources/journey_segment.md index 66173abf6..785e47715 100644 --- a/docs/resources/journey_segment.md +++ b/docs/resources/journey_segment.md @@ -60,7 +60,7 @@ resource "genesyscloud_journey_segment" "example_journey_segment_resource" { - `color` (String) The hexadecimal color value of the segment. - `display_name` (String) The display name of the segment. -- `scope` (String) The target entity that a segment applies to.Valid values: Session, Customer. Changing the scope attribute will cause the existing journey_segment to be dropped and recreated with new ID. +- `scope` (String) The target entity that a segment applies to. Valid values: Session ### Optional diff --git a/docs/resources/outbound_contact_list_contact.md b/docs/resources/outbound_contact_list_contact.md new file mode 100644 index 000000000..98c79269f --- /dev/null +++ b/docs/resources/outbound_contact_list_contact.md @@ -0,0 +1,115 @@ +--- +page_title: "genesyscloud_outbound_contact_list_contact Resource - terraform-provider-genesyscloud" +subcategory: "" +description: |- + Genesys Cloud Outbound Contact List Contact +--- +# genesyscloud_outbound_contact_list_contact (Resource) + +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: + +- [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-) + +## Example Usage + +```terraform +resource "genesyscloud_outbound_contact_list_contact" "contact" { + contact_list_id = genesyscloud_outbound_contact_list.contact_list.id + callable = true + data = { + Cell = "+1111111" + Home = "+2222222" + Email = "example@email.com" + } + phone_number_status { + key = "Cell" + callable = true + } + phone_number_status { + key = "Home" + callable = false + } + contactable_status { + media_type = "Voice" + contactable = true + column_status { + column = "Cell" + contactable = true + } + column_status { + column = "Home" + contactable = false + } + } + contactable_status { + media_type = "Email" + contactable = true + column_status { + column = "Email" + contactable = true + } + } +} +``` + + +## Schema + +### Required + +- `contact_list_id` (String) The identifier of the contact list containing this contact. +- `data` (Map of String) An ordered map of the contact's columns and corresponding values. + +### Optional + +- `callable` (Boolean) Indicates whether or not the contact can be called. Defaults to `false`. +- `clear_system_data` (Boolean) Clear system data. True means the system columns (attempts, callable status, etc) stored on the contact will be cleared if the contact already exists; false means they won't. +Only applicable on the creation of a contact, so updating this field will force the contact to be deleted from the contact list and re-uploaded. +- `contactable_status` (Block Set) A map of media types (Voice, SMS and Email) to ContactableStatus, which indicates if the contact can be contacted using the specified media type. (see [below for nested schema](#nestedblock--contactable_status)) +- `do_not_queue` (Boolean) Do not queue. True means that updated contacts will not have their positions in the queue altered, so contacts that have already been dialed will not be redialed. +For new contacts, this parameter has no effect; False means that updated contacts will be re-queued, according to the 'priority' parameter. +Only applicable on the creation of a contact, so updating this field will force the contact to be deleted from the contact list and re-uploaded. +- `phone_number_status` (Block Set) A map of phone number columns to PhoneNumberStatuses, which indicate if the phone number is callable or not. (see [below for nested schema](#nestedblock--phone_number_status)) +- `priority` (Boolean) Contact priority. True means the contact(s) will be dialed next; false means the contact will go to the end of the contact queue. +Only applicable on the creation of a contact, so updating this field will force the contact to be deleted from the contact list and re-uploaded. + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `contactable_status` + +Required: + +- `contactable` (Boolean) Indicates whether or not the entire contact is contactable for the associated media type. +- `media_type` (String) The key which identifies the media type (Voice, SMS and Email). + +Optional: + +- `column_status` (Block Set) A map of individual contact method columns to whether the individual column is contactable for the associated media type. (see [below for nested schema](#nestedblock--contactable_status--column_status)) + + +### Nested Schema for `contactable_status.column_status` + +Required: + +- `column` (String) The key which identifies the contact method column. +- `contactable` (Boolean) Indicates whether or not an individual contact method column is contactable. + + + + +### Nested Schema for `phone_number_status` + +Required: + +- `callable` (Boolean) Indicates whether or not a phone number is callable. +- `key` (String) Phone number column identifier. + diff --git a/docs/resources/routing_queue.md b/docs/resources/routing_queue.md index 3921981d7..a3f89f294 100644 --- a/docs/resources/routing_queue.md +++ b/docs/resources/routing_queue.md @@ -105,6 +105,7 @@ resource "genesyscloud_routing_queue" "example_queue" { - `media_settings_message` (Block List, Max: 1) Message media settings. (see [below for nested schema](#nestedblock--media_settings_message)) - `members` (Set of Object) Users in the queue. If not set, this resource will not manage members. If a user is already assigned to this queue via a group, attempting to assign them using this field will cause an error to be thrown. (see [below for nested schema](#nestedatt--members)) - `message_in_queue_flow_id` (String) The in-queue flow ID to use for message conversations waiting in queue. +- `on_hold_prompt_id` (String) The audio to be played when calls on this queue are on hold. If not configured, the default on-hold music will play. - `outbound_email_address` (Block List, Max: 1, Deprecated) The outbound email address settings for this queue. (see [below for nested schema](#nestedblock--outbound_email_address)) - `outbound_messaging_sms_address_id` (String) The unique ID of the outbound messaging SMS address for the queue. - `queue_flow_id` (String) The in-queue flow ID to use for call conversations waiting in queue. diff --git a/docs/resources/routing_settings.md b/docs/resources/routing_settings.md index 548add012..ff9c5d9e8 100644 --- a/docs/resources/routing_settings.md +++ b/docs/resources/routing_settings.md @@ -65,6 +65,8 @@ Optional: - `content_search_enabled` (Boolean) Setting to enable/disable content search - `low_latency_transcription_enabled` (Boolean) Boolean flag indicating whether low latency transcription via Notification API is enabled +- `pci_dss_redaction_enabled` (Boolean) Setting to enable/disable PCI DSS Redaction +- `pii_redaction_enabled` (Boolean) Setting to enable/disable PII Redaction - `transcription` (String) Setting to enable/disable transcription capability.Valid values: Disabled, EnabledGlobally, EnabledQueueFlow - `transcription_confidence_threshold` (Number) Configure confidence threshold. The possible values are from 1 to 100 diff --git a/docs/resources/tf_export.md b/docs/resources/tf_export.md index 4fbff2237..b68964897 100644 --- a/docs/resources/tf_export.md +++ b/docs/resources/tf_export.md @@ -60,6 +60,7 @@ resource "genesyscloud_tf_export" "export" { ### Optional +- `compress` (Boolean) Compress exported results using zip format Defaults to `false`. - `directory` (String) Directory where the config and state files will be exported. Defaults to `./genesyscloud`. - `enable_dependency_resolution` (Boolean) Adds a "depends_on" attribute to genesyscloud_flow resources with a list of resources that are referenced inside the flow configuration . This also resolves and exports all the dependent resources for any given resource. Defaults to `false`. - `exclude_attributes` (List of String) Attributes to exclude from the config when exporting resources. Each value should be of the form {resource_name}.{attribute}, e.g. 'genesyscloud_user.skills'. Excluded attributes must be optional. diff --git a/docs/resources/widget_deployment.md b/docs/resources/widget_deployment.md index c91b869b1..8153c0069 100644 --- a/docs/resources/widget_deployment.md +++ b/docs/resources/widget_deployment.md @@ -27,9 +27,8 @@ resource "genesyscloud_widget_deployment" "mywidget" { client_type = "v1" authentication_required = true disabled = true - client_config { - authentication_url = "https://examplewebsite.com" - webchat_skin = "modern-caret-skin" + third_party_client_config = { + foo = "bar" } allowed_domains = [] } @@ -41,16 +40,18 @@ resource "genesyscloud_widget_deployment" "mywidget" { ### Required - `authentication_required` (Boolean) When true, the customer members starting a chat must be authenticated by supplying their JWT to the create operation. -- `client_type` (String) The type of display widget for which this Deployment is configured, which controls the administrator settings shown.Valid values: v1, v2, v1-http, third-party. +- `client_type` (String) The type of display widget for which this Deployment is configured, which controls the administrator settings shown. Valid values: v1, v1-http, v2, third-party - `disabled` (Boolean) When true, all create chat operations using this Deployment will be rejected. - `name` (String) Name of the Widget Deployment. ### Optional - `allowed_domains` (List of String) The list of domains that are approved to use this Deployment; the list will be added to CORS headers for ease of web use -- `client_config` (Block Set, Max: 1) The V1 and V1-http client configuration options that should be made available to the clients of this Deployment. (see [below for nested schema](#nestedblock--client_config)) +- `client_config` (Block Set, Max: 1, Deprecated) The V1 and V1-http client configuration options that should be made available to the clients of this Deployment. (see [below for nested schema](#nestedblock--client_config)) - `description` (String) Widget Deployment description. - `flow_id` (String) The Inbound Chat Flow to run when new chats are initiated under this Deployment +- `third_party_client_config` (Map of String) The third party client configuration options that should be made available to the clients of this Deployment. +- `v2_client_config` (Map of String) The v2 client configuration options that should be made available to the clients of this Deployment. ### Read-Only @@ -59,11 +60,8 @@ resource "genesyscloud_widget_deployment" "mywidget" { ### Nested Schema for `client_config` -Required: - -- `webchat_skin` (String) Skin for the webchat user. (basic, modern-caret-skin) - Optional: - `authentication_url` (String) Url endpoint to perform_authentication +- `webchat_skin` (String) Skin for the webchat user. (basic, modern-caret-skin) diff --git a/examples/resources/genesyscloud_outbound_contact_list_contact/apis.md b/examples/resources/genesyscloud_outbound_contact_list_contact/apis.md new file mode 100644 index 000000000..239567e26 --- /dev/null +++ b/examples/resources/genesyscloud_outbound_contact_list_contact/apis.md @@ -0,0 +1,4 @@ +- [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-) \ No newline at end of file diff --git a/examples/resources/genesyscloud_outbound_contact_list_contact/resource.tf b/examples/resources/genesyscloud_outbound_contact_list_contact/resource.tf new file mode 100644 index 000000000..07bd64312 --- /dev/null +++ b/examples/resources/genesyscloud_outbound_contact_list_contact/resource.tf @@ -0,0 +1,37 @@ +resource "genesyscloud_outbound_contact_list_contact" "contact" { + contact_list_id = genesyscloud_outbound_contact_list.contact_list.id + callable = true + data = { + Cell = "+1111111" + Home = "+2222222" + Email = "example@email.com" + } + phone_number_status { + key = "Cell" + callable = true + } + phone_number_status { + key = "Home" + callable = false + } + contactable_status { + media_type = "Voice" + contactable = true + column_status { + column = "Cell" + contactable = true + } + column_status { + column = "Home" + contactable = false + } + } + contactable_status { + media_type = "Email" + contactable = true + column_status { + column = "Email" + contactable = true + } + } +} \ No newline at end of file diff --git a/examples/resources/genesyscloud_widget_deployment/resource.tf b/examples/resources/genesyscloud_widget_deployment/resource.tf index 1070a0fde..fd79e2b04 100644 --- a/examples/resources/genesyscloud_widget_deployment/resource.tf +++ b/examples/resources/genesyscloud_widget_deployment/resource.tf @@ -5,9 +5,8 @@ resource "genesyscloud_widget_deployment" "mywidget" { client_type = "v1" authentication_required = true disabled = true - client_config { - authentication_url = "https://examplewebsite.com" - webchat_skin = "modern-caret-skin" + third_party_client_config = { + foo = "bar" } allowed_domains = [] } \ No newline at end of file diff --git a/genesyscloud/architect_datatable/data_source_genesyscloud_architect_datatable.go b/genesyscloud/architect_datatable/data_source_genesyscloud_architect_datatable.go index 417f3779c..fe8f6f8e6 100644 --- a/genesyscloud/architect_datatable/data_source_genesyscloud_architect_datatable.go +++ b/genesyscloud/architect_datatable/data_source_genesyscloud_architect_datatable.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func DataSourceArchitectDatatableRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { diff --git a/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable.go b/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable.go index 166cd32e5..0aa344ef2 100644 --- a/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable.go +++ b/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type Datatableproperty struct { diff --git a/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_proxy.go b/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_proxy.go index 8b65f6468..9223c15f3 100644 --- a/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_proxy.go +++ b/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_proxy.go @@ -6,7 +6,7 @@ import ( "errors" "net/http" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // internalProxy holds a proxy instance that can be used throughout the package diff --git a/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_test.go b/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_test.go index 89f10ec74..bd6b97a9e 100644 --- a/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_test.go +++ b/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceArchitectDatatable(t *testing.T) { diff --git a/genesyscloud/architect_datatable_row/genesyscloud_architect_datatable_row_utils.go b/genesyscloud/architect_datatable_row/genesyscloud_architect_datatable_row_utils.go index 669cc7e6e..a346d63de 100644 --- a/genesyscloud/architect_datatable_row/genesyscloud_architect_datatable_row_utils.go +++ b/genesyscloud/architect_datatable_row/genesyscloud_architect_datatable_row_utils.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // Row IDs structured as {table-id}/{key-value} diff --git a/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row.go b/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row.go index abf3efdf7..74a126ee4 100644 --- a/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row.go +++ b/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type Datatableproperty struct { diff --git a/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_proxy.go b/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_proxy.go index 300169eb9..1f94400bc 100644 --- a/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_proxy.go +++ b/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_proxy.go @@ -5,7 +5,7 @@ import ( "encoding/json" "errors" "github.com/mitchellh/mapstructure" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "net/http" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" diff --git a/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_test.go b/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_test.go index 9acccd551..070e1bc05 100644 --- a/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_test.go +++ b/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_test.go @@ -11,7 +11,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceArchitectDatatableRow(t *testing.T) { diff --git a/genesyscloud/architect_emergencygroup/genesyscloud_architect_emergencygroup_proxy.go b/genesyscloud/architect_emergencygroup/genesyscloud_architect_emergencygroup_proxy.go index ac8b2a6d1..01d41745a 100644 --- a/genesyscloud/architect_emergencygroup/genesyscloud_architect_emergencygroup_proxy.go +++ b/genesyscloud/architect_emergencygroup/genesyscloud_architect_emergencygroup_proxy.go @@ -3,7 +3,7 @@ package architect_emergencygroup import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var internalProxy *architectEmergencyGroupProxy diff --git a/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup.go b/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup.go index 4e2f8622d..9523a2472 100644 --- a/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup.go +++ b/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllEmergencyGroups(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_test.go b/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_test.go index fdc824edb..0cf52ad50 100644 --- a/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_test.go +++ b/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceArchitectEmergencyGroups(t *testing.T) { diff --git a/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_utils.go b/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_utils.go index e2ba82d75..11ecb8e35 100644 --- a/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_utils.go +++ b/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_utils.go @@ -2,7 +2,7 @@ package architect_emergencygroup import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func buildSdkEmergencyGroupCallFlows(d *schema.ResourceData) *[]platformclientv2.Emergencycallflow { diff --git a/genesyscloud/architect_flow/resource_genesyscloud_architect_flow_proxy.go b/genesyscloud/architect_flow/resource_genesyscloud_architect_flow_proxy.go index 219ff6ece..f0642e4e5 100644 --- a/genesyscloud/architect_flow/resource_genesyscloud_architect_flow_proxy.go +++ b/genesyscloud/architect_flow/resource_genesyscloud_architect_flow_proxy.go @@ -3,7 +3,7 @@ package architect_flow import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" ) diff --git a/genesyscloud/architect_flow/resource_genesyscloud_flow.go b/genesyscloud/architect_flow/resource_genesyscloud_flow.go index b5693448c..6c70707fd 100644 --- a/genesyscloud/architect_flow/resource_genesyscloud_flow.go +++ b/genesyscloud/architect_flow/resource_genesyscloud_flow.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllFlows(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/architect_flow/resource_genesyscloud_flow_test.go b/genesyscloud/architect_flow/resource_genesyscloud_flow_test.go index 4066bc273..bb721ed40 100644 --- a/genesyscloud/architect_flow/resource_genesyscloud_flow_test.go +++ b/genesyscloud/architect_flow/resource_genesyscloud_flow_test.go @@ -17,7 +17,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // lockFlow will search for a specific flow and then lock it. This is to specifically test the force_unlock flag where I want to create a flow, simulate some one locking it and then attempt to diff --git a/genesyscloud/architect_grammar/genesyscloud_architect_grammar_proxy.go b/genesyscloud/architect_grammar/genesyscloud_architect_grammar_proxy.go index 45a5a593f..36c73863d 100644 --- a/genesyscloud/architect_grammar/genesyscloud_architect_grammar_proxy.go +++ b/genesyscloud/architect_grammar/genesyscloud_architect_grammar_proxy.go @@ -6,7 +6,7 @@ import ( "log" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar.go b/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar.go index 0017ec632..6fe8bff54 100644 --- a/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar.go +++ b/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar_test.go b/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar_test.go index 05f319590..6d81a2d27 100644 --- a/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar_test.go +++ b/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceArchitectGrammar(t *testing.T) { diff --git a/genesyscloud/architect_grammar_language/genesyscloud_architect_grammar_language_proxy.go b/genesyscloud/architect_grammar_language/genesyscloud_architect_grammar_language_proxy.go index 6f081a407..6647b9801 100644 --- a/genesyscloud/architect_grammar_language/genesyscloud_architect_grammar_language_proxy.go +++ b/genesyscloud/architect_grammar_language/genesyscloud_architect_grammar_language_proxy.go @@ -8,7 +8,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/files" "time" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type FileType int diff --git a/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language.go b/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language.go index 4a376d7b8..b8423f1a4 100644 --- a/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language.go +++ b/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_test.go b/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_test.go index e36831ea4..7bc029fd3 100644 --- a/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_test.go +++ b/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_test.go @@ -15,7 +15,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceArchitectGrammarLanguage(t *testing.T) { diff --git a/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_utils.go b/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_utils.go index 58504f1f2..97f30023c 100644 --- a/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_utils.go +++ b/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_utils.go @@ -13,7 +13,7 @@ import ( "time" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/architect_ivr/data_source_genesyscloud_architect_ivr_test.go b/genesyscloud/architect_ivr/data_source_genesyscloud_architect_ivr_test.go index e04f747f2..97345394d 100644 --- a/genesyscloud/architect_ivr/data_source_genesyscloud_architect_ivr_test.go +++ b/genesyscloud/architect_ivr/data_source_genesyscloud_architect_ivr_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/stretchr/testify/assert" "github.com/google/uuid" diff --git a/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy.go b/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy.go index d9cec0a4f..fdd8c9c55 100644 --- a/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy.go +++ b/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy.go @@ -7,7 +7,7 @@ import ( utillists "terraform-provider-genesyscloud/genesyscloud/util/lists" "time" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy_unit_test.go b/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy_unit_test.go index 723cd5c40..9c00434e0 100644 --- a/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy_unit_test.go +++ b/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy_unit_test.go @@ -11,7 +11,7 @@ import ( "testing" "github.com/google/uuid" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestUnitUploadIvrDnisChunksSuccess(t *testing.T) { diff --git a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr.go b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr.go index 35be99a30..ab6fb8e76 100644 --- a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr.go +++ b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // getAllIvrConfigs retrieves all architect IVRs and is used for the exporter diff --git a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_schema.go b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_schema.go index cb0c48118..363b5f8fb 100644 --- a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_schema.go +++ b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_schema.go @@ -6,7 +6,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" ) const ( @@ -65,7 +65,7 @@ func ResourceArchitectIvrConfig() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateDiagFunc: gcloud.ValidatePhoneNumber}, + Elem: &schema.Schema{Type: schema.TypeString, ValidateDiagFunc: validators.ValidatePhoneNumber}, }, "open_hours_flow_id": { Description: "ID of inbound call flow for open hours.", diff --git a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_test.go b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_test.go index fcf3df126..166d0320e 100644 --- a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_test.go +++ b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceIvrConfigBasic(t *testing.T) { diff --git a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_unit_test.go b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_unit_test.go index 4f7751e75..b5c97be4b 100644 --- a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_unit_test.go +++ b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_unit_test.go @@ -11,7 +11,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/stretchr/testify/assert" ) diff --git a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_utils.go b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_utils.go index be422dd34..cfe4f8446 100644 --- a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_utils.go +++ b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_utils.go @@ -8,7 +8,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type IvrConfigStruct struct { diff --git a/genesyscloud/architect_schedulegroups/genesyscloud_architect_schedulegroups_proxy.go b/genesyscloud/architect_schedulegroups/genesyscloud_architect_schedulegroups_proxy.go index 53f3b06ef..44bf1b3ee 100644 --- a/genesyscloud/architect_schedulegroups/genesyscloud_architect_schedulegroups_proxy.go +++ b/genesyscloud/architect_schedulegroups/genesyscloud_architect_schedulegroups_proxy.go @@ -3,7 +3,7 @@ package architect_schedulegroups import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" ) diff --git a/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups.go b/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups.go index 5a0b08774..3b8bd4e45 100644 --- a/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups.go +++ b/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups_test.go b/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups_test.go index fc0b0a846..b654c0254 100644 --- a/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups_test.go +++ b/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceArchitectScheduleGroups(t *testing.T) { diff --git a/genesyscloud/architect_schedules/genesyscloud_architect_schedules_proxy.go b/genesyscloud/architect_schedules/genesyscloud_architect_schedules_proxy.go index adb92461a..9fb733127 100644 --- a/genesyscloud/architect_schedules/genesyscloud_architect_schedules_proxy.go +++ b/genesyscloud/architect_schedules/genesyscloud_architect_schedules_proxy.go @@ -6,7 +6,7 @@ import ( "log" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules.go b/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules.go index b040cd8a9..7d0c6ba1e 100644 --- a/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules.go +++ b/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules.go @@ -19,7 +19,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) const timeFormat = "2006-01-02T15:04:05.000000" diff --git a/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules_test.go b/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules_test.go index 29d51b99b..f780c8d5e 100644 --- a/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules_test.go +++ b/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceArchitectSchedules(t *testing.T) { diff --git a/genesyscloud/architect_user_prompt/genesyscloud_architect_user_prompt_proxy.go b/genesyscloud/architect_user_prompt/genesyscloud_architect_user_prompt_proxy.go index 64ca3981b..25ac10cb1 100644 --- a/genesyscloud/architect_user_prompt/genesyscloud_architect_user_prompt_proxy.go +++ b/genesyscloud/architect_user_prompt/genesyscloud_architect_user_prompt_proxy.go @@ -4,7 +4,7 @@ import ( "context" "log" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // internalProxy holds a proxy instance that can be used throughout the package diff --git a/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt.go b/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt.go index f28ae4274..6c7a11825 100644 --- a/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt.go +++ b/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllUserPrompts(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_test.go b/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_test.go index 2e13a8771..9ed5d9cce 100644 --- a/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_test.go +++ b/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_test.go @@ -16,7 +16,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceUserPromptBasic(t *testing.T) { diff --git a/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_utils.go b/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_utils.go index 8e9b6436f..615a715c3 100644 --- a/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_utils.go +++ b/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_utils.go @@ -16,7 +16,7 @@ import ( files "terraform-provider-genesyscloud/genesyscloud/util/files" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type PromptAudioData struct { diff --git a/genesyscloud/auth_role/data_source_genesyscloud_auth_role.go b/genesyscloud/auth_role/data_source_genesyscloud_auth_role.go index d83b1380b..a5539383f 100644 --- a/genesyscloud/auth_role/data_source_genesyscloud_auth_role.go +++ b/genesyscloud/auth_role/data_source_genesyscloud_auth_role.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "time" diff --git a/genesyscloud/auth_role/genesyscloud_auth_role_proxy.go b/genesyscloud/auth_role/genesyscloud_auth_role_proxy.go index cce2393b4..07200518c 100644 --- a/genesyscloud/auth_role/genesyscloud_auth_role_proxy.go +++ b/genesyscloud/auth_role/genesyscloud_auth_role_proxy.go @@ -3,7 +3,10 @@ package auth_role import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + + rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" + + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* @@ -39,14 +42,17 @@ type authRoleProxy struct { deleteAuthRoleAttr deleteAuthRoleFunc restoreDefaultRolesAttr restoreDefaultRolesFunc getAllowedPermissionsAttr getAllowedPermissionsFunc + authRoleCache rc.CacheInterface[platformclientv2.Domainorganizationrole] } // newAuthRoleProxy initializes the auth role proxy with all of the data needed to communicate with Genesys Cloud func newAuthRoleProxy(clientConfig *platformclientv2.Configuration) *authRoleProxy { api := platformclientv2.NewAuthorizationApiWithConfig(clientConfig) + authRoleCache := rc.NewResourceCache[platformclientv2.Domainorganizationrole]() // Create Cache for authRole resource return &authRoleProxy{ clientConfig: clientConfig, authorizationApi: api, + authRoleCache: authRoleCache, createAuthRoleAttr: createAuthRoleFn, getAllAuthRoleAttr: getAllAuthRoleFn, getAuthRoleIdByNameAttr: getAuthRoleIdByNameFn, @@ -85,11 +91,17 @@ func (p *authRoleProxy) getAuthRoleIdByName(ctx context.Context, name string) (i // getAuthRoleById returns a single Genesys Cloud auth role by Id func (p *authRoleProxy) getAuthRoleById(ctx context.Context, id string) (authRole *platformclientv2.Domainorganizationrole, response *platformclientv2.APIResponse, err error) { + if authRole := rc.GetCacheItem(p.authRoleCache, id); authRole != nil { + return authRole, nil, nil + } return p.getAuthRoleByIdAttr(ctx, p, id) } // getAuthRoleById returns a single Genesys Cloud auth role by Id func (p *authRoleProxy) getDefaultRoleById(ctx context.Context, defaultRoleId string) (roleId string, response *platformclientv2.APIResponse, err error) { + if authRole := rc.GetCacheItem(p.authRoleCache, defaultRoleId); authRole != nil { + return *authRole.Id, nil, nil + } return p.getDefaultRoleIdAttr(ctx, p, defaultRoleId) } @@ -148,6 +160,11 @@ func getAllAuthRoleFn(ctx context.Context, p *authRoleProxy) (*[]platformclientv allAuthRoles = append(allAuthRoles, *roles.Entities...) } + //Cache the Auth Role resource into the p.authRoleCache for later use + for _, authRole := range allAuthRoles { + rc.SetCache(p.authRoleCache, *authRole.Id, authRole) + } + return &allAuthRoles, resp, nil } diff --git a/genesyscloud/auth_role/resource_genesyscloud_auth_role.go b/genesyscloud/auth_role/resource_genesyscloud_auth_role.go index 09eb4eaee..37b70ee8a 100644 --- a/genesyscloud/auth_role/resource_genesyscloud_auth_role.go +++ b/genesyscloud/auth_role/resource_genesyscloud_auth_role.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/auth_role/resource_genesyscloud_auth_role_test.go b/genesyscloud/auth_role/resource_genesyscloud_auth_role_test.go index f31c54c02..80782c374 100644 --- a/genesyscloud/auth_role/resource_genesyscloud_auth_role_test.go +++ b/genesyscloud/auth_role/resource_genesyscloud_auth_role_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceAuthRoleDefault(t *testing.T) { diff --git a/genesyscloud/auth_role/resource_genesyscloud_auth_role_utils.go b/genesyscloud/auth_role/resource_genesyscloud_auth_role_utils.go index 64a735483..7efb5f4e1 100644 --- a/genesyscloud/auth_role/resource_genesyscloud_auth_role_utils.go +++ b/genesyscloud/auth_role/resource_genesyscloud_auth_role_utils.go @@ -6,7 +6,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func validatePermissionPolicy(proxy *authRoleProxy, policy platformclientv2.Domainpermissionpolicy) (*platformclientv2.APIResponse, error) { diff --git a/genesyscloud/authorization_product/data_source_genesyscloud_authorization_product_test.go b/genesyscloud/authorization_product/data_source_genesyscloud_authorization_product_test.go index dfe58bcfa..f26f62ca5 100644 --- a/genesyscloud/authorization_product/data_source_genesyscloud_authorization_product_test.go +++ b/genesyscloud/authorization_product/data_source_genesyscloud_authorization_product_test.go @@ -7,7 +7,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/stretchr/testify/assert" "golang.org/x/net/context" diff --git a/genesyscloud/authorization_product/genesyscloud_authorization_product_proxy.go b/genesyscloud/authorization_product/genesyscloud_authorization_product_proxy.go index 2e2887b38..0a920b87a 100644 --- a/genesyscloud/authorization_product/genesyscloud_authorization_product_proxy.go +++ b/genesyscloud/authorization_product/genesyscloud_authorization_product_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/data_source_genesyscloud_architect_schedules.go b/genesyscloud/data_source_genesyscloud_architect_schedules.go index 9c7f761f5..a1b604725 100644 --- a/genesyscloud/data_source_genesyscloud_architect_schedules.go +++ b/genesyscloud/data_source_genesyscloud_architect_schedules.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func DataSourceSchedule() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_auth_division.go b/genesyscloud/data_source_genesyscloud_auth_division.go index fe39a49bf..dbf0c9e84 100644 --- a/genesyscloud/data_source_genesyscloud_auth_division.go +++ b/genesyscloud/data_source_genesyscloud_auth_division.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceAuthDivision() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_auth_division_home.go b/genesyscloud/data_source_genesyscloud_auth_division_home.go index f2b7371b0..bf12bec4b 100644 --- a/genesyscloud/data_source_genesyscloud_auth_division_home.go +++ b/genesyscloud/data_source_genesyscloud_auth_division_home.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func DataSourceAuthDivisionHome() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_journey_action_map.go b/genesyscloud/data_source_genesyscloud_journey_action_map.go index 0abfcc3b3..4f02d9b46 100644 --- a/genesyscloud/data_source_genesyscloud_journey_action_map.go +++ b/genesyscloud/data_source_genesyscloud_journey_action_map.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceJourneyActionMap() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_journey_action_template.go b/genesyscloud/data_source_genesyscloud_journey_action_template.go index 06b7db592..32f4f93e8 100644 --- a/genesyscloud/data_source_genesyscloud_journey_action_template.go +++ b/genesyscloud/data_source_genesyscloud_journey_action_template.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceJourneyActionTemplate() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_journey_outcome.go b/genesyscloud/data_source_genesyscloud_journey_outcome.go index 4b2cefa10..ec3473602 100644 --- a/genesyscloud/data_source_genesyscloud_journey_outcome.go +++ b/genesyscloud/data_source_genesyscloud_journey_outcome.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceJourneyOutcome() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_journey_segment.go b/genesyscloud/data_source_genesyscloud_journey_segment.go index e6c304c84..d870635b8 100644 --- a/genesyscloud/data_source_genesyscloud_journey_segment.go +++ b/genesyscloud/data_source_genesyscloud_journey_segment.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceJourneySegment() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_knowledge_category.go b/genesyscloud/data_source_genesyscloud_knowledge_category.go index 79411ff3f..27801fee5 100644 --- a/genesyscloud/data_source_genesyscloud_knowledge_category.go +++ b/genesyscloud/data_source_genesyscloud_knowledge_category.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceKnowledgeCategory() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_knowledge_knowledgebase.go b/genesyscloud/data_source_genesyscloud_knowledge_knowledgebase.go index 3ae92509f..96f15c63c 100644 --- a/genesyscloud/data_source_genesyscloud_knowledge_knowledgebase.go +++ b/genesyscloud/data_source_genesyscloud_knowledge_knowledgebase.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceKnowledgeKnowledgebase() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_knowledge_label.go b/genesyscloud/data_source_genesyscloud_knowledge_label.go index 97c2c4454..45312d9d4 100644 --- a/genesyscloud/data_source_genesyscloud_knowledge_label.go +++ b/genesyscloud/data_source_genesyscloud_knowledge_label.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceKnowledgeLabel() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_location.go b/genesyscloud/data_source_genesyscloud_location.go index dd7380a73..2063e68b5 100644 --- a/genesyscloud/data_source_genesyscloud_location.go +++ b/genesyscloud/data_source_genesyscloud_location.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func DataSourceLocation() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_organizations_me.go b/genesyscloud/data_source_genesyscloud_organizations_me.go index cc75781be..fe8a15dbe 100644 --- a/genesyscloud/data_source_genesyscloud_organizations_me.go +++ b/genesyscloud/data_source_genesyscloud_organizations_me.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" ) diff --git a/genesyscloud/data_source_genesyscloud_quality_forms_evaluation.go b/genesyscloud/data_source_genesyscloud_quality_forms_evaluation.go index 15bdd25b7..a69e74b4a 100644 --- a/genesyscloud/data_source_genesyscloud_quality_forms_evaluation.go +++ b/genesyscloud/data_source_genesyscloud_quality_forms_evaluation.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type EvaluationFormQuestionGroupStruct struct { diff --git a/genesyscloud/data_source_genesyscloud_quality_forms_survey.go b/genesyscloud/data_source_genesyscloud_quality_forms_survey.go index 9b684ed24..c3f3d84ae 100644 --- a/genesyscloud/data_source_genesyscloud_quality_forms_survey.go +++ b/genesyscloud/data_source_genesyscloud_quality_forms_survey.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceQualityFormsSurvey() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_routing_email_domain.go b/genesyscloud/data_source_genesyscloud_routing_email_domain.go index 4ea36c8ed..2e9266932 100644 --- a/genesyscloud/data_source_genesyscloud_routing_email_domain.go +++ b/genesyscloud/data_source_genesyscloud_routing_email_domain.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // Returns the schema for the routing email domain diff --git a/genesyscloud/data_source_genesyscloud_routing_email_domain_test.go b/genesyscloud/data_source_genesyscloud_routing_email_domain_test.go index d594bdbf1..f155f18b3 100644 --- a/genesyscloud/data_source_genesyscloud_routing_email_domain_test.go +++ b/genesyscloud/data_source_genesyscloud_routing_email_domain_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccDataSourceRoutingEmailDomain(t *testing.T) { diff --git a/genesyscloud/data_source_genesyscloud_routing_language.go b/genesyscloud/data_source_genesyscloud_routing_language.go index 7edc21646..eeebd35e8 100644 --- a/genesyscloud/data_source_genesyscloud_routing_language.go +++ b/genesyscloud/data_source_genesyscloud_routing_language.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceRoutingLanguage() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_routing_language_test.go b/genesyscloud/data_source_genesyscloud_routing_language_test.go index 9d6eebb2a..018c1d2e9 100644 --- a/genesyscloud/data_source_genesyscloud_routing_language_test.go +++ b/genesyscloud/data_source_genesyscloud_routing_language_test.go @@ -21,6 +21,12 @@ func TestAccDataSourceRoutingLanguage(t *testing.T) { PreCheck: func() { util.TestAccPreCheck(t) }, ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), Steps: []resource.TestStep{ + { + Config: GenerateRoutingLanguageResource( + langResource, + langName, + ), + }, { Config: GenerateRoutingLanguageResource( langResource, diff --git a/genesyscloud/data_source_genesyscloud_routing_settings.go b/genesyscloud/data_source_genesyscloud_routing_settings.go deleted file mode 100644 index 31fe3528d..000000000 --- a/genesyscloud/data_source_genesyscloud_routing_settings.go +++ /dev/null @@ -1,45 +0,0 @@ -package genesyscloud - -import ( - "context" - "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" -) - -func dataSourceRoutingSettings() *schema.Resource { - return &schema.Resource{ - Description: "An organization's routing settings", - ReadContext: provider.ReadWithPooledClient(dataSourceRoutingSettingsRead), - SchemaVersion: 1, - Schema: ResourceRoutingSettings().Schema, - } -} - -func dataSourceRoutingSettingsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - sdkConfig := m.(*provider.ProviderMeta).ClientConfig - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - - settings, resp, getErr := routingAPI.GetRoutingSettings() - if getErr != nil { - return util.BuildAPIDiagnosticError("genesyscloud_routing_settings", fmt.Sprintf("Error requesting routing settings error: %s", getErr), resp) - } - - d.SetId("datasource-settings") - if settings.ResetAgentScoreOnPresenceChange != nil { - d.Set("reset_agent_on_presence_change", *settings.ResetAgentScoreOnPresenceChange) - } - - if diagErr := readRoutingSettingsContactCenter(d, routingAPI); diagErr != nil { - return util.BuildDiagnosticError("genesyscloud_routing_settings", fmt.Sprintf("Error reading routing settings contact center"), fmt.Errorf("%v", diagErr)) - } - - if diagErr := readRoutingSettingsTranscription(d, routingAPI); diagErr != nil { - return util.BuildDiagnosticError("genesyscloud_routing_settings", fmt.Sprintf("Error reading routing settings transcription"), fmt.Errorf("%v", diagErr)) - } - - return nil -} diff --git a/genesyscloud/data_source_genesyscloud_routing_settings_test.go b/genesyscloud/data_source_genesyscloud_routing_settings_test.go deleted file mode 100644 index 29aa90b82..000000000 --- a/genesyscloud/data_source_genesyscloud_routing_settings_test.go +++ /dev/null @@ -1,65 +0,0 @@ -package genesyscloud - -import ( - "fmt" - "strings" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" -) - -func TestAccDataSourceRoutingSettings(t *testing.T) { - var ( - settingsResource = "test-settings" - settingsDataSource = "test-settings-data" - transcription = "EnabledQueueFlow" - confidence = "1" - ) - - resource.Test(t, resource.TestCase{ - PreCheck: func() { util.TestAccPreCheck(t) }, - ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), - Steps: []resource.TestStep{ - { - // Search by contact center - Config: generateRoutingSettingsWithCustomAttrs( - settingsResource, - util.TrueValue, - generateSettingsContactCenter(util.FalseValue), - generateSettingsTranscription(transcription, confidence, util.TrueValue, util.FalseValue), - ) + generateRoutingSettingsDataSource( - settingsDataSource, - util.TrueValue, - "genesyscloud_routing_settings."+settingsResource, - generateSettingsContactCenter(util.FalseValue), - generateSettingsTranscription(transcription, confidence, util.TrueValue, util.FalseValue), - ), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttrPair("data.genesyscloud_routing_settings."+settingsDataSource, "reset_agent_on_presence", "genesyscloud_routing_settings."+settingsResource, "reset_agent_on_presence"), - resource.TestCheckResourceAttrPair("data.genesyscloud_routing_settings."+settingsDataSource, "contactcenter.remove_skills_from_blind_transfer", "genesyscloud_routing_settings."+settingsResource, "contactcenter.remove_skills_from_blind_transfer"), - resource.TestCheckResourceAttrPair("data.genesyscloud_routing_settings."+settingsDataSource, "transcription.0.transcription", "genesyscloud_routing_settings."+settingsResource, "transcription.0.transcription"), - resource.TestCheckResourceAttrPair("data.genesyscloud_routing_settings."+settingsDataSource, "transcription.0.transcription_confidence_threshold", "genesyscloud_routing_settings."+settingsResource, "transcription.0.transcription_confidence_threshold"), - resource.TestCheckResourceAttrPair("data.genesyscloud_routing_settings."+settingsDataSource, "transcription.0.low_latency_transcription_enabled", "genesyscloud_routing_settings."+settingsResource, "transcription.0.low_latency_transcription_enabled"), - resource.TestCheckResourceAttrPair("data.genesyscloud_routing_settings."+settingsDataSource, "transcription.0.content_search_enabled", "genesyscloud_routing_settings."+settingsResource, "transcription.0.content_search_enabled"), - ), - }, - }, - }) -} - -func generateRoutingSettingsDataSource( - resourceID string, - resetAgentScoreOnPresenceChange string, - // Must explicitly use depends_on in terraform v0.13 when a data source references a resource - // Fixed in v0.14 https://github.com/hashicorp/terraform/pull/26284 - dependsOnResource string, - attrs ...string) string { - return fmt.Sprintf(`data "genesyscloud_routing_settings" "%s" { - reset_agent_on_presence_change = %s - %s - depends_on=[%s] - } - `, resourceID, resetAgentScoreOnPresenceChange, strings.Join(attrs, "\n"), dependsOnResource) -} diff --git a/genesyscloud/data_source_genesyscloud_routing_skill.go b/genesyscloud/data_source_genesyscloud_routing_skill.go index b211fde38..22bdf02dd 100644 --- a/genesyscloud/data_source_genesyscloud_routing_skill.go +++ b/genesyscloud/data_source_genesyscloud_routing_skill.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // The context is now added without Timeout , diff --git a/genesyscloud/data_source_genesyscloud_routing_skill_group.go b/genesyscloud/data_source_genesyscloud_routing_skill_group.go index 5399cba09..5bb30ae14 100644 --- a/genesyscloud/data_source_genesyscloud_routing_skill_group.go +++ b/genesyscloud/data_source_genesyscloud_routing_skill_group.go @@ -2,18 +2,14 @@ package genesyscloud import ( "context" - "encoding/json" "fmt" - "net/http" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" ) func dataSourceRoutingSkillGroup() *schema.Resource { @@ -31,52 +27,74 @@ func dataSourceRoutingSkillGroup() *schema.Resource { } func dataSourceRoutingSkillGroupRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + var ( + resp *platformclientv2.APIResponse + err error + ) sdkConfig := m.(*provider.ProviderMeta).ClientConfig routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - name := d.Get("name").(string) - // Find first non-deleted skill by name. Retry in case new skill is not yet indexed by search - return util.WithRetries(ctx, 15*time.Second, func() *retry.RetryError { - for pageNum := 1; ; pageNum++ { - const pageSize = 100 + retryErr := util.WithRetries(ctx, 15*time.Second, func() *retry.RetryError { + var skillGroups []platformclientv2.Skillgroupdefinition + skillGroups, resp, err = getAllSkillGroupsByName(routingAPI, name) + if err != nil { + return retry.NonRetryableError(err) + } - apiClient := &routingAPI.Configuration.APIClient - path := routingAPI.Configuration.BasePath + "/api/v2/routing/skillgroups" + for _, skillGroup := range skillGroups { + if name == *skillGroup.Name { + d.SetId(*skillGroup.Id) + return nil + } + } - headerParams := buildHeaderParams(routingAPI) - response, err := apiClient.CallAPI(path, "GET", nil, headerParams, nil, nil, "", nil) + return retry.RetryableError(fmt.Errorf("failed to find skill group with name '%s'", name)) + }) - if err != nil { - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("error encountered while trying to retrieve routing skills group found with name %s | error: %s", name, err), response)) - } + if retryErr != nil { + msg := fmt.Sprintf("failed to read skill group by name %s: %v", name, retryErr) + if resp != nil { + return util.BuildAPIDiagnosticError(getSkillGroupResourceName(), msg, resp) + } + return util.BuildDiagnosticError(getSkillGroupResourceName(), msg, fmt.Errorf("%v", retryErr)) + } - if err == nil && response.Error != nil { - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("error encountered while trying to retrieve routing skills group found with name %s | error:%s", name, err), response)) - } - if err == nil && response.StatusCode == http.StatusNotFound { - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("routing skills group not found with name %s", name), response)) - } + return nil +} - allSkillGroups := &AllSkillGroups{} +func getAllSkillGroupsByName(api *platformclientv2.RoutingApi, name string) ([]platformclientv2.Skillgroupdefinition, *platformclientv2.APIResponse, error) { + const pageSize = 100 + var ( + after string + allSkillGroups []platformclientv2.Skillgroupdefinition + ) + + for { + skillGroups, resp, err := api.GetRoutingSkillgroups(pageSize, name, after, "") + if err != nil { + return nil, resp, err + } - err = json.Unmarshal(response.RawBody, &allSkillGroups) - if err != nil { - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("error encountered while trying to retrieve routing skills group found with name %s %s", name, err), response)) - } + if skillGroups.Entities == nil || len(*skillGroups.Entities) == 0 { + break + } - if allSkillGroups.Entities == nil || len(allSkillGroups.Entities) == 0 { - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("no routing skills groups found with name %s", name), response)) - } + allSkillGroups = append(allSkillGroups, *skillGroups.Entities...) - for _, skillGroup := range allSkillGroups.Entities { - if skillGroup.Name == name { - d.SetId(skillGroup.ID) - return nil - } - } + if skillGroups.NextUri == nil || *skillGroups.NextUri == "" { + break } - }) + after, err = util.GetQueryParamValueFromUri(*skillGroups.NextUri, "after") + if err != nil { + return nil, nil, fmt.Errorf("error parsing NextUri '%s' while reading skill groups: %v", *skillGroups.NextUri, err) + } + if after == "" { + break + } + } + + return allSkillGroups, nil, nil } diff --git a/genesyscloud/data_source_genesyscloud_routing_skill_group_test.go b/genesyscloud/data_source_genesyscloud_routing_skill_group_test.go index a059ca33f..834da4175 100644 --- a/genesyscloud/data_source_genesyscloud_routing_skill_group_test.go +++ b/genesyscloud/data_source_genesyscloud_routing_skill_group_test.go @@ -47,9 +47,9 @@ func generateRoutingSkillGroupDataSource( // Must explicitly use depends_on in terraform v0.13 when a data source references a resource // Fixed in v0.14 https://github.com/hashicorp/terraform/pull/26284 dependsOnResource string) string { - return fmt.Sprintf(`data "genesyscloud_routing_skill_group" "%s" { + return fmt.Sprintf(`data "%s" "%s" { name = %s depends_on=[%s] } - `, resourceID, name, dependsOnResource) + `, getSkillGroupResourceName(), resourceID, name, dependsOnResource) } diff --git a/genesyscloud/data_source_genesyscloud_routing_utilization_label.go b/genesyscloud/data_source_genesyscloud_routing_utilization_label.go deleted file mode 100644 index 8c9581020..000000000 --- a/genesyscloud/data_source_genesyscloud_routing_utilization_label.go +++ /dev/null @@ -1,53 +0,0 @@ -package genesyscloud - -import ( - "context" - "fmt" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" -) - -func dataSourceRoutingUtilizationLabel() *schema.Resource { - return &schema.Resource{ - Description: "Data source for Genesys Cloud Routing Utilization Labels. Select a label by name.", - ReadContext: provider.ReadWithPooledClient(dataSourceRoutingUtilizationLabelRead), - Schema: map[string]*schema.Schema{ - "name": { - Description: "Label name.", - Type: schema.TypeString, - ValidateFunc: validation.StringDoesNotContainAny("*"), - Required: true, - }, - }, - } -} - -func dataSourceRoutingUtilizationLabelRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - sdkConfig := m.(*provider.ProviderMeta).ClientConfig - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - - name := d.Get("name").(string) - - return util.WithRetries(ctx, 15*time.Second, func() *retry.RetryError { - labels, resp, getErr := routingAPI.GetRoutingUtilizationLabels(1, 1, "", name) - if getErr != nil { - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_utilization_label", fmt.Sprintf("Error requesting label %s | error: %s", name, getErr), resp)) - } - - if labels.Entities == nil || len(*labels.Entities) == 0 { - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_utilization_label", fmt.Sprintf("No labels found with name %s", name), resp)) - } - - label := (*labels.Entities)[0] - d.SetId(*label.Id) - return nil - }) -} diff --git a/genesyscloud/data_source_genesyscloud_routing_wrapupcode.go b/genesyscloud/data_source_genesyscloud_routing_wrapupcode.go index 5596473d3..33d96f72b 100644 --- a/genesyscloud/data_source_genesyscloud_routing_wrapupcode.go +++ b/genesyscloud/data_source_genesyscloud_routing_wrapupcode.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func DataSourceRoutingWrapupcode() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_user.go b/genesyscloud/data_source_genesyscloud_user.go index b74a5b487..42ce5df10 100644 --- a/genesyscloud/data_source_genesyscloud_user.go +++ b/genesyscloud/data_source_genesyscloud_user.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func DataSourceUser() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_widget_deployment.go b/genesyscloud/data_source_genesyscloud_widget_deployment.go index 89892889f..31b04b4de 100644 --- a/genesyscloud/data_source_genesyscloud_widget_deployment.go +++ b/genesyscloud/data_source_genesyscloud_widget_deployment.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceWidgetDeployments() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_widget_deployment_test.go b/genesyscloud/data_source_genesyscloud_widget_deployment_test.go index 4d9b77b2d..ce1ce1b6d 100644 --- a/genesyscloud/data_source_genesyscloud_widget_deployment_test.go +++ b/genesyscloud/data_source_genesyscloud_widget_deployment_test.go @@ -2,6 +2,7 @@ package genesyscloud import ( "fmt" + "strconv" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "testing" @@ -16,23 +17,18 @@ func TestAccDataSourceWidgetDeployment(t *testing.T) { widgetDeploymentsDataSource = "widget-deployments-data" widgetDeploymentsName = "Widget_deployments-" ) - + description := "This is a test description" + flowId := uuid.NewString() widgetDeployV1 := &widgetDeploymentConfig{ resourceID: widgegetDeploymentsResource, - name: widgetDeploymentsName + uuid.NewString(), - description: "This is a test description", - flowID: uuid.NewString(), - clientType: "v1", + name: widgetDeploymentsName, + description: strconv.Quote(description), + flowID: strconv.Quote(flowId), + clientType: V2, authenticationRequired: "true", disabled: "true", - webChatSkin: "basic", - authenticationUrl: "https://localhost", } - _, err := provider.AuthorizeSdk() - if err != nil { - t.Fatal(err) - } deleteWidgetDeploymentWithName(widgetDeploymentsName) resource.Test(t, resource.TestCase{ @@ -40,7 +36,7 @@ func TestAccDataSourceWidgetDeployment(t *testing.T) { ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), Steps: []resource.TestStep{ { - Config: generateWidgetDeployV1(widgetDeployV1) + generateWidgetDeploymentDataSource(widgetDeploymentsDataSource, "genesyscloud_widget_deployment."+widgegetDeploymentsResource+".name", "genesyscloud_widget_deployment."+widgegetDeploymentsResource), + Config: generateWidgetDeploymentResource(widgetDeployV1) + generateWidgetDeploymentDataSource(widgetDeploymentsDataSource, "genesyscloud_widget_deployment."+widgegetDeploymentsResource+".name", "genesyscloud_widget_deployment."+widgegetDeploymentsResource), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair("data.genesyscloud_widget_deployment."+widgetDeploymentsDataSource, "id", "genesyscloud_widget_deployment."+widgegetDeploymentsResource, "id"), ), diff --git a/genesyscloud/dependent_consumers/genesyscloud_dependent_consumer_proxy.go b/genesyscloud/dependent_consumers/genesyscloud_dependent_consumer_proxy.go index 4c4311112..1b806376d 100644 --- a/genesyscloud/dependent_consumers/genesyscloud_dependent_consumer_proxy.go +++ b/genesyscloud/dependent_consumers/genesyscloud_dependent_consumer_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "strings" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/employeeperformance_externalmetrics_definitions/genesyscloud_employeeperformance_externalmetrics_definitions_proxy.go b/genesyscloud/employeeperformance_externalmetrics_definitions/genesyscloud_employeeperformance_externalmetrics_definitions_proxy.go index b252235c5..4f123630e 100644 --- a/genesyscloud/employeeperformance_externalmetrics_definitions/genesyscloud_employeeperformance_externalmetrics_definitions_proxy.go +++ b/genesyscloud/employeeperformance_externalmetrics_definitions/genesyscloud_employeeperformance_externalmetrics_definitions_proxy.go @@ -3,7 +3,7 @@ package employeeperformance_externalmetrics_definitions import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" ) diff --git a/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions.go b/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions.go index 3b443b79d..f8ff2b8c8 100644 --- a/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions.go +++ b/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions_test.go b/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions_test.go index a543c81f1..105eb00e5 100644 --- a/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions_test.go +++ b/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceEmployeePerformanceExternalMetricsDefintions(t *testing.T) { diff --git a/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_init_test.go b/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_init_test.go index 36de1b179..1e1c09f66 100644 --- a/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_init_test.go +++ b/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_init_test.go @@ -39,7 +39,6 @@ func (r *registerTestInstance) registerTestDataSources() { defer r.datasourceMapMutex.Unlock() providerDataSources["genesyscloud_externalcontacts_contact"] = DataSourceExternalContactsContact() - } // initTestResources initializes all test resources and data sources. diff --git a/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_proxy.go b/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_proxy.go index 44b582603..f624411ce 100644 --- a/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_proxy.go +++ b/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_proxy.go @@ -5,7 +5,9 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" + + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* @@ -50,14 +52,17 @@ type externalContactsContactsProxy struct { getExternalContactByIdAttr getExternalContactByIdFunc getExternalContactIdBySearchAttr getExternalContactIdBySearchFunc updateExternalContactAttr updateExternalContactFunc + externalContactsCache rc.CacheInterface[platformclientv2.Externalcontact] } // newExternalContactsContactsProxy initializes the External Contacts proxy with all of the data needed to communicate with Genesys Cloud func newExternalContactsContactsProxy(clientConfig *platformclientv2.Configuration) *externalContactsContactsProxy { api := platformclientv2.NewExternalContactsApiWithConfig(clientConfig) + externalContactsCache := rc.NewResourceCache[platformclientv2.Externalcontact]() return &externalContactsContactsProxy{ clientConfig: clientConfig, externalContactsApi: api, + externalContactsCache: externalContactsCache, getAllExternalContactsAttr: getAllExternalContactsFn, createExternalContactAttr: createExternalContactFn, getExternalContactByIdAttr: getExternalContactByIdFn, @@ -93,6 +98,9 @@ func (p *externalContactsContactsProxy) deleteExternalContactId(ctx context.Cont // getExternalContactById returns a single Genesys Cloud External Contact by Id func (p *externalContactsContactsProxy) getExternalContactById(ctx context.Context, externalContactId string) (*platformclientv2.Externalcontact, *platformclientv2.APIResponse, error) { + if externalContacts := rc.GetCacheItem(p.externalContactsCache, externalContactId); externalContacts != nil { // Get the Externalcontact from the cache, if not there in the cache then call p.getExternalContactByIdAttr() + return externalContacts, nil, nil + } return p.getExternalContactByIdAttr(ctx, p, externalContactId) } @@ -130,6 +138,12 @@ func getAllExternalContactsFn(ctx context.Context, p *externalContactsContactsPr } cursor = *externalContacts.Cursors.After } + + // Cache the External Contacts resource into the p.externalContactsCache for later use + for _, externalContact := range allExternalContacts { + rc.SetCache(p.externalContactsCache, *externalContact.Id, externalContact) + } + return &allExternalContacts, response, nil } diff --git a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact.go b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact.go index bdc3722ae..98565b2ea 100644 --- a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact.go +++ b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_schema.go b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_schema.go index 6e56d6f0e..2b9ff630b 100644 --- a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_schema.go +++ b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_schema.go @@ -5,7 +5,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" ) /* @@ -53,7 +53,7 @@ func ResourceExternalContact() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - ValidateDiagFunc: gcloud.ValidatePhoneNumber, + ValidateDiagFunc: validators.ValidatePhoneNumber, }, "country_code": { Description: "Phone number country code.", @@ -95,7 +95,7 @@ func ResourceExternalContact() *schema.Resource { Description: "Contact address country code.", Type: schema.TypeString, Optional: true, - ValidateDiagFunc: gcloud.ValidateCountryCode, + ValidateDiagFunc: validators.ValidateCountryCode, }, }, } diff --git a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_test.go b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_test.go index e299b2146..bf6c6c2b0 100644 --- a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_test.go +++ b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_utils.go b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_utils.go index b6b864bb4..d7b3df901 100644 --- a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_utils.go +++ b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_utils.go @@ -5,7 +5,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/nyaruka/phonenumbers" ) diff --git a/genesyscloud/flow_loglevel/genesyscloud_flow_loglevel_proxy.go b/genesyscloud/flow_loglevel/genesyscloud_flow_loglevel_proxy.go index abcef0774..34437c34a 100644 --- a/genesyscloud/flow_loglevel/genesyscloud_flow_loglevel_proxy.go +++ b/genesyscloud/flow_loglevel/genesyscloud_flow_loglevel_proxy.go @@ -3,7 +3,7 @@ package flow_loglevel import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel.go b/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel.go index f993f67b5..0100e60ae 100644 --- a/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel.go +++ b/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel_test.go b/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel_test.go index bddec6ed3..acbf5cd6f 100644 --- a/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel_test.go +++ b/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel_test.go @@ -5,7 +5,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/architect_flow" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" diff --git a/genesyscloud/flow_milestone/genesyscloud_flow_milestone_proxy.go b/genesyscloud/flow_milestone/genesyscloud_flow_milestone_proxy.go index 104daebed..932a45cc7 100644 --- a/genesyscloud/flow_milestone/genesyscloud_flow_milestone_proxy.go +++ b/genesyscloud/flow_milestone/genesyscloud_flow_milestone_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone.go b/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone.go index fed202ea8..b83780b75 100644 --- a/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone.go +++ b/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_test.go b/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_test.go index 3d7da7915..2f26afbd0 100644 --- a/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_test.go +++ b/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceFlowMilestone(t *testing.T) { diff --git a/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_utils.go b/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_utils.go index 838a056c6..46b801e53 100644 --- a/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_utils.go +++ b/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_utils.go @@ -2,7 +2,7 @@ package flow_milestone import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/flow_outcome/genesyscloud_flow_outcome_proxy.go b/genesyscloud/flow_outcome/genesyscloud_flow_outcome_proxy.go index 6bbe109d7..4aa3507bc 100644 --- a/genesyscloud/flow_outcome/genesyscloud_flow_outcome_proxy.go +++ b/genesyscloud/flow_outcome/genesyscloud_flow_outcome_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome.go b/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome.go index 4fbb0dc8a..b36bf8781 100644 --- a/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome.go +++ b/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome_utils.go b/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome_utils.go index eb0cc2e39..efde6651e 100644 --- a/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome_utils.go +++ b/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome_utils.go @@ -2,7 +2,7 @@ package flow_outcome import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/group/data_source_genesyscloud_group_test.go b/genesyscloud/group/data_source_genesyscloud_group_test.go index f6bbb0f6b..f69c4f037 100644 --- a/genesyscloud/group/data_source_genesyscloud_group_test.go +++ b/genesyscloud/group/data_source_genesyscloud_group_test.go @@ -10,7 +10,7 @@ import ( "time" "github.com/google/uuid" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" diff --git a/genesyscloud/group/genesyscloud_group_proxy.go b/genesyscloud/group/genesyscloud_group_proxy.go index 951d367b7..956ba6d43 100644 --- a/genesyscloud/group/genesyscloud_group_proxy.go +++ b/genesyscloud/group/genesyscloud_group_proxy.go @@ -3,7 +3,7 @@ package group import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" ) diff --git a/genesyscloud/group/resource_genesyscloud_group.go b/genesyscloud/group/resource_genesyscloud_group.go index 4792060d1..60faa5abc 100644 --- a/genesyscloud/group/resource_genesyscloud_group.go +++ b/genesyscloud/group/resource_genesyscloud_group.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func GetAllGroups(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/group/resource_genesyscloud_group_test.go b/genesyscloud/group/resource_genesyscloud_group_test.go index 930dc3d9a..f9658b391 100644 --- a/genesyscloud/group/resource_genesyscloud_group_test.go +++ b/genesyscloud/group/resource_genesyscloud_group_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceGroupBasic(t *testing.T) { diff --git a/genesyscloud/group/resource_genesyscloud_group_utils.go b/genesyscloud/group/resource_genesyscloud_group_utils.go index 4bf5d2ebe..b7b5652fe 100644 --- a/genesyscloud/group/resource_genesyscloud_group_utils.go +++ b/genesyscloud/group/resource_genesyscloud_group_utils.go @@ -3,7 +3,7 @@ package group import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "strings" "terraform-provider-genesyscloud/genesyscloud/util" diff --git a/genesyscloud/group_roles/genesyscloud_group_roles_proxy.go b/genesyscloud/group_roles/genesyscloud_group_roles_proxy.go index 0cb0c84b7..87cb8703e 100644 --- a/genesyscloud/group_roles/genesyscloud_group_roles_proxy.go +++ b/genesyscloud/group_roles/genesyscloud_group_roles_proxy.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var internalProxy *groupRolesProxy diff --git a/genesyscloud/group_roles/resource_genesyscloud_group_roles_schema.go b/genesyscloud/group_roles/resource_genesyscloud_group_roles_schema.go index c8138ae07..7adf536f1 100644 --- a/genesyscloud/group_roles/resource_genesyscloud_group_roles_schema.go +++ b/genesyscloud/group_roles/resource_genesyscloud_group_roles_schema.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" diff --git a/genesyscloud/group_roles/resource_genesyscloud_group_roles_utils.go b/genesyscloud/group_roles/resource_genesyscloud_group_roles_utils.go index 71d165e5e..d1ecb34c9 100644 --- a/genesyscloud/group_roles/resource_genesyscloud_group_roles_utils.go +++ b/genesyscloud/group_roles/resource_genesyscloud_group_roles_utils.go @@ -7,7 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func flattenSubjectRoles(d *schema.ResourceData, p *groupRolesProxy) (*schema.Set, *platformclientv2.APIResponse, error) { diff --git a/genesyscloud/idp_adfs/genesyscloud_idp_adfs_proxy.go b/genesyscloud/idp_adfs/genesyscloud_idp_adfs_proxy.go index 23910c006..a1825f1c1 100644 --- a/genesyscloud/idp_adfs/genesyscloud_idp_adfs_proxy.go +++ b/genesyscloud/idp_adfs/genesyscloud_idp_adfs_proxy.go @@ -3,7 +3,7 @@ package idp_adfs import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs.go b/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs.go index 1367be58b..cde86dead 100644 --- a/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs.go +++ b/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_test.go b/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_test.go index 5b8cc3391..ef089ab46 100644 --- a/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_test.go +++ b/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceIdpAdfs(t *testing.T) { diff --git a/genesyscloud/idp_okta/genesyscloud_idp_okta_proxy.go b/genesyscloud/idp_okta/genesyscloud_idp_okta_proxy.go index d40d622d0..1af69517d 100644 --- a/genesyscloud/idp_okta/genesyscloud_idp_okta_proxy.go +++ b/genesyscloud/idp_okta/genesyscloud_idp_okta_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/idp_okta/resource_genesyscloud_idp_okta.go b/genesyscloud/idp_okta/resource_genesyscloud_idp_okta.go index 2925dbc85..7f0de2a14 100644 --- a/genesyscloud/idp_okta/resource_genesyscloud_idp_okta.go +++ b/genesyscloud/idp_okta/resource_genesyscloud_idp_okta.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/constants" "terraform-provider-genesyscloud/genesyscloud/util/lists" diff --git a/genesyscloud/idp_okta/resource_genesyscloud_idp_okta_test.go b/genesyscloud/idp_okta/resource_genesyscloud_idp_okta_test.go index 547eee8b3..3b2e770aa 100644 --- a/genesyscloud/idp_okta/resource_genesyscloud_idp_okta_test.go +++ b/genesyscloud/idp_okta/resource_genesyscloud_idp_okta_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceIdpOkta(t *testing.T) { diff --git a/genesyscloud/idp_salesforce/genesyscloud_idp_salesforce_proxy.go b/genesyscloud/idp_salesforce/genesyscloud_idp_salesforce_proxy.go index 3af3972b0..0610597c8 100644 --- a/genesyscloud/idp_salesforce/genesyscloud_idp_salesforce_proxy.go +++ b/genesyscloud/idp_salesforce/genesyscloud_idp_salesforce_proxy.go @@ -2,7 +2,7 @@ package idp_salesforce import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce.go b/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce.go index f8ba2f919..eadc684c1 100644 --- a/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce.go +++ b/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce_test.go b/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce_test.go index 431890348..d891e5601 100644 --- a/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce_test.go +++ b/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceIdpSalesforce(t *testing.T) { diff --git a/genesyscloud/integration/genesyscloud_integration_proxy.go b/genesyscloud/integration/genesyscloud_integration_proxy.go index 571526332..5f40e21a4 100644 --- a/genesyscloud/integration/genesyscloud_integration_proxy.go +++ b/genesyscloud/integration/genesyscloud_integration_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/integration/resource_genesyscloud_integration.go b/genesyscloud/integration/resource_genesyscloud_integration.go index cfcf214fb..d164f75a6 100644 --- a/genesyscloud/integration/resource_genesyscloud_integration.go +++ b/genesyscloud/integration/resource_genesyscloud_integration.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/integration/resource_genesyscloud_integration_test.go b/genesyscloud/integration/resource_genesyscloud_integration_test.go index b0474efb2..4f0476236 100644 --- a/genesyscloud/integration/resource_genesyscloud_integration_test.go +++ b/genesyscloud/integration/resource_genesyscloud_integration_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* @@ -266,7 +266,9 @@ func TestAccResourceIntegration(t *testing.T) { strconv.Quote(credName1), strconv.Quote(credTypeName1), integrationCred.GenerateCredentialFields( - util.GenerateMapProperty(key1, strconv.Quote(val1)), + map[string]string{ + key1: strconv.Quote(val1), + }, ), ) + GenerateIntegrationResource( inteResource2, @@ -297,7 +299,9 @@ func TestAccResourceIntegration(t *testing.T) { strconv.Quote(credName1), strconv.Quote(credTypeName1), integrationCred.GenerateCredentialFields( - util.GenerateMapProperty(key1, strconv.Quote(val1)), + map[string]string{ + key1: strconv.Quote(val1), + }, ), ) + GenerateIntegrationResource( inteResource2, diff --git a/genesyscloud/integration/resource_genesyscloud_integration_utils.go b/genesyscloud/integration/resource_genesyscloud_integration_utils.go index 5fbe82c6e..b28c17d00 100644 --- a/genesyscloud/integration/resource_genesyscloud_integration_utils.go +++ b/genesyscloud/integration/resource_genesyscloud_integration_utils.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/integration_action/genesyscloud_integration_action_proxy.go b/genesyscloud/integration_action/genesyscloud_integration_action_proxy.go index 1b963ef3e..bc7f7591a 100644 --- a/genesyscloud/integration_action/genesyscloud_integration_action_proxy.go +++ b/genesyscloud/integration_action/genesyscloud_integration_action_proxy.go @@ -4,7 +4,7 @@ import ( "context" "encoding/json" "errors" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "net/http" ) diff --git a/genesyscloud/integration_action/resource_genesyscloud_integration_action.go b/genesyscloud/integration_action/resource_genesyscloud_integration_action.go index b0da5cf21..b2d9139c9 100644 --- a/genesyscloud/integration_action/resource_genesyscloud_integration_action.go +++ b/genesyscloud/integration_action/resource_genesyscloud_integration_action.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/integration_action/resource_genesyscloud_integration_action_test.go b/genesyscloud/integration_action/resource_genesyscloud_integration_action_test.go index d3d588764..24fe588ff 100644 --- a/genesyscloud/integration_action/resource_genesyscloud_integration_action_test.go +++ b/genesyscloud/integration_action/resource_genesyscloud_integration_action_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* @@ -114,20 +114,26 @@ func TestAccResourceIntegrationAction(t *testing.T) { reqUrlTemplate2, reqType2, strconv.Quote(reqTemp), - util.GenerateMapAttr( + util.GenerateMapAttrWithMapProperties( "headers", - util.GenerateMapProperty(headerKey, strconv.Quote(headerVal1)), + map[string]string{ + headerKey: strconv.Quote(headerVal1), + }, ), ), generateIntegrationActionConfigResponse( strconv.Quote(successTemplate), - util.GenerateMapAttr( + util.GenerateMapAttrWithMapProperties( "translation_map", - util.GenerateMapProperty(transMapAttr, strconv.Quote(transMapVal1)), + map[string]string{ + transMapAttr: strconv.Quote(transMapVal1), + }, ), - util.GenerateMapAttr( + util.GenerateMapAttrWithMapProperties( "translation_map_defaults", - util.GenerateMapProperty(transMapAttr, strconv.Quote(transMapValDefault1)), + map[string]string{ + transMapAttr: strconv.Quote(transMapValDefault1), + }, ), ), ), @@ -165,20 +171,26 @@ func TestAccResourceIntegrationAction(t *testing.T) { reqUrlTemplate2, reqType2, strconv.Quote(reqTemp), - util.GenerateMapAttr( + util.GenerateMapAttrWithMapProperties( "headers", - util.GenerateMapProperty(headerKey, strconv.Quote(headerVal2)), + map[string]string{ + headerKey: strconv.Quote(headerVal2), + }, ), ), generateIntegrationActionConfigResponse( strconv.Quote(successTemplate), - util.GenerateMapAttr( + util.GenerateMapAttrWithMapProperties( "translation_map", - util.GenerateMapProperty(transMapAttr, strconv.Quote(transMapVal2)), + map[string]string{ + transMapAttr: strconv.Quote(transMapVal2), + }, ), - util.GenerateMapAttr( + util.GenerateMapAttrWithMapProperties( "translation_map_defaults", - util.GenerateMapProperty(transMapAttr, strconv.Quote(transMapValDefault2)), + map[string]string{ + transMapAttr: strconv.Quote(transMapValDefault2), + }, ), ), ), diff --git a/genesyscloud/integration_action/resource_genesyscloud_integration_action_utils.go b/genesyscloud/integration_action/resource_genesyscloud_integration_action_utils.go index 23120db0c..f74621600 100644 --- a/genesyscloud/integration_action/resource_genesyscloud_integration_action_utils.go +++ b/genesyscloud/integration_action/resource_genesyscloud_integration_action_utils.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" ) diff --git a/genesyscloud/integration_credential/data_source_genesyscloud_integration_credential_test.go b/genesyscloud/integration_credential/data_source_genesyscloud_integration_credential_test.go index 4bf17ec65..a96945459 100644 --- a/genesyscloud/integration_credential/data_source_genesyscloud_integration_credential_test.go +++ b/genesyscloud/integration_credential/data_source_genesyscloud_integration_credential_test.go @@ -35,7 +35,9 @@ func TestAccDataSourceIntegrationCredential(t *testing.T) { strconv.Quote(credName1), strconv.Quote(typeName1), GenerateCredentialFields( - util.GenerateMapProperty(key1, strconv.Quote(val1)), + map[string]string{ + key1: strconv.Quote(val1), + }, ), ) + generateIntegrationCredentialDataSource(credResource2, credName1, diff --git a/genesyscloud/integration_credential/genesyscloud_integration_credential_proxy.go b/genesyscloud/integration_credential/genesyscloud_integration_credential_proxy.go index dd1c2336b..31f0da8df 100644 --- a/genesyscloud/integration_credential/genesyscloud_integration_credential_proxy.go +++ b/genesyscloud/integration_credential/genesyscloud_integration_credential_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/integration_credential/resource_genesyscloud_integration_credential.go b/genesyscloud/integration_credential/resource_genesyscloud_integration_credential.go index d995c6766..e82c6ca79 100644 --- a/genesyscloud/integration_credential/resource_genesyscloud_integration_credential.go +++ b/genesyscloud/integration_credential/resource_genesyscloud_integration_credential.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_test.go b/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_test.go index c90454fbe..f401541ac 100644 --- a/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_test.go +++ b/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* @@ -49,7 +49,9 @@ func TestAccResourceCredential(t *testing.T) { strconv.Quote(credName1), strconv.Quote(typeName1), GenerateCredentialFields( - util.GenerateMapProperty(key1, strconv.Quote(val1)), + map[string]string{ + key1: strconv.Quote(val1), + }, ), ), Check: resource.ComposeTestCheckFunc( @@ -65,7 +67,9 @@ func TestAccResourceCredential(t *testing.T) { strconv.Quote(credName2), strconv.Quote(typeName1), GenerateCredentialFields( - util.GenerateMapProperty(key1, strconv.Quote(val1_2)), + map[string]string{ + key1: strconv.Quote(val1_2), + }, ), ), Check: resource.ComposeTestCheckFunc( @@ -81,8 +85,10 @@ func TestAccResourceCredential(t *testing.T) { strconv.Quote(credName2), strconv.Quote(typeName1), GenerateCredentialFields( - util.GenerateMapProperty(key1, strconv.Quote(val1)), - util.GenerateMapProperty(key2, strconv.Quote(val2)), + map[string]string{ + key1: strconv.Quote(val1), + key2: strconv.Quote(val2), + }, ), ), Check: resource.ComposeTestCheckFunc( @@ -99,8 +105,10 @@ func TestAccResourceCredential(t *testing.T) { strconv.Quote(credName2), strconv.Quote(typeName1), GenerateCredentialFields( - util.GenerateMapProperty(key1, strconv.Quote(val1)), - util.GenerateMapProperty(key2, strconv.Quote(val2_2)), + map[string]string{ + key1: strconv.Quote(val1), + key2: strconv.Quote(val2_2), + }, ), ), Check: resource.ComposeTestCheckFunc( @@ -124,7 +132,9 @@ func TestAccResourceCredential(t *testing.T) { strconv.Quote(credName1), strconv.Quote(typeName2), GenerateCredentialFields( - util.GenerateMapProperty(key3, strconv.Quote(val3)), + map[string]string{ + key3: strconv.Quote(val3), + }, ), ), Check: resource.ComposeTestCheckFunc( @@ -140,7 +150,9 @@ func TestAccResourceCredential(t *testing.T) { strconv.Quote(credName2), strconv.Quote(typeName2), GenerateCredentialFields( - util.GenerateMapProperty(key3, strconv.Quote(val3)), + map[string]string{ + key3: strconv.Quote(val3), + }, ), ), Check: resource.ComposeTestCheckFunc( @@ -213,8 +225,10 @@ func TestAccGenesysCloudOAuthResourceCredentialWithSecret(t *testing.T) { strconv.Quote(credName), strconv.Quote(typeName), GenerateCredentialFields( - util.GenerateMapProperty("clientId", strconv.Quote(clientId)), - util.GenerateMapProperty("clientSecret", strconv.Quote(clientSecret)), + map[string]string{ + "clientId": strconv.Quote(clientId), + "clientSecret": strconv.Quote(clientSecret), + }, ), ), Check: resource.ComposeTestCheckFunc( diff --git a/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_utils.go b/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_utils.go index 83269582e..869ecf396 100644 --- a/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_utils.go +++ b/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_utils.go @@ -37,6 +37,6 @@ func GenerateCredentialResource(resourceID string, name string, credentialType s } // GenerateCredentialFields builds a terraform string for multiple credential fields -func GenerateCredentialFields(fields ...string) string { - return util.GenerateMapAttr("fields", fields...) +func GenerateCredentialFields(fields map[string]string) string { + return util.GenerateMapAttrWithMapProperties("fields", fields) } diff --git a/genesyscloud/integration_custom_auth_action/data_source_genesyscloud_integration_custom_auth_action_test.go b/genesyscloud/integration_custom_auth_action/data_source_genesyscloud_integration_custom_auth_action_test.go index c305ebb95..24c183ef2 100644 --- a/genesyscloud/integration_custom_auth_action/data_source_genesyscloud_integration_custom_auth_action_test.go +++ b/genesyscloud/integration_custom_auth_action/data_source_genesyscloud_integration_custom_auth_action_test.go @@ -31,7 +31,7 @@ func TestAccDataSourceIntegrationCustomAuthAction(t *testing.T) { strconv.Quote(credentialResourceName), strconv.Quote(customAuthCredentialType), integrationCred.GenerateCredentialFields( - util.GenerateMapProperty(credKey1, strconv.Quote(credVal1)), + map[string]string{credKey1: strconv.Quote(credVal1)}, ), ) diff --git a/genesyscloud/integration_custom_auth_action/genesyscloud_integration_custom_auth_action_proxy.go b/genesyscloud/integration_custom_auth_action/genesyscloud_integration_custom_auth_action_proxy.go index 9d70ccc8b..dda4e4553 100644 --- a/genesyscloud/integration_custom_auth_action/genesyscloud_integration_custom_auth_action_proxy.go +++ b/genesyscloud/integration_custom_auth_action/genesyscloud_integration_custom_auth_action_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "strings" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action.go b/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action.go index 3ae2db2df..8839fee9b 100644 --- a/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action.go +++ b/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_test.go b/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_test.go index 193ef3266..3d2e51163 100644 --- a/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_test.go +++ b/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_test.go @@ -15,7 +15,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type customAuthActionResource struct { @@ -54,7 +54,9 @@ func TestAccResourceIntegrationCustomAuthAction(t *testing.T) { strconv.Quote(credentialResourceName), strconv.Quote(customAuthCredentialType), integrationCred.GenerateCredentialFields( - util.GenerateMapProperty(credKey1, strconv.Quote(credVal1)), + map[string]string{ + credKey1: strconv.Quote(credVal1), + }, ), ) diff --git a/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_utils.go b/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_utils.go index 2632161aa..209c4e24d 100644 --- a/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_utils.go +++ b/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_utils.go @@ -6,7 +6,7 @@ import ( integrationAction "terraform-provider-genesyscloud/genesyscloud/integration_action" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/journey_outcome_predictor/genesyscloud_journey_outcome_predictor_proxy.go b/genesyscloud/journey_outcome_predictor/genesyscloud_journey_outcome_predictor_proxy.go index cdbdc6b6c..e5846292b 100644 --- a/genesyscloud/journey_outcome_predictor/genesyscloud_journey_outcome_predictor_proxy.go +++ b/genesyscloud/journey_outcome_predictor/genesyscloud_journey_outcome_predictor_proxy.go @@ -2,7 +2,7 @@ package journey_outcome_predictor import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor.go b/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor.go index 381edb23f..cda54b354 100644 --- a/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor.go +++ b/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor_test.go b/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor_test.go index 3db246089..98872d160 100644 --- a/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor_test.go +++ b/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceJourneyOutcomePredictor(t *testing.T) { diff --git a/genesyscloud/journey_views/genesyscloud_journey_views_proxy.go b/genesyscloud/journey_views/genesyscloud_journey_views_proxy.go index 929ddd59d..4964990b3 100644 --- a/genesyscloud/journey_views/genesyscloud_journey_views_proxy.go +++ b/genesyscloud/journey_views/genesyscloud_journey_views_proxy.go @@ -2,7 +2,7 @@ package journey_views import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" ) diff --git a/genesyscloud/journey_views/resource_genesyscloud_journey_views.go b/genesyscloud/journey_views/resource_genesyscloud_journey_views.go index 525f8b15f..2d6b4f702 100644 --- a/genesyscloud/journey_views/resource_genesyscloud_journey_views.go +++ b/genesyscloud/journey_views/resource_genesyscloud_journey_views.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -65,7 +65,7 @@ func readJourneyView(ctx context.Context, d *schema.ResourceData, meta interface } return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to get journeyView with viewId %s | error: %s", viewId, err), resp)) } - + resourcedata.SetNillableValue(d, "name", journeyView.Name) resourcedata.SetNillableValue(d, "description", journeyView.Description) resourcedata.SetNillableValue(d, "interval", journeyView.Interval) diff --git a/genesyscloud/journey_views/resource_genesyscloud_journey_views_test.go b/genesyscloud/journey_views/resource_genesyscloud_journey_views_test.go index 5d2153764..8116ced64 100644 --- a/genesyscloud/journey_views/resource_genesyscloud_journey_views_test.go +++ b/genesyscloud/journey_views/resource_genesyscloud_journey_views_test.go @@ -5,7 +5,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "strings" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" diff --git a/genesyscloud/journey_views/resource_genesyscloud_journey_views_utils.go b/genesyscloud/journey_views/resource_genesyscloud_journey_views_utils.go index 2f6dc4691..7c8254f7d 100644 --- a/genesyscloud/journey_views/resource_genesyscloud_journey_views_utils.go +++ b/genesyscloud/journey_views/resource_genesyscloud_journey_views_utils.go @@ -3,7 +3,7 @@ package journey_views import ( "errors" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" ) diff --git a/genesyscloud/oauth_client/resource_genesyscloud_oauth_client.go b/genesyscloud/oauth_client/resource_genesyscloud_oauth_client.go index 1517a4592..851bf78cc 100644 --- a/genesyscloud/oauth_client/resource_genesyscloud_oauth_client.go +++ b/genesyscloud/oauth_client/resource_genesyscloud_oauth_client.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllOAuthClients(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_proxy.go b/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_proxy.go index deda69802..f4b0416f6 100644 --- a/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_proxy.go +++ b/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_proxy.go @@ -5,7 +5,7 @@ import ( "log" "sync" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var internalProxy *oauthClientProxy diff --git a/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_utils.go b/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_utils.go index eebfceade..dcdacc228 100644 --- a/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_utils.go +++ b/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_utils.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func buildOAuthRedirectURIs(d *schema.ResourceData) *[]string { diff --git a/genesyscloud/oauth_client/resource_genesyscloude_oauth_client_unit_test.go b/genesyscloud/oauth_client/resource_genesyscloude_oauth_client_unit_test.go index 531108b05..2f8b9e9fb 100644 --- a/genesyscloud/oauth_client/resource_genesyscloude_oauth_client_unit_test.go +++ b/genesyscloud/oauth_client/resource_genesyscloude_oauth_client_unit_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/stretchr/testify/assert" ) diff --git a/genesyscloud/organization_authentication_settings/genesyscloud_organization_authentication_settings_proxy.go b/genesyscloud/organization_authentication_settings/genesyscloud_organization_authentication_settings_proxy.go index 980274ccf..bd316f7db 100644 --- a/genesyscloud/organization_authentication_settings/genesyscloud_organization_authentication_settings_proxy.go +++ b/genesyscloud/organization_authentication_settings/genesyscloud_organization_authentication_settings_proxy.go @@ -3,7 +3,7 @@ package organization_authentication_settings import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings.go b/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings.go index 5907f7216..00e0e5f2f 100644 --- a/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings.go +++ b/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_unit_test.go b/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_unit_test.go index 55e472c64..2d65d7a8b 100644 --- a/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_unit_test.go +++ b/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_unit_test.go @@ -5,7 +5,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/stretchr/testify/assert" "net/http" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_utils.go b/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_utils.go index 23652caf4..d981238fd 100644 --- a/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_utils.go +++ b/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_utils.go @@ -5,7 +5,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/orgauthorization_pairing/genesyscloud_orgauthorization_pairing_proxy.go b/genesyscloud/orgauthorization_pairing/genesyscloud_orgauthorization_pairing_proxy.go index d2e7f36e1..5cfb68125 100644 --- a/genesyscloud/orgauthorization_pairing/genesyscloud_orgauthorization_pairing_proxy.go +++ b/genesyscloud/orgauthorization_pairing/genesyscloud_orgauthorization_pairing_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var internalProxy *orgauthorizationPairingProxy diff --git a/genesyscloud/orgauthorization_pairing/resource_genesyscloud_orgauthorization_pairing.go b/genesyscloud/orgauthorization_pairing/resource_genesyscloud_orgauthorization_pairing.go index dc4e4ba74..5f4bc6923 100644 --- a/genesyscloud/orgauthorization_pairing/resource_genesyscloud_orgauthorization_pairing.go +++ b/genesyscloud/orgauthorization_pairing/resource_genesyscloud_orgauthorization_pairing.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func createOrgauthorizationPairing(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { diff --git a/genesyscloud/outbound/data_source_genesyscloud_outbound_cattemptlimit.go b/genesyscloud/outbound/data_source_genesyscloud_outbound_cattemptlimit.go index 351f72353..25a84f122 100644 --- a/genesyscloud/outbound/data_source_genesyscloud_outbound_cattemptlimit.go +++ b/genesyscloud/outbound/data_source_genesyscloud_outbound_cattemptlimit.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func DataSourceOutboundAttemptLimit() *schema.Resource { diff --git a/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign.go b/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign.go index b7793f2e1..391bbdbf2 100644 --- a/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign.go +++ b/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceOutboundMessagingcampaign() *schema.Resource { diff --git a/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign_test.go b/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign_test.go index 100929427..a95ebc65b 100644 --- a/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign_test.go +++ b/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var TrueValue = "true" diff --git a/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign.go b/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign.go index 9ee2e0ea9..b497d5851 100644 --- a/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign.go +++ b/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) const ( diff --git a/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign_test.go b/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign_test.go index 0bbd54648..c0d206474 100644 --- a/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign_test.go +++ b/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" obCallableTimeset "terraform-provider-genesyscloud/genesyscloud/outbound_callabletimeset" obContactList "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list" diff --git a/genesyscloud/outbound_attempt_limit/data_source_genesyscloud_outbound_attemptlimit.go b/genesyscloud/outbound_attempt_limit/data_source_genesyscloud_outbound_attemptlimit.go index 30a977b54..1d330796b 100644 --- a/genesyscloud/outbound_attempt_limit/data_source_genesyscloud_outbound_attemptlimit.go +++ b/genesyscloud/outbound_attempt_limit/data_source_genesyscloud_outbound_attemptlimit.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func DataSourceOutboundAttemptLimit() *schema.Resource { diff --git a/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit.go b/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit.go index 0c0831cc6..febb736c6 100644 --- a/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit.go +++ b/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) const ( diff --git a/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit_test.go b/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit_test.go index 896c8f02f..d9d1292be 100644 --- a/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit_test.go +++ b/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // func init() { diff --git a/genesyscloud/outbound_callabletimeset/genesyscloud_outbound_callabletimeset_proxy.go b/genesyscloud/outbound_callabletimeset/genesyscloud_outbound_callabletimeset_proxy.go index ae17580c0..96f564262 100644 --- a/genesyscloud/outbound_callabletimeset/genesyscloud_outbound_callabletimeset_proxy.go +++ b/genesyscloud/outbound_callabletimeset/genesyscloud_outbound_callabletimeset_proxy.go @@ -6,7 +6,7 @@ import ( "log" "strings" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset.go b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset.go index 1010a36b2..c9eb25331 100644 --- a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset.go +++ b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_schema.go b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_schema.go index 703ef3099..d2ccb2cac 100644 --- a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_schema.go +++ b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_schema.go @@ -6,7 +6,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" ) const resourceName = "genesyscloud_outbound_callabletimeset" @@ -23,13 +23,13 @@ var campaignTimeslotResource = &schema.Resource{ `start_time`: { Description: `The start time of the interval as an ISO-8601 string, i.e. HH:mm:ss`, Required: true, - ValidateDiagFunc: gcloud.ValidateTime, + ValidateDiagFunc: validators.ValidateTime, Type: schema.TypeString, }, `stop_time`: { Description: `The end time of the interval as an ISO-8601 string, i.e. HH:mm:ss`, Required: true, - ValidateDiagFunc: gcloud.ValidateTime, + ValidateDiagFunc: validators.ValidateTime, Type: schema.TypeString, }, `day`: { diff --git a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_test.go b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_test.go index 85ba29c80..12f28a9d2 100644 --- a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_test.go +++ b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceOutboundCallabletimeset(t *testing.T) { diff --git a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_utils.go b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_utils.go index 0396e70b2..acba89881 100644 --- a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_utils.go +++ b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_utils.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_callanalysisresponseset/genesyscloud_outbound_callanalysisresponseset_proxy.go b/genesyscloud/outbound_callanalysisresponseset/genesyscloud_outbound_callanalysisresponseset_proxy.go index 2b95656c5..5eded85c3 100644 --- a/genesyscloud/outbound_callanalysisresponseset/genesyscloud_outbound_callanalysisresponseset_proxy.go +++ b/genesyscloud/outbound_callanalysisresponseset/genesyscloud_outbound_callanalysisresponseset_proxy.go @@ -3,7 +3,7 @@ package outbound_callanalysisresponseset import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" ) diff --git a/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset.go b/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset.go index bc6137047..90744ea1f 100644 --- a/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset.go +++ b/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_test.go b/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_test.go index afebd9631..74cd9f5fd 100644 --- a/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_test.go +++ b/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceOutboundCallAnalysisResponseSet(t *testing.T) { diff --git a/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_utils.go b/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_utils.go index c8355105a..d48a46401 100644 --- a/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_utils.go +++ b/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_utils.go @@ -3,7 +3,7 @@ package outbound_callanalysisresponseset import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "strings" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" ) diff --git a/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_init_test.go b/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_init_test.go index f36ee1489..03bdbd559 100644 --- a/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_init_test.go +++ b/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_init_test.go @@ -16,7 +16,7 @@ import ( telephonyProvidersEdgesSite "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site" "testing" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_proxy.go b/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_proxy.go index 92c47562f..8105cebb3 100644 --- a/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_proxy.go +++ b/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_proxy.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign.go b/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign.go index fa9ce68bc..bdcd48c47 100644 --- a/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign.go +++ b/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_test.go b/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_test.go index 5f6576e97..2ada8f3fa 100644 --- a/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_test.go +++ b/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_test.go @@ -23,7 +23,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // Add a special generator DEVENGAGE-1646. Basically, the API makes it look like you need a full phone_columns field here. However, the API ignores the type because the devs reused the phone_columns object. However, diff --git a/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_utils.go b/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_utils.go index 7bafc268f..6f8fdc95a 100644 --- a/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_utils.go +++ b/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_utils.go @@ -18,7 +18,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_campaignrule/data_source_genesyscloud_outbound_campaignrule.go b/genesyscloud/outbound_campaignrule/data_source_genesyscloud_outbound_campaignrule.go index dfb9710a1..e6694ebb2 100644 --- a/genesyscloud/outbound_campaignrule/data_source_genesyscloud_outbound_campaignrule.go +++ b/genesyscloud/outbound_campaignrule/data_source_genesyscloud_outbound_campaignrule.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceOutboundCampaignruleRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { diff --git a/genesyscloud/outbound_campaignrule/genesyscloud_outbound_campaignrule_proxy.go b/genesyscloud/outbound_campaignrule/genesyscloud_outbound_campaignrule_proxy.go index a7708715f..0af2b5ba4 100644 --- a/genesyscloud/outbound_campaignrule/genesyscloud_outbound_campaignrule_proxy.go +++ b/genesyscloud/outbound_campaignrule/genesyscloud_outbound_campaignrule_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule.go b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule.go index 3dbc518f2..f94ae8fe3 100644 --- a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule.go +++ b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllAuthCampaignRules(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_test.go b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_test.go index 53b6eeab2..2a1726d2f 100644 --- a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_test.go +++ b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceOutboundCampaignRuleBasic(t *testing.T) { diff --git a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_unit_test.go b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_unit_test.go index 8fdae8811..aa5a5196c 100644 --- a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_unit_test.go +++ b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_unit_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/stretchr/testify/assert" ) diff --git a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_utils.go b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_utils.go index 8fb38aba3..0d3240299 100644 --- a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_utils.go +++ b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_utils.go @@ -5,7 +5,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getCampaignruleFromResourceData(d *schema.ResourceData) platformclientv2.Campaignrule { diff --git a/genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contactlist.go b/genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contactlist.go index 21e1ffc39..3c2f58501 100644 --- a/genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contactlist.go +++ b/genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contactlist.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func DataSourceOutboundContactList() *schema.Resource { diff --git a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist.go b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist.go index 51a5daa7c..144afc54a 100644 --- a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist.go +++ b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) const ( @@ -625,3 +625,13 @@ func GeneratePhoneColumnsDataTypeSpecBlock(columnName, columnDataType, min, max, } `, columnName, columnDataType, min, max, maxLength) } + +func GenerateEmailColumnsBlock(columnName, columnType, contactableTimeColumn string) string { + return fmt.Sprintf(` + email_columns { + column_name = "%s" + type = "%s" + contactable_time_column = %s + } +`, columnName, columnType, contactableTimeColumn) +} diff --git a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist_test.go b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist_test.go index 220478123..fd80cce10 100644 --- a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist_test.go +++ b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceOutboundContactListBasic(t *testing.T) { @@ -67,12 +67,12 @@ func TestAccResourceOutboundContactListBasic(t *testing.T) { "home", strconv.Quote("Home"), ), - generateEmailColumnsBlock( + GenerateEmailColumnsBlock( "Work", "work", util.NullValue, ), - generateEmailColumnsBlock( + GenerateEmailColumnsBlock( "Personal", "personal", util.NullValue, @@ -124,12 +124,12 @@ func TestAccResourceOutboundContactListBasic(t *testing.T) { "home", strconv.Quote("Home"), ), - generateEmailColumnsBlock( + GenerateEmailColumnsBlock( "Work", "work", util.NullValue, ), - generateEmailColumnsBlock( + GenerateEmailColumnsBlock( "Personal", "personal", util.NullValue, @@ -182,12 +182,12 @@ func TestAccResourceOutboundContactListBasic(t *testing.T) { "home", strconv.Quote("Home"), ), - generateEmailColumnsBlock( + GenerateEmailColumnsBlock( "Work", "work", util.NullValue, ), - generateEmailColumnsBlock( + GenerateEmailColumnsBlock( "Personal", "personal", util.NullValue, @@ -276,12 +276,12 @@ func TestAccResourceOutboundContactListBasic(t *testing.T) { "home", util.NullValue, ), - generateEmailColumnsBlock( + GenerateEmailColumnsBlock( "Work", "work", strconv.Quote(zipCodeColumnName), ), - generateEmailColumnsBlock( + GenerateEmailColumnsBlock( "Personal", "personal", strconv.Quote(zipCodeColumnName), @@ -342,16 +342,6 @@ func TestAccResourceOutboundContactListBasic(t *testing.T) { }) } -func generateEmailColumnsBlock(columnName, columnType, contactableTimeColumn string) string { - return fmt.Sprintf(` - email_columns { - column_name = "%s" - type = "%s" - contactable_time_column = %s - } -`, columnName, columnType, contactableTimeColumn) -} - func testVerifyContactListDestroyed(state *terraform.State) error { outboundAPI := platformclientv2.NewOutboundApi() for _, rs := range state.RootModule().Resources { diff --git a/genesyscloud/outbound_contact_list_contact/genesyscloud_outbound_contact_list_contact_init_test.go b/genesyscloud/outbound_contact_list_contact/genesyscloud_outbound_contact_list_contact_init_test.go new file mode 100644 index 000000000..e6c0f5694 --- /dev/null +++ b/genesyscloud/outbound_contact_list_contact/genesyscloud_outbound_contact_list_contact_init_test.go @@ -0,0 +1,42 @@ +package outbound_contact_list_contact + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "sync" + outboundContactList "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list" + "testing" +) + +// providerResources holds a map of all registered resources +var providerResources map[string]*schema.Resource + +type registerTestInstance struct { + resourceMapMutex sync.RWMutex +} + +// registerTestResources registers all resources used in the tests +func (r *registerTestInstance) registerTestResources() { + r.resourceMapMutex.Lock() + defer r.resourceMapMutex.Unlock() + + providerResources[resourceName] = ResourceOutboundContactListContact() + providerResources["genesyscloud_outbound_contact_list"] = outboundContactList.ResourceOutboundContactList() +} + +// initTestResources initializes all test resources. +func initTestResources() { + providerResources = make(map[string]*schema.Resource) + + regInstance := ®isterTestInstance{} + + regInstance.registerTestResources() +} + +// TestMain is a "setup" function called by the testing framework when run the test +func TestMain(m *testing.M) { + // Run setup function before starting the test suite for the outbound_contact_list_contact package + initTestResources() + + // Run the test suite for the outbound_contact_list_contact package + m.Run() +} diff --git a/genesyscloud/outbound_contact_list_contact/genesyscloud_outbound_contact_list_contact_proxy.go b/genesyscloud/outbound_contact_list_contact/genesyscloud_outbound_contact_list_contact_proxy.go new file mode 100644 index 000000000..021e5b804 --- /dev/null +++ b/genesyscloud/outbound_contact_list_contact/genesyscloud_outbound_contact_list_contact_proxy.go @@ -0,0 +1,179 @@ +package outbound_contact_list_contact + +import ( + "context" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" +) + +var internalProxy *contactProxy + +type createContactFunc func(ctx context.Context, p *contactProxy, contactListId string, contact platformclientv2.Writabledialercontact, priority, clearSystemData, doNotQueue bool) ([]platformclientv2.Dialercontact, *platformclientv2.APIResponse, error) +type readContactByIdFunc func(ctx context.Context, p *contactProxy, contactListId, contactId string) (*platformclientv2.Dialercontact, *platformclientv2.APIResponse, error) +type updateContactFunc func(ctx context.Context, p *contactProxy, contactListId string, contactId string, contact platformclientv2.Dialercontact) (*platformclientv2.Dialercontact, *platformclientv2.APIResponse, error) +type deleteContactFunc func(ctx context.Context, p *contactProxy, contactListId, contactId string) (*platformclientv2.APIResponse, error) +type getAllContactsFunc func(ctx context.Context, p *contactProxy) ([]platformclientv2.Dialercontact, *platformclientv2.APIResponse, error) + +type contactProxy struct { + clientConfig *platformclientv2.Configuration + outboundApi *platformclientv2.OutboundApi + createContactAttr createContactFunc + readContactByIdAttr readContactByIdFunc + updateContactAttr updateContactFunc + deleteContactAttr deleteContactFunc + getAllContactsAttr getAllContactsFunc + contactCache rc.CacheInterface[platformclientv2.Dialercontact] +} + +func newContactProxy(clientConfig *platformclientv2.Configuration) *contactProxy { + api := platformclientv2.NewOutboundApiWithConfig(clientConfig) + contactCache := rc.NewResourceCache[platformclientv2.Dialercontact]() + return &contactProxy{ + clientConfig: clientConfig, + outboundApi: api, + createContactAttr: createContactFn, + readContactByIdAttr: readContactByIdFn, + updateContactAttr: updateContactFn, + deleteContactAttr: deleteContactFn, + getAllContactsAttr: getAllContactsFn, + contactCache: contactCache, + } +} + +func getContactProxy(clientConfig *platformclientv2.Configuration) *contactProxy { + if internalProxy == nil { + internalProxy = newContactProxy(clientConfig) + } + + return internalProxy +} + +func (p *contactProxy) createContact(ctx context.Context, contactListId string, contact platformclientv2.Writabledialercontact, priority, clearSystemData, doNotQueue bool) ([]platformclientv2.Dialercontact, *platformclientv2.APIResponse, error) { + return p.createContactAttr(ctx, p, contactListId, contact, priority, clearSystemData, doNotQueue) +} + +func (p *contactProxy) readContactById(ctx context.Context, contactListId, contactId string) (*platformclientv2.Dialercontact, *platformclientv2.APIResponse, error) { + return p.readContactByIdAttr(ctx, p, contactListId, contactId) +} + +func (p *contactProxy) updateContact(ctx context.Context, contactListId, contactId string, contact platformclientv2.Dialercontact) (*platformclientv2.Dialercontact, *platformclientv2.APIResponse, error) { + return p.updateContactAttr(ctx, p, contactListId, contactId, contact) +} + +func (p *contactProxy) deleteContact(ctx context.Context, contactListId, contactId string) (*platformclientv2.APIResponse, error) { + return p.deleteContactAttr(ctx, p, contactListId, contactId) +} + +func (p *contactProxy) getAllContacts(ctx context.Context) ([]platformclientv2.Dialercontact, *platformclientv2.APIResponse, error) { + return p.getAllContactsAttr(ctx, p) +} + +func createContactFn(_ context.Context, p *contactProxy, contactListId string, contact platformclientv2.Writabledialercontact, priority, clearSystemData, doNotQueue bool) ([]platformclientv2.Dialercontact, *platformclientv2.APIResponse, error) { + return p.outboundApi.PostOutboundContactlistContacts(contactListId, []platformclientv2.Writabledialercontact{contact}, priority, clearSystemData, doNotQueue) +} + +func readContactByIdFn(_ context.Context, p *contactProxy, contactListId, contactId string) (*platformclientv2.Dialercontact, *platformclientv2.APIResponse, error) { + if contact := rc.GetCacheItem(p.contactCache, contactId); contact != nil { + return contact, nil, nil + } + return p.outboundApi.GetOutboundContactlistContact(contactListId, contactId) +} + +func updateContactFn(_ context.Context, p *contactProxy, contactListId, contactId string, contact platformclientv2.Dialercontact) (*platformclientv2.Dialercontact, *platformclientv2.APIResponse, error) { + return p.outboundApi.PutOutboundContactlistContact(contactListId, contactId, contact) +} + +func deleteContactFn(_ context.Context, p *contactProxy, contactListId, contactId string) (*platformclientv2.APIResponse, error) { + return p.outboundApi.DeleteOutboundContactlistContact(contactListId, contactId) +} + +func getAllContactsFn(ctx context.Context, p *contactProxy) ([]platformclientv2.Dialercontact, *platformclientv2.APIResponse, error) { + var allContacts []platformclientv2.Dialercontact + + contactListIds, resp, err := p.getAllContactListIds(ctx) + if err != nil { + return allContacts, resp, err + } + + for _, contactListId := range contactListIds { + contacts, resp, err := p.getContactsByContactListId(ctx, contactListId) + if err != nil { + return nil, resp, err + } + allContacts = append(allContacts, contacts...) + } + + for _, contact := range allContacts { + rc.SetCache(p.contactCache, *contact.Id, contact) + } + + return allContacts, nil, nil +} + +func (p *contactProxy) getContactsByContactListId(_ context.Context, contactListId string) ([]platformclientv2.Dialercontact, *platformclientv2.APIResponse, error) { + var ( + pageNum = 1 + pageSize = 50 + allContacts []platformclientv2.Dialercontact + ) + + body := platformclientv2.Contactlistingrequest{ + PageNumber: &pageNum, + PageSize: &pageSize, + } + + data, resp, err := p.outboundApi.PostOutboundContactlistContactsSearch(contactListId, body) + if err != nil { + return nil, resp, err + } + if data.Entities == nil || len(*data.Entities) == 0 { + return nil, nil, nil + } + allContacts = append(allContacts, *data.Entities...) + + for pageNum = 2; pageNum <= *data.PageCount; pageNum++ { + body.PageNumber = &pageNum + data, resp, err = p.outboundApi.PostOutboundContactlistContactsSearch(contactListId, body) + if err != nil { + return nil, resp, err + } + if data.Entities == nil || len(*data.Entities) == 0 { + break + } + allContacts = append(allContacts, *data.Entities...) + } + + return allContacts, nil, nil +} + +func (p *contactProxy) getAllContactListIds(_ context.Context) ([]string, *platformclientv2.APIResponse, error) { + const pageSize = 100 + var pageNum = 1 + var allContactListIds []string + + contactListConfigs, resp, getErr := p.outboundApi.GetOutboundContactlists(false, false, pageSize, pageNum, true, "", "", []string{}, []string{}, "", "") + if getErr != nil { + return nil, resp, getErr + } + if contactListConfigs.Entities == nil || len(*contactListConfigs.Entities) == 0 { + return nil, nil, nil + } + for _, cl := range *contactListConfigs.Entities { + allContactListIds = append(allContactListIds, *cl.Id) + } + + for pageNum := 2; pageNum <= *contactListConfigs.PageCount; pageNum++ { + contactListConfigs, resp, getErr := p.outboundApi.GetOutboundContactlists(false, false, pageSize, pageNum, true, "", "", []string{}, []string{}, "", "") + if getErr != nil { + return nil, resp, getErr + } + if contactListConfigs.Entities == nil || len(*contactListConfigs.Entities) == 0 { + break + } + for _, cl := range *contactListConfigs.Entities { + allContactListIds = append(allContactListIds, *cl.Id) + } + } + + return allContactListIds, nil, nil +} diff --git a/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact.go b/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact.go new file mode 100644 index 000000000..d8e4cdab6 --- /dev/null +++ b/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact.go @@ -0,0 +1,153 @@ +package outbound_contact_list_contact + +import ( + "context" + "fmt" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "log" + "terraform-provider-genesyscloud/genesyscloud/consistency_checker" + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + "terraform-provider-genesyscloud/genesyscloud/util" + "terraform-provider-genesyscloud/genesyscloud/util/constants" + "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + "time" +) + +func getAllContacts(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { + resources := make(resourceExporter.ResourceIDMetaMap) + cp := getContactProxy(clientConfig) + + contacts, resp, err := cp.getAllContacts(ctx) + if err != nil { + msg := fmt.Sprintf("Failed to read all contact list contacts. Error: %v", err) + if resp != nil { + return nil, util.BuildAPIDiagnosticError(resourceName, msg, resp) + } + return nil, util.BuildDiagnosticError(resourceName, msg, err) + } + + for _, contact := range contacts { + //id := createCustomContactId(*contact.ContactListId, *contact.Id) + resources[*contact.Id] = &resourceExporter.ResourceMeta{Name: *contact.Id} + } + + return resources, nil +} + +func createOutboundContactListContact(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + cp := getContactProxy(sdkConfig) + + contactListId := d.Get("contact_list_id").(string) + priority := d.Get("priority").(bool) + clearSystemData := d.Get("clear_system_data").(bool) + doNotQueue := d.Get("do_not_queue").(bool) + + contactRequestBody := buildWritableContactFromResourceData(d) + + log.Printf("Creating contact in contact list '%s'", contactListId) + contactResponseBody, resp, err := cp.createContact(ctx, contactListId, contactRequestBody, priority, clearSystemData, doNotQueue) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("failed to create contact '%s' for contact list '%s': %v", *contactRequestBody.Id, contactListId, err), resp) + } + + if len(contactResponseBody) != 1 { + msg := fmt.Sprintf("expected to receive one dialer contact object in contact creation response. Received %v", len(contactResponseBody)) + return util.BuildDiagnosticError(resourceName, msg, fmt.Errorf("%v", msg)) + } + + d.SetId(*contactResponseBody[0].Id) + log.Printf("Finished creating contact '%s' in contact list '%s'", d.Id(), contactListId) + return readOutboundContactListContact(ctx, d, meta) +} + +func readOutboundContactListContact(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics { + var ( + resp *platformclientv2.APIResponse + err error + + sdkConfig = meta.(*provider.ProviderMeta).ClientConfig + cp = getContactProxy(sdkConfig) + + contactListId = d.Get("contact_list_id").(string) + ) + + cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceOutboundContactListContact(), constants.DefaultConsistencyChecks, resourceName) + + retryErr := util.WithRetriesForRead(ctx, d, func() *retry.RetryError { + var contactResponseBody *platformclientv2.Dialercontact + + log.Printf("Reading contact '%s' in contact list '%s'", d.Id(), contactListId) + contactResponseBody, resp, err = cp.readContactById(ctx, contactListId, d.Id()) + if err != nil { + if util.IsStatus404(resp) { + return retry.RetryableError(err) + } + return retry.NonRetryableError(err) + } + + _ = d.Set("contact_list_id", *contactResponseBody.ContactListId) + resourcedata.SetNillableValue(d, "callable", contactResponseBody.Callable) + resourcedata.SetNillableValue(d, "data", contactResponseBody.Data) + resourcedata.SetNillableValueWithSchemaSetWithFunc(d, "phone_number_status", contactResponseBody.PhoneNumberStatus, flattenPhoneNumberStatus) + resourcedata.SetNillableValueWithSchemaSetWithFunc(d, "contactable_status", contactResponseBody.ContactableStatus, flattenContactableStatus) + + return cc.CheckState(d) + }) + if retryErr != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("failed to read contact by ID '%s' from contact list '%s'. Error: %v", d.Id(), contactListId, retryErr), resp) + } + log.Printf("Done reading contact '%s' in contact list '%s'", d.Id(), contactListId) + return nil +} + +func updateOutboundContactListContact(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + cp := getContactProxy(sdkConfig) + + contactRequestBody := buildDialerContactFromResourceData(d) + contactListId := *contactRequestBody.ContactListId + + log.Printf("Updating contact '%s' in contact list '%s'", d.Id(), contactListId) + _, resp, err := cp.updateContact(ctx, contactListId, d.Id(), contactRequestBody) + if err != nil { + msg := fmt.Sprintf("failed to update contact '%s' for contact list '%s'. Error: %v", d.Id(), contactListId, err) + return util.BuildAPIDiagnosticError(resourceName, msg, resp) + } + + log.Printf("Finished updating contact '%s' in contact list '%s'", d.Id(), contactListId) + return readOutboundContactListContact(ctx, d, meta) +} + +func deleteOutboundContactListContact(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + cp := getContactProxy(sdkConfig) + + contactListId := d.Get("contact_list_id").(string) + + log.Printf("Deleting contact '%s' from contact list '%s'", d.Id(), contactListId) + resp, err := cp.deleteContact(ctx, contactListId, d.Id()) + if err != nil { + msg := fmt.Sprintf("failed to delete contact '%s' from contact list '%s'. Error: %v", d.Id(), contactListId, err) + return util.BuildAPIDiagnosticError(resourceName, msg, resp) + } + + return util.WithRetries(ctx, 60*time.Second, func() *retry.RetryError { + log.Printf("Reading contact '%s'", d.Id()) + _, resp, err := cp.readContactById(ctx, contactListId, d.Id()) + if err != nil { + if util.IsStatus404(resp) { + log.Printf("Contact '%s' deleted", d.Id()) + return nil + } + msg := fmt.Sprintf("failed to delete contact '%s'. Error: %v", d.Id(), err) + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, msg, resp)) + } + msg := fmt.Sprintf("contact '%s' still exists in contact list '%s'", d.Id(), contactListId) + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, msg, resp)) + }) +} diff --git a/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_schema.go b/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_schema.go new file mode 100644 index 000000000..445f32893 --- /dev/null +++ b/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_schema.go @@ -0,0 +1,147 @@ +package outbound_contact_list_contact + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" +) + +const resourceName = "genesyscloud_outbound_contact_list_contact" + +func SetRegistrar(regInstance registrar.Registrar) { + regInstance.RegisterResource(resourceName, ResourceOutboundContactListContact()) + regInstance.RegisterExporter(resourceName, ContactExporter()) +} + +var ( + contactableStatusResource = &schema.Resource{ + Schema: map[string]*schema.Schema{ + "media_type": { + Description: `The key which identifies the media type (Voice, SMS and Email).`, + Type: schema.TypeString, + Required: true, + }, + "contactable": { + Description: `Indicates whether or not the entire contact is contactable for the associated media type.`, + Type: schema.TypeBool, + Required: true, + }, + "column_status": { + Description: `A map of individual contact method columns to whether the individual column is contactable for the associated media type.`, + Type: schema.TypeSet, + Optional: true, + Elem: columnStatusResource, + }, + }, + } + columnStatusResource = &schema.Resource{ + Schema: map[string]*schema.Schema{ + "column": { + Description: `The key which identifies the contact method column.`, + Type: schema.TypeString, + Required: true, + }, + "contactable": { + Description: `Indicates whether or not an individual contact method column is contactable.`, + Type: schema.TypeBool, + Required: true, + }, + }, + } + phoneNumberStatusResource = &schema.Resource{ + Schema: map[string]*schema.Schema{ + "key": { + Description: `Phone number column identifier.`, + Type: schema.TypeString, + Required: true, + }, + "callable": { + Description: `Indicates whether or not a phone number is callable.`, + Type: schema.TypeBool, + Required: true, + }, + }, + } +) + +func ContactExporter() *resourceExporter.ResourceExporter { + return &resourceExporter.ResourceExporter{ + GetResourcesFunc: provider.GetAllWithPooledClient(getAllContacts), + RefAttrs: map[string]*resourceExporter.RefAttrSettings{ + "contact_list_id": {RefType: "genesyscloud_outbound_contact_list"}, + }, + AllowZeroValuesInMap: []string{"data"}, + } +} + +func ResourceOutboundContactListContact() *schema.Resource { + return &schema.Resource{ + Description: `Genesys Cloud Outbound Contact List Contact`, + + CreateContext: provider.CreateWithPooledClient(createOutboundContactListContact), + ReadContext: provider.ReadWithPooledClient(readOutboundContactListContact), + UpdateContext: provider.UpdateWithPooledClient(updateOutboundContactListContact), + DeleteContext: provider.DeleteWithPooledClient(deleteOutboundContactListContact), + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + SchemaVersion: 1, + Schema: map[string]*schema.Schema{ + "contact_list_id": { + Description: `The identifier of the contact list containing this contact.`, + ForceNew: true, + Required: true, + Type: schema.TypeString, + }, + "priority": { + Description: `Contact priority. True means the contact(s) will be dialed next; false means the contact will go to the end of the contact queue. +Only applicable on the creation of a contact, so updating this field will force the contact to be deleted from the contact list and re-uploaded.`, + ForceNew: true, + Optional: true, + Type: schema.TypeBool, + }, + "clear_system_data": { + Description: `Clear system data. True means the system columns (attempts, callable status, etc) stored on the contact will be cleared if the contact already exists; false means they won't. +Only applicable on the creation of a contact, so updating this field will force the contact to be deleted from the contact list and re-uploaded.`, + ForceNew: true, + Optional: true, + Type: schema.TypeBool, + }, + "do_not_queue": { + Description: `Do not queue. True means that updated contacts will not have their positions in the queue altered, so contacts that have already been dialed will not be redialed. +For new contacts, this parameter has no effect; False means that updated contacts will be re-queued, according to the 'priority' parameter. +Only applicable on the creation of a contact, so updating this field will force the contact to be deleted from the contact list and re-uploaded.`, + ForceNew: true, + Optional: true, + Type: schema.TypeBool, + }, + "callable": { + Description: `Indicates whether or not the contact can be called.`, + Type: schema.TypeBool, + Default: false, + Optional: true, + }, + "data": { + Description: `An ordered map of the contact's columns and corresponding values.`, + Type: schema.TypeMap, + Required: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "phone_number_status": { + Description: `A map of phone number columns to PhoneNumberStatuses, which indicate if the phone number is callable or not.`, + Type: schema.TypeSet, + Optional: true, + ForceNew: true, + Elem: phoneNumberStatusResource, + }, + "contactable_status": { + Description: `A map of media types (Voice, SMS and Email) to ContactableStatus, which indicates if the contact can be contacted using the specified media type.`, + Type: schema.TypeSet, + Optional: true, + ForceNew: true, + Elem: contactableStatusResource, + }, + }, + } +} diff --git a/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_test.go b/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_test.go new file mode 100644 index 000000000..4a923fc7c --- /dev/null +++ b/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_test.go @@ -0,0 +1,176 @@ +package outbound_contact_list_contact + +import ( + "fmt" + "github.com/google/uuid" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "strconv" + outboundContactList "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list" + "terraform-provider-genesyscloud/genesyscloud/provider" + "terraform-provider-genesyscloud/genesyscloud/util" + "testing" +) + +func TestAccResourceOutboundContactListContact(t *testing.T) { + var ( + resourceId = "contact" + fullResourceId = fmt.Sprintf("%s.%s", resourceName, resourceId) + + cellColumnKey = "Cell" + dataCellValue = "+000000" + dataCellValueUpdated = "+111111" + + homeColumnKey = "Home" + dataHomeValue = "+22222222" + dataHomeValueUpdated = "+33333333" + + emailColumnKey = "Email" + dataEmailValue = "email@fake.com" + dataEmailValueUpdated = "fake@email.cmo" + + contactListResourceId = "contact_list" + contactListFullResourceId = "genesyscloud_outbound_contact_list." + contactListResourceId + contactListName = "tf test contact list " + uuid.NewString() + columnNames = []string{ + strconv.Quote(cellColumnKey), + strconv.Quote(homeColumnKey), + strconv.Quote(emailColumnKey), + } + ) + + const ( + emailMediaType = "Email" + voiceMediaType = "Voice" + ) + + contactListResource := outboundContactList.GenerateOutboundContactList( + contactListResourceId, + contactListName, + util.NullValue, + strconv.Quote(cellColumnKey), + []string{strconv.Quote(cellColumnKey)}, + columnNames, + util.FalseValue, + util.NullValue, + util.NullValue, + outboundContactList.GenerateEmailColumnsBlock( + emailColumnKey, + "work", + util.NullValue, + ), + outboundContactList.GeneratePhoneColumnsBlock( + cellColumnKey, + "cell", + strconv.Quote(cellColumnKey), + ), + outboundContactList.GeneratePhoneColumnsBlock( + homeColumnKey, + "home", + strconv.Quote(cellColumnKey), + ), + ) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { util.TestAccPreCheck(t) }, + ProviderFactories: provider.GetProviderFactories(providerResources, nil), + Steps: []resource.TestStep{ + { + Config: contactListResource + GenerateOutboundContactListContact( + resourceId, + contactListFullResourceId+".id", + util.TrueValue, + util.GenerateMapAttrWithMapProperties( + "data", + map[string]string{ + cellColumnKey: strconv.Quote(dataCellValue), + homeColumnKey: strconv.Quote(dataHomeValue), + emailColumnKey: strconv.Quote(dataEmailValue), + }, + ), + GeneratePhoneNumberStatus(cellColumnKey, util.FalseValue), + GeneratePhoneNumberStatus(homeColumnKey, util.TrueValue), + GenerateContactableStatus( + voiceMediaType, + util.FalseValue, // contactable + GenerateColumnStatus(cellColumnKey, util.FalseValue), + ), + GenerateContactableStatus( + emailMediaType, + util.TrueValue, // contactable + GenerateColumnStatus(emailColumnKey, util.TrueValue), + ), + ), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(fullResourceId, "callable", util.TrueValue), + resource.TestCheckResourceAttrPair(fullResourceId, "contact_list_id", contactListFullResourceId, "id"), + resource.TestCheckResourceAttr(fullResourceId, "data."+cellColumnKey, dataCellValue), + resource.TestCheckResourceAttr(fullResourceId, "data."+homeColumnKey, dataHomeValue), + resource.TestCheckResourceAttr(fullResourceId, "data."+emailColumnKey, dataEmailValue), + resource.TestCheckResourceAttr(fullResourceId, "phone_number_status.#", "2"), + resource.TestCheckResourceAttr(fullResourceId, "phone_number_status.0.key", cellColumnKey), + resource.TestCheckResourceAttr(fullResourceId, "phone_number_status.0.callable", util.FalseValue), + resource.TestCheckResourceAttr(fullResourceId, "phone_number_status.1.key", homeColumnKey), + resource.TestCheckResourceAttr(fullResourceId, "phone_number_status.1.callable", util.TrueValue), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.#", "2"), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.0.media_type", voiceMediaType), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.0.contactable", util.FalseValue), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.0.column_status.0.column", cellColumnKey), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.0.column_status.0.contactable", util.FalseValue), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.1.media_type", emailMediaType), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.1.contactable", util.TrueValue), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.1.column_status.0.column", emailColumnKey), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.1.column_status.0.contactable", util.TrueValue), + ), + }, + { + // Update + Config: contactListResource + GenerateOutboundContactListContact( + resourceId, + contactListFullResourceId+".id", + util.FalseValue, + util.GenerateMapAttrWithMapProperties( + "data", + map[string]string{ + cellColumnKey: strconv.Quote(dataCellValueUpdated), + homeColumnKey: strconv.Quote(dataHomeValueUpdated), + emailColumnKey: strconv.Quote(dataEmailValueUpdated), + }, + ), + GeneratePhoneNumberStatus(cellColumnKey, util.FalseValue), + GeneratePhoneNumberStatus(homeColumnKey, util.TrueValue), + GenerateContactableStatus( + voiceMediaType, + util.FalseValue, // contactable + GenerateColumnStatus(cellColumnKey, util.FalseValue), + ), + GenerateContactableStatus( + emailMediaType, + util.TrueValue, // contactable + GenerateColumnStatus(emailColumnKey, util.TrueValue), + ), + ), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(fullResourceId, "callable", util.FalseValue), + resource.TestCheckResourceAttrPair(fullResourceId, "contact_list_id", contactListFullResourceId, "id"), + resource.TestCheckResourceAttr(fullResourceId, "data."+cellColumnKey, dataCellValueUpdated), + resource.TestCheckResourceAttr(fullResourceId, "data."+homeColumnKey, dataHomeValueUpdated), + resource.TestCheckResourceAttr(fullResourceId, "data."+emailColumnKey, dataEmailValueUpdated), + resource.TestCheckResourceAttr(fullResourceId, "phone_number_status.#", "2"), + resource.TestCheckResourceAttr(fullResourceId, "phone_number_status.0.key", cellColumnKey), + resource.TestCheckResourceAttr(fullResourceId, "phone_number_status.0.callable", util.FalseValue), + resource.TestCheckResourceAttr(fullResourceId, "phone_number_status.1.key", homeColumnKey), + resource.TestCheckResourceAttr(fullResourceId, "phone_number_status.1.callable", util.TrueValue), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.#", "2"), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.0.media_type", voiceMediaType), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.0.contactable", util.FalseValue), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.0.column_status.0.column", cellColumnKey), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.0.column_status.0.contactable", util.FalseValue), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.1.media_type", emailMediaType), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.1.contactable", util.TrueValue), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.1.column_status.0.column", emailColumnKey), + resource.TestCheckResourceAttr(fullResourceId, "contactable_status.1.column_status.0.contactable", util.TrueValue), + ), + }, + }, + }) +} diff --git a/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_utils.go b/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_utils.go new file mode 100644 index 000000000..797624746 --- /dev/null +++ b/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_utils.go @@ -0,0 +1,182 @@ +package outbound_contact_list_contact + +import ( + "fmt" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "strings" + utillists "terraform-provider-genesyscloud/genesyscloud/util/lists" + "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" +) + +// buildWritableContactFromResourceData used to build the request body for contact creation +func buildWritableContactFromResourceData(d *schema.ResourceData) platformclientv2.Writabledialercontact { + contactListId := d.Get("contact_list_id").(string) + callable := d.Get("callable").(bool) + + var contactRequest = platformclientv2.Writabledialercontact{ + ContactListId: &contactListId, + Callable: &callable, + } + + if dataMap, ok := d.Get("data").(map[string]any); ok { + stringMap := utillists.ConvertMapStringAnyToMapStringString(dataMap) + contactRequest.Data = &stringMap + } + + contactRequest.PhoneNumberStatus = buildPhoneNumberStatus(d) + contactRequest.ContactableStatus = buildContactableStatus(d) + return contactRequest +} + +// buildDialerContactFromResourceData used to build the request body for contact updates +func buildDialerContactFromResourceData(d *schema.ResourceData) platformclientv2.Dialercontact { + contactListId := d.Get("contact_list_id").(string) + callable := d.Get("callable").(bool) + var contactRequest = platformclientv2.Dialercontact{ + ContactListId: &contactListId, + Callable: &callable, + } + if dataMap, ok := d.Get("data").(map[string]any); ok { + stringMap := utillists.ConvertMapStringAnyToMapStringString(dataMap) + contactRequest.Data = &stringMap + } + contactRequest.PhoneNumberStatus = buildPhoneNumberStatus(d) + contactRequest.ContactableStatus = buildContactableStatus(d) + return contactRequest +} + +func buildContactableStatus(d *schema.ResourceData) *map[string]platformclientv2.Contactablestatus { + contactableStatus, ok := d.Get("contactable_status").(*schema.Set) + if !ok { + return nil + } + + contactableStatusMap := make(map[string]platformclientv2.Contactablestatus) + + contactableStatusList := contactableStatus.List() + for _, status := range contactableStatusList { + currentStatusMap := status.(map[string]any) + mediaType := currentStatusMap["media_type"].(string) + contactable := currentStatusMap["contactable"].(bool) + + columnStatusMap := make(map[string]platformclientv2.Columnstatus) + if columnStatus, ok := currentStatusMap["column_status"].(*schema.Set); ok { + columnStatusList := columnStatus.List() + for _, status := range columnStatusList { + currentColumnStatusMap := status.(map[string]any) + column := currentColumnStatusMap["column"].(string) + columnContactable := currentColumnStatusMap["contactable"].(bool) + columnStatusMap[column] = platformclientv2.Columnstatus{ + Contactable: &columnContactable, + } + } + } + contactableStatusMap[mediaType] = platformclientv2.Contactablestatus{ + Contactable: &contactable, + ColumnStatus: &columnStatusMap, + } + } + + return &contactableStatusMap +} + +func buildPhoneNumberStatus(d *schema.ResourceData) *map[string]platformclientv2.Phonenumberstatus { + phoneNumberStatus, ok := d.Get("phone_number_status").(*schema.Set) + if !ok { + return nil + } + + phoneNumberStatusMap := make(map[string]platformclientv2.Phonenumberstatus) + + phoneNumberStatusList := phoneNumberStatus.List() + for _, status := range phoneNumberStatusList { + statusMap := status.(map[string]any) + key := statusMap["key"].(string) + callable, _ := statusMap["callable"].(bool) + phoneNumberStatusMap[key] = platformclientv2.Phonenumberstatus{ + Callable: &callable, + } + } + + return &phoneNumberStatusMap +} + +func flattenPhoneNumberStatus(phoneNumberStatus *map[string]platformclientv2.Phonenumberstatus) *schema.Set { + pnsSet := schema.NewSet(schema.HashResource(phoneNumberStatusResource), []interface{}{}) + for k, v := range *phoneNumberStatus { + pns := make(map[string]any) + pns["key"] = k + resourcedata.SetMapValueIfNotNil(pns, "callable", v.Callable) + pnsSet.Add(pns) + } + return pnsSet +} + +func flattenContactableStatus(contactableStatus *map[string]platformclientv2.Contactablestatus) *schema.Set { + csSet := schema.NewSet(schema.HashResource(contactableStatusResource), []interface{}{}) + for k, v := range *contactableStatus { + cs := make(map[string]any) + cs["media_type"] = k + cs["contactable"] = *v.Contactable + if v.ColumnStatus != nil { + cs["column_status"] = flattenColumnStatus(v.ColumnStatus) + } + csSet.Add(cs) + } + return csSet +} + +func flattenColumnStatus(columnStatus *map[string]platformclientv2.Columnstatus) *schema.Set { + if columnStatus == nil { + return nil + } + csSet := schema.NewSet(schema.HashResource(columnStatusResource), []interface{}{}) + for k, v := range *columnStatus { + cs := make(map[string]any) + cs["column"] = k + cs["contactable"] = *v.Contactable + csSet.Add(cs) + } + return csSet +} + +func GenerateOutboundContactListContact( + resourceId, + contactListId, + callable, + data string, + nestedBlocks ...string, +) string { + return fmt.Sprintf(`resource "%s" "%s" { + contact_list_id = %s + callable = %s + %s + %s +}`, resourceName, resourceId, contactListId, callable, data, strings.Join(nestedBlocks, "\n")) +} + +func GeneratePhoneNumberStatus(key, callable string) string { + return fmt.Sprintf(` + phone_number_status { + key = "%s" + callable = %s + }`, key, callable) +} + +func GenerateContactableStatus(mediaType, contactable string, nestedBlocks ...string) string { + return fmt.Sprintf(` + contactable_status { + media_type = "%s" + contactable = %s + %s + }`, mediaType, contactable, strings.Join(nestedBlocks, "\n")) +} + +func GenerateColumnStatus(column, contactable string) string { + return fmt.Sprintf(` + column_status { + column = "%s" + contactable = %s + }`, column, contactable) +} diff --git a/genesyscloud/outbound_contactlistfilter/genesyscloud_outbound_contactlistfilter_proxy.go b/genesyscloud/outbound_contactlistfilter/genesyscloud_outbound_contactlistfilter_proxy.go index c5162898d..b1e9651bb 100644 --- a/genesyscloud/outbound_contactlistfilter/genesyscloud_outbound_contactlistfilter_proxy.go +++ b/genesyscloud/outbound_contactlistfilter/genesyscloud_outbound_contactlistfilter_proxy.go @@ -3,7 +3,7 @@ package outbound_contactlistfilter import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" ) diff --git a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter.go b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter.go index 3949e2513..135ed9a44 100644 --- a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter.go +++ b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_test.go b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_test.go index f290bba27..385842ec2 100644 --- a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_test.go +++ b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceOutboundContactListFilter(t *testing.T) { diff --git a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_utils.go b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_utils.go index 72deee21a..ae8aa6042 100644 --- a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_utils.go +++ b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_utils.go @@ -3,7 +3,7 @@ package outbound_contactlistfilter import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "strings" "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" diff --git a/genesyscloud/outbound_dnclist/genesyscloud_outbound_dnclist_proxy.go b/genesyscloud/outbound_dnclist/genesyscloud_outbound_dnclist_proxy.go index f81b77b47..dc051f755 100644 --- a/genesyscloud/outbound_dnclist/genesyscloud_outbound_dnclist_proxy.go +++ b/genesyscloud/outbound_dnclist/genesyscloud_outbound_dnclist_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/util" ) diff --git a/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist.go b/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist.go index f52c9c23d..5a98e1aa7 100644 --- a/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist.go +++ b/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllOutboundDncLists(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_schema.go b/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_schema.go index 85bf567c2..c44abd1c7 100644 --- a/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_schema.go +++ b/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_schema.go @@ -6,7 +6,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" ) const resourceName = "genesyscloud_outbound_dnclist" @@ -90,7 +90,7 @@ func ResourceOutboundDncList() *schema.Resource { Description: `Expiration date for DNC phone numbers in yyyy-MM-ddTHH:mmZ format.`, Optional: true, Type: schema.TypeString, - ValidateDiagFunc: gcloud.ValidateDateTime, + ValidateDiagFunc: validators.ValidateDateTime, }, `phone_numbers`: { Description: `Phone numbers to add to a DNC list. Only possible if the dncSourceType is rds. Phone numbers must be in an E.164 number format.`, @@ -98,7 +98,7 @@ func ResourceOutboundDncList() *schema.Resource { Type: schema.TypeList, Elem: &schema.Schema{ Type: schema.TypeString, - ValidateDiagFunc: gcloud.ValidatePhoneNumber, + ValidateDiagFunc: validators.ValidatePhoneNumber, }, }, }, diff --git a/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_test.go b/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_test.go index aa68d31e3..1eed72464 100644 --- a/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_test.go +++ b/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) const NullValue = "null" diff --git a/genesyscloud/outbound_filespecificationtemplate/genesyscloud_outbound_filespecificationtemplate_proxy.go b/genesyscloud/outbound_filespecificationtemplate/genesyscloud_outbound_filespecificationtemplate_proxy.go index 8c313f6c5..189cc266b 100644 --- a/genesyscloud/outbound_filespecificationtemplate/genesyscloud_outbound_filespecificationtemplate_proxy.go +++ b/genesyscloud/outbound_filespecificationtemplate/genesyscloud_outbound_filespecificationtemplate_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate.go b/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate.go index 6e24fed69..8aaed672a 100644 --- a/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate.go +++ b/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllFileSpecificationTemplates(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_test.go b/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_test.go index e4b4679d5..7e272fa62 100644 --- a/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_test.go +++ b/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceOutboundFileSpecificationTemplate(t *testing.T) { diff --git a/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_utils.go b/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_utils.go index 23e9742bb..f765fa485 100644 --- a/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_utils.go +++ b/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_utils.go @@ -2,7 +2,7 @@ package outbound_filespecificationtemplate import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" ) diff --git a/genesyscloud/outbound_ruleset/genesyscloud_outbound_ruleset_proxy.go b/genesyscloud/outbound_ruleset/genesyscloud_outbound_ruleset_proxy.go index 24fb87044..5e12b64ee 100644 --- a/genesyscloud/outbound_ruleset/genesyscloud_outbound_ruleset_proxy.go +++ b/genesyscloud/outbound_ruleset/genesyscloud_outbound_ruleset_proxy.go @@ -6,7 +6,7 @@ import ( "log" "strings" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset.go b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset.go index ecac64ea6..37cfa4574 100644 --- a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset.go +++ b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_test.go b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_test.go index 18a4b4b31..d25b21570 100644 --- a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_test.go +++ b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" obContactList "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list" ) diff --git a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_unit_test.go b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_unit_test.go index 29f9c322d..d39433a83 100644 --- a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_unit_test.go +++ b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_unit_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestUnitDoesRuleConditionsRefDeletedSkill(t *testing.T) { diff --git a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_utils.go b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_utils.go index d97906f4e..6266b7a65 100644 --- a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_utils.go +++ b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_utils.go @@ -9,7 +9,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_init_test.go b/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_init_test.go index 9a1442ada..35029a3e7 100644 --- a/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_init_test.go +++ b/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_init_test.go @@ -12,7 +12,7 @@ import ( edgeSite "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site" "testing" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_proxy.go b/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_proxy.go index 18068343a..85532bf50 100644 --- a/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_proxy.go +++ b/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence.go b/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence.go index d664c7f70..5bb9e88d7 100644 --- a/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence.go +++ b/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_test.go b/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_test.go index 641cebf91..3740a0da7 100644 --- a/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_test.go +++ b/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceOutboundSequence(t *testing.T) { diff --git a/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_utils.go b/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_utils.go index d6bd708b2..3040db3dc 100644 --- a/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_utils.go +++ b/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_utils.go @@ -6,7 +6,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_settings/genesyscloud_outbound_settings_proxy.go b/genesyscloud/outbound_settings/genesyscloud_outbound_settings_proxy.go index 7b61cb047..1c30b0a12 100644 --- a/genesyscloud/outbound_settings/genesyscloud_outbound_settings_proxy.go +++ b/genesyscloud/outbound_settings/genesyscloud_outbound_settings_proxy.go @@ -3,7 +3,7 @@ package outbound_settings import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings.go b/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings.go index c3e08b656..0febb5174 100644 --- a/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings.go +++ b/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings_schema.go b/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings_schema.go index 89853a623..e013606ec 100644 --- a/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings_schema.go +++ b/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings_schema.go @@ -6,7 +6,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" ) /* @@ -67,13 +67,13 @@ var ( `earliest_callable_time`: { Description: "The earliest time to dial a contact. Valid format is HH:mm", Optional: true, - ValidateDiagFunc: gcloud.ValidateTimeHHMM, + ValidateDiagFunc: validators.ValidateTimeHHMM, Type: schema.TypeString, }, `latest_callable_time`: { Description: "The latest time to dial a contact. Valid format is HH:mm.", Optional: true, - ValidateDiagFunc: gcloud.ValidateTimeHHMM, + ValidateDiagFunc: validators.ValidateTimeHHMM, Type: schema.TypeString, }, }, @@ -83,13 +83,13 @@ var ( `earliest_callable_time`: { Description: "The earliest time to dial a contact. Valid format is HH:mm.", Optional: true, - ValidateDiagFunc: gcloud.ValidateTimeHHMM, + ValidateDiagFunc: validators.ValidateTimeHHMM, Type: schema.TypeString, }, `latest_callable_time`: { Description: "The latest time to dial a contact. Valid format is HH:mm.", Optional: true, - ValidateDiagFunc: gcloud.ValidateTimeHHMM, + ValidateDiagFunc: validators.ValidateTimeHHMM, Type: schema.TypeString, }, `time_zone_id`: { diff --git a/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings_utils.go b/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings_utils.go index 3a277589a..06c3989a6 100644 --- a/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings_utils.go +++ b/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings_utils.go @@ -2,7 +2,7 @@ package outbound_settings import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/tfexporter_state" "terraform-provider-genesyscloud/genesyscloud/util/lists" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" diff --git a/genesyscloud/outbound_wrapupcode_mappings/genesyscloud_wrapupcode_mappings_proxy.go b/genesyscloud/outbound_wrapupcode_mappings/genesyscloud_wrapupcode_mappings_proxy.go index 81986c753..16e688455 100644 --- a/genesyscloud/outbound_wrapupcode_mappings/genesyscloud_wrapupcode_mappings_proxy.go +++ b/genesyscloud/outbound_wrapupcode_mappings/genesyscloud_wrapupcode_mappings_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var internalProxy *outboundWrapupCodeMappingsProxy diff --git a/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcode_mappings_utils.go b/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcode_mappings_utils.go index 4140f32af..1785d9808 100644 --- a/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcode_mappings_utils.go +++ b/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcode_mappings_utils.go @@ -4,7 +4,7 @@ import ( lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // flattenOutboundWrapupCodeMappings maps a Genesys Cloud Wrapupcodemapping to a schema.Set diff --git a/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcodemappings.go b/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcodemappings.go index 97d6d62b5..cccca5eb1 100644 --- a/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcodemappings.go +++ b/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcodemappings.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // getOutboundWrapupCodeMappings is used by the exporter to return all wrapupcode mappings diff --git a/genesyscloud/process_automation_trigger/data_source_genesyscloud_processautomation_trigger.go b/genesyscloud/process_automation_trigger/data_source_genesyscloud_processautomation_trigger.go index 389f39a84..0a8ee565b 100644 --- a/genesyscloud/process_automation_trigger/data_source_genesyscloud_processautomation_trigger.go +++ b/genesyscloud/process_automation_trigger/data_source_genesyscloud_processautomation_trigger.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type ProcessAutomationTriggers struct { diff --git a/genesyscloud/process_automation_trigger/process_automation_triggers_proxy.go b/genesyscloud/process_automation_trigger/process_automation_triggers_proxy.go index 8bf04955e..3f6b07371 100644 --- a/genesyscloud/process_automation_trigger/process_automation_triggers_proxy.go +++ b/genesyscloud/process_automation_trigger/process_automation_triggers_proxy.go @@ -11,7 +11,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func postProcessAutomationTrigger(pat *ProcessAutomationTrigger, api *platformclientv2.IntegrationsApi) (*ProcessAutomationTrigger, *platformclientv2.APIResponse, error) { diff --git a/genesyscloud/process_automation_trigger/process_automations_triggers_struct.go b/genesyscloud/process_automation_trigger/process_automations_triggers_struct.go index 8da8c63f1..539b80dfd 100644 --- a/genesyscloud/process_automation_trigger/process_automations_triggers_struct.go +++ b/genesyscloud/process_automation_trigger/process_automations_triggers_struct.go @@ -3,7 +3,7 @@ package process_automation_trigger import ( "encoding/json" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type ProcessAutomationTrigger struct { diff --git a/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger.go b/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger.go index 440ce5d31..b6878f8a7 100644 --- a/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger.go +++ b/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger.go @@ -12,7 +12,7 @@ import ( "time" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger_test.go b/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger_test.go index fb52c29d8..e2905376f 100644 --- a/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger_test.go +++ b/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceProcessAutomationTrigger(t *testing.T) { diff --git a/genesyscloud/provider/division.go b/genesyscloud/provider/division.go index 5af549cd9..9fefad4a8 100644 --- a/genesyscloud/provider/division.go +++ b/genesyscloud/provider/division.go @@ -2,7 +2,7 @@ package provider import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "sync" ) diff --git a/genesyscloud/provider/provider.go b/genesyscloud/provider/provider.go index fc81e413b..346a29ffb 100644 --- a/genesyscloud/provider/provider.go +++ b/genesyscloud/provider/provider.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func init() { diff --git a/genesyscloud/provider/sdk_client_pool.go b/genesyscloud/provider/sdk_client_pool.go index 9b35c831a..0123f541c 100644 --- a/genesyscloud/provider/sdk_client_pool.go +++ b/genesyscloud/provider/sdk_client_pool.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // SDKClientPool holds a Pool of client configs for the Genesys Cloud SDK. One should be diff --git a/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_init_test.go b/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_init_test.go index aed83d2de..35700f2f1 100644 --- a/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_init_test.go +++ b/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_init_test.go @@ -14,7 +14,7 @@ import ( "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_proxy.go b/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_proxy.go index a5bfe82fa..345294b53 100644 --- a/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_proxy.go +++ b/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_proxy.go @@ -4,9 +4,10 @@ import ( "context" "encoding/json" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" "net/http" "net/url" + + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy.go b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy.go index 53249f037..fc0777536 100644 --- a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy.go +++ b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_test.go b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_test.go index fe42d0576..0c1b4c0a8 100644 --- a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_test.go +++ b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_test.go @@ -22,7 +22,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_utils.go b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_utils.go index 8df77ba79..62037798c 100644 --- a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_utils.go +++ b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_utils.go @@ -10,7 +10,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/resource_cache/datasource_cache.go b/genesyscloud/resource_cache/datasource_cache.go index e430e8731..20559e103 100644 --- a/genesyscloud/resource_cache/datasource_cache.go +++ b/genesyscloud/resource_cache/datasource_cache.go @@ -8,7 +8,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // Cache for Data Sources diff --git a/genesyscloud/resource_exporter/resource_exporter.go b/genesyscloud/resource_exporter/resource_exporter.go index 3bf86c666..81d28fbd1 100644 --- a/genesyscloud/resource_exporter/resource_exporter.go +++ b/genesyscloud/resource_exporter/resource_exporter.go @@ -5,7 +5,7 @@ import ( "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "regexp" "strings" "sync" @@ -103,6 +103,10 @@ type ResourceExporter struct { // By default zero values are removed from the config due to lack of "null" support in the plugin SDK AllowZeroValues []string + // AllowZeroValuesInMap is a list of attributes that are maps. Adding a map attribute to this list indicates to + // the exporter that the values within said map should not be cleaned up if they are zero values + AllowZeroValuesInMap []string + // AllowEmptyArrays is a list of List attributes that should allow empty arrays in export. // By default, empty arrays are removed but some array attributes may be required in the schema // or depending on the API behavior better presented explicitly in the API as empty arrays. @@ -195,6 +199,10 @@ func (r *ResourceExporter) AllowForZeroValues(attribute string) bool { return lists.ItemInSlice(attribute, r.AllowZeroValues) } +func (r *ResourceExporter) AllowForZeroValuesInMap(attribute string) bool { + return lists.ItemInSlice(attribute, r.AllowZeroValuesInMap) +} + func (r *ResourceExporter) AllowForEmptyArrays(attribute string) bool { return lists.ItemInSlice(attribute, r.AllowEmptyArrays) } diff --git a/genesyscloud/resource_exporter/resource_exporter_custom.go b/genesyscloud/resource_exporter/resource_exporter_custom.go index a017efc15..70c976f12 100644 --- a/genesyscloud/resource_exporter/resource_exporter_custom.go +++ b/genesyscloud/resource_exporter/resource_exporter_custom.go @@ -3,7 +3,7 @@ package resource_exporter import ( "encoding/json" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "regexp" "strings" @@ -139,7 +139,8 @@ This customer custom router will look at the skills array if present and resolve func RuleSetSkillPropertyResolver(configMap map[string]interface{}, exporters map[string]*ResourceExporter, resourceName string) error { if exporter, ok := exporters["genesyscloud_routing_skill"]; ok { - skillIDs := configMap["skills"].(string) + + skillIDs, _ := configMap["skills"].(string) if len(skillIDs) == 0 { return nil @@ -192,7 +193,8 @@ func CampaignStatusResolver(configMap map[string]interface{}, exporters map[stri } func ReplyEmailAddressSelfReferenceRouteExporterResolver(configMap map[string]interface{}, exporters map[string]*ResourceExporter, resourceName string) error { - routeId := configMap["route_id"].(string) + + routeId, _ := configMap["route_id"].(string) currentRouteReference := fmt.Sprintf("${genesyscloud_routing_email_route.%s.id}", resourceName) if routeId == currentRouteReference { configMap["self_reference_route"] = true diff --git a/genesyscloud/resource_genesyscloud_architect_schedules.go b/genesyscloud/resource_genesyscloud_architect_schedules.go index 2b8184874..e8feb700c 100644 --- a/genesyscloud/resource_genesyscloud_architect_schedules.go +++ b/genesyscloud/resource_genesyscloud_architect_schedules.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/leekchan/timeutil" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllArchitectSchedules(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_auth_division.go b/genesyscloud/resource_genesyscloud_auth_division.go index 7c0fe5745..557ba05d2 100644 --- a/genesyscloud/resource_genesyscloud_auth_division.go +++ b/genesyscloud/resource_genesyscloud_auth_division.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllAuthDivisions(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_auth_division_test.go b/genesyscloud/resource_genesyscloud_auth_division_test.go index 033097f4c..cebf83c42 100644 --- a/genesyscloud/resource_genesyscloud_auth_division_test.go +++ b/genesyscloud/resource_genesyscloud_auth_division_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceAuthDivisionBasic(t *testing.T) { @@ -30,6 +30,9 @@ func TestAccResourceAuthDivisionBasic(t *testing.T) { ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), Steps: []resource.TestStep{ { + PreConfig: func() { + time.Sleep(30 * time.Second) + }, // Create Config: GenerateAuthDivisionResource( divResource1, diff --git a/genesyscloud/resource_genesyscloud_idp_generic.go b/genesyscloud/resource_genesyscloud_idp_generic.go index e56c62d0f..8db0dad77 100644 --- a/genesyscloud/resource_genesyscloud_idp_generic.go +++ b/genesyscloud/resource_genesyscloud_idp_generic.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllIdpGeneric(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_idp_generic_test.go b/genesyscloud/resource_genesyscloud_idp_generic_test.go index a78c79e70..6043d440d 100644 --- a/genesyscloud/resource_genesyscloud_idp_generic_test.go +++ b/genesyscloud/resource_genesyscloud_idp_generic_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceIdpGeneric(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_idp_gsuite.go b/genesyscloud/resource_genesyscloud_idp_gsuite.go index 007c6b272..75a412cdc 100644 --- a/genesyscloud/resource_genesyscloud_idp_gsuite.go +++ b/genesyscloud/resource_genesyscloud_idp_gsuite.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllIdpGsuite(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_idp_gsuite_test.go b/genesyscloud/resource_genesyscloud_idp_gsuite_test.go index 3878a5764..38e02fab6 100644 --- a/genesyscloud/resource_genesyscloud_idp_gsuite_test.go +++ b/genesyscloud/resource_genesyscloud_idp_gsuite_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceIdpGsuite(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_idp_onelogin.go b/genesyscloud/resource_genesyscloud_idp_onelogin.go index 08a92192f..8191969da 100644 --- a/genesyscloud/resource_genesyscloud_idp_onelogin.go +++ b/genesyscloud/resource_genesyscloud_idp_onelogin.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllIdpOnelogin(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_idp_onelogin_test.go b/genesyscloud/resource_genesyscloud_idp_onelogin_test.go index 023d7df55..fcd55469b 100644 --- a/genesyscloud/resource_genesyscloud_idp_onelogin_test.go +++ b/genesyscloud/resource_genesyscloud_idp_onelogin_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceIdpOnelogin(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_idp_ping.go b/genesyscloud/resource_genesyscloud_idp_ping.go index 64a5140a1..5be98daf0 100644 --- a/genesyscloud/resource_genesyscloud_idp_ping.go +++ b/genesyscloud/resource_genesyscloud_idp_ping.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllIdpPing(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_idp_ping_test.go b/genesyscloud/resource_genesyscloud_idp_ping_test.go index d87e59944..1211c8230 100644 --- a/genesyscloud/resource_genesyscloud_idp_ping_test.go +++ b/genesyscloud/resource_genesyscloud_idp_ping_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceIdpPing(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_init.go b/genesyscloud/resource_genesyscloud_init.go index 8ca8476fa..d526a8439 100644 --- a/genesyscloud/resource_genesyscloud_init.go +++ b/genesyscloud/resource_genesyscloud_init.go @@ -30,11 +30,9 @@ func registerDataSources(l registrar.Registrar) { l.RegisterDataSource("genesyscloud_quality_forms_evaluation", DataSourceQualityFormsEvaluations()) l.RegisterDataSource("genesyscloud_quality_forms_survey", dataSourceQualityFormsSurvey()) l.RegisterDataSource("genesyscloud_routing_language", dataSourceRoutingLanguage()) - l.RegisterDataSource("genesyscloud_routing_settings", dataSourceRoutingSettings()) l.RegisterDataSource("genesyscloud_routing_skill", dataSourceRoutingSkill()) l.RegisterDataSource("genesyscloud_routing_skill_group", dataSourceRoutingSkillGroup()) l.RegisterDataSource("genesyscloud_routing_email_domain", DataSourceRoutingEmailDomain()) - l.RegisterDataSource("genesyscloud_routing_utilization_label", dataSourceRoutingUtilizationLabel()) l.RegisterDataSource("genesyscloud_routing_wrapupcode", DataSourceRoutingWrapupcode()) l.RegisterDataSource("genesyscloud_user", DataSourceUser()) l.RegisterDataSource("genesyscloud_widget_deployment", dataSourceWidgetDeployments()) @@ -66,9 +64,6 @@ func registerResources(l registrar.Registrar) { l.RegisterResource("genesyscloud_routing_language", ResourceRoutingLanguage()) l.RegisterResource("genesyscloud_routing_skill", ResourceRoutingSkill()) l.RegisterResource("genesyscloud_routing_skill_group", ResourceRoutingSkillGroup()) - l.RegisterResource("genesyscloud_routing_settings", ResourceRoutingSettings()) - l.RegisterResource("genesyscloud_routing_utilization", ResourceRoutingUtilization()) - l.RegisterResource("genesyscloud_routing_utilization_label", ResourceRoutingUtilizationLabel()) l.RegisterResource("genesyscloud_routing_wrapupcode", ResourceRoutingWrapupCode()) l.RegisterResource("genesyscloud_user", ResourceUser()) l.RegisterResource("genesyscloud_widget_deployment", ResourceWidgetDeployment()) @@ -93,11 +88,8 @@ func registerExporters(l registrar.Registrar) { l.RegisterExporter("genesyscloud_quality_forms_survey", SurveyFormExporter()) l.RegisterExporter("genesyscloud_routing_email_domain", RoutingEmailDomainExporter()) l.RegisterExporter("genesyscloud_routing_language", RoutingLanguageExporter()) - l.RegisterExporter("genesyscloud_routing_settings", RoutingSettingsExporter()) l.RegisterExporter("genesyscloud_routing_skill", RoutingSkillExporter()) l.RegisterExporter("genesyscloud_routing_skill_group", ResourceSkillGroupExporter()) - l.RegisterExporter("genesyscloud_routing_utilization", RoutingUtilizationExporter()) - l.RegisterExporter("genesyscloud_routing_utilization_label", RoutingUtilizationLabelExporter()) l.RegisterExporter("genesyscloud_routing_wrapupcode", RoutingWrapupCodeExporter()) l.RegisterExporter("genesyscloud_user", UserExporter()) l.RegisterExporter("genesyscloud_widget_deployment", WidgetDeploymentExporter()) diff --git a/genesyscloud/resource_genesyscloud_init_test.go b/genesyscloud/resource_genesyscloud_init_test.go index 0988af4f8..79c141fed 100644 --- a/genesyscloud/resource_genesyscloud_init_test.go +++ b/genesyscloud/resource_genesyscloud_init_test.go @@ -9,10 +9,13 @@ import ( "terraform-provider-genesyscloud/genesyscloud/group" "terraform-provider-genesyscloud/genesyscloud/provider" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" + routingSettings "terraform-provider-genesyscloud/genesyscloud/routing_settings" + routingUtilization "terraform-provider-genesyscloud/genesyscloud/routing_utilization" + routingUtilizationLabel "terraform-provider-genesyscloud/genesyscloud/routing_utilization_label" "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( @@ -58,14 +61,14 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_routing_language"] = ResourceRoutingLanguage() providerResources["genesyscloud_routing_skill"] = ResourceRoutingSkill() providerResources["genesyscloud_routing_skill_group"] = ResourceRoutingSkillGroup() - providerResources["genesyscloud_routing_settings"] = ResourceRoutingSettings() - providerResources["genesyscloud_routing_utilization"] = ResourceRoutingUtilization() - providerResources["genesyscloud_routing_utilization_label"] = ResourceRoutingUtilizationLabel() + providerResources["genesyscloud_routing_settings"] = routingSettings.ResourceRoutingSettings() + providerResources["genesyscloud_routing_utilization"] = routingUtilization.ResourceRoutingUtilization() providerResources["genesyscloud_routing_wrapupcode"] = ResourceRoutingWrapupCode() providerResources["genesyscloud_user"] = ResourceUser() providerResources["genesyscloud_widget_deployment"] = ResourceWidgetDeployment() providerResources["genesyscloud_architect_schedulegroups"] = archScheduleGroup.ResourceArchitectSchedulegroups() providerResources["genesyscloud_architect_schedules"] = architectSchedules.ResourceArchitectSchedules() + providerResources["genesyscloud_routing_utilization_label"] = routingUtilizationLabel.ResourceRoutingUtilizationLabel() } @@ -94,15 +97,13 @@ func (r *registerTestInstance) registerTestDataSources() { providerDataSources["genesyscloud_quality_forms_evaluation"] = DataSourceQualityFormsEvaluations() providerDataSources["genesyscloud_quality_forms_survey"] = dataSourceQualityFormsSurvey() providerDataSources["genesyscloud_routing_language"] = dataSourceRoutingLanguage() - providerDataSources["genesyscloud_routing_settings"] = dataSourceRoutingSettings() providerDataSources["genesyscloud_routing_skill"] = dataSourceRoutingSkill() providerDataSources["genesyscloud_routing_skill_group"] = dataSourceRoutingSkillGroup() providerDataSources["genesyscloud_routing_email_domain"] = DataSourceRoutingEmailDomain() - providerDataSources["genesyscloud_routing_utilization_label"] = dataSourceRoutingUtilizationLabel() providerDataSources["genesyscloud_routing_wrapupcode"] = DataSourceRoutingWrapupcode() providerDataSources["genesyscloud_user"] = DataSourceUser() providerDataSources["genesyscloud_widget_deployment"] = dataSourceWidgetDeployments() - + providerResources["genesyscloud_routing_utilization_label"] = routingUtilizationLabel.DataSourceRoutingUtilizationLabel() } func initTestResources() { diff --git a/genesyscloud/resource_genesyscloud_journey_action_map.go b/genesyscloud/resource_genesyscloud_journey_action_map.go index 76db967b7..7e1c583f0 100644 --- a/genesyscloud/resource_genesyscloud_journey_action_map.go +++ b/genesyscloud/resource_genesyscloud_journey_action_map.go @@ -25,7 +25,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_journey_action_map_test.go b/genesyscloud/resource_genesyscloud_journey_action_map_test.go index f0753a13e..22fa108ea 100644 --- a/genesyscloud/resource_genesyscloud_journey_action_map_test.go +++ b/genesyscloud/resource_genesyscloud_journey_action_map_test.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) const resourceName = "genesyscloud_journey_action_map" diff --git a/genesyscloud/resource_genesyscloud_journey_action_template.go b/genesyscloud/resource_genesyscloud_journey_action_template.go index 243f1d4bb..ecd418113 100644 --- a/genesyscloud/resource_genesyscloud_journey_action_template.go +++ b/genesyscloud/resource_genesyscloud_journey_action_template.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_journey_action_template_test.go b/genesyscloud/resource_genesyscloud_journey_action_template_test.go index ae33a8b3b..dd0cc9444 100644 --- a/genesyscloud/resource_genesyscloud_journey_action_template_test.go +++ b/genesyscloud/resource_genesyscloud_journey_action_template_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) const ActionTemplateResourceName = "genesyscloud_journey_action_template" diff --git a/genesyscloud/resource_genesyscloud_journey_outcome.go b/genesyscloud/resource_genesyscloud_journey_outcome.go index 8e163d2bd..40a1019ff 100644 --- a/genesyscloud/resource_genesyscloud_journey_outcome.go +++ b/genesyscloud/resource_genesyscloud_journey_outcome.go @@ -22,7 +22,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_journey_outcome_test.go b/genesyscloud/resource_genesyscloud_journey_outcome_test.go index 77fc9ba2f..5f52a59bd 100644 --- a/genesyscloud/resource_genesyscloud_journey_outcome_test.go +++ b/genesyscloud/resource_genesyscloud_journey_outcome_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceJourneyOutcome(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_journey_segment.go b/genesyscloud/resource_genesyscloud_journey_segment.go index 579f2c9ba..453d1191e 100644 --- a/genesyscloud/resource_genesyscloud_journey_segment.go +++ b/genesyscloud/resource_genesyscloud_journey_segment.go @@ -22,7 +22,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( @@ -53,7 +53,7 @@ var ( }(), ""), }, "scope": { - Description: "The target entity that a segment applies to.Valid values: Session, Customer. Changing the scope attribute will cause the existing journey_segment to be dropped and recreated with new ID.", + Description: "The target entity that a segment applies to. Valid values: Session", Type: schema.TypeString, Required: true, ForceNew: true, // scope can be only set during creation @@ -63,7 +63,6 @@ var ( Description: "Whether or not the segment should be displayed to agent/supervisor users.", Type: schema.TypeBool, Optional: true, - // Customer scope only supports false for this value }, "context": { Description: "The context of the segment.", diff --git a/genesyscloud/resource_genesyscloud_journey_segment_test.go b/genesyscloud/resource_genesyscloud_journey_segment_test.go index 165aa683b..7e0946b52 100644 --- a/genesyscloud/resource_genesyscloud_journey_segment_test.go +++ b/genesyscloud/resource_genesyscloud_journey_segment_test.go @@ -2,7 +2,6 @@ package genesyscloud import ( "fmt" - "github.com/google/uuid" "log" "strings" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -13,15 +12,11 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) -func TestAccResourceJourneySegmentCustomer(t *testing.T) { - runResourceJourneySegmentTestCase(t, "basic_customer_attributes") -} - -func TestAccResourceJourneySegmentSession(t *testing.T) { - runResourceJourneySegmentTestCase(t, "basic_session_attributes") +func TestAccResourceJourneySegment(t *testing.T) { + runResourceJourneySegmentTestCase(t, "basic_attributes") } func TestAccResourceJourneySegmentContextOnly(t *testing.T) { @@ -56,30 +51,36 @@ func setupJourneySegment(t *testing.T, testCaseName string) { func cleanupJourneySegments(idPrefix string) { journeyApi := platformclientv2.NewJourneyApiWithConfig(sdkConfig) - pageCount := 1 // Needed because of broken journey common paging - for pageNum := 1; pageNum <= pageCount; pageNum++ { - const pageSize = 100 + segmentsToDelete := make([]platformclientv2.Journeysegment, 0) + + // go through all segments to find those to delete + const pageSize = 200 + for pageNum := 1; ; pageNum++ { journeySegments, _, getErr := journeyApi.GetJourneySegments("", pageSize, pageNum, true, nil, nil, "") if getErr != nil { + log.Printf("failed to get page %v of journeySegments: %v", pageNum, getErr) return } - if journeySegments.Entities == nil || len(*journeySegments.Entities) == 0 { - break - } - for _, journeySegment := range *journeySegments.Entities { if journeySegment.DisplayName != nil && strings.HasPrefix(*journeySegment.DisplayName, idPrefix) { - _, delErr := journeyApi.DeleteJourneySegment(*journeySegment.Id) - if delErr != nil { - util.BuildDiagnosticError("genesyscloud_journey_segment", fmt.Sprintf("failed to delete journey segment %s (%s)", *journeySegment.Id, *journeySegment.DisplayName), delErr) - return - } - log.Printf("Deleted journey segment %s (%s)", *journeySegment.Id, *journeySegment.DisplayName) + segmentsToDelete = append(segmentsToDelete, journeySegment) } } - pageCount = *journeySegments.PageCount + if *journeySegments.PageNumber >= *journeySegments.PageCount { + break + } + } + + // delete them + for _, journeySegment := range segmentsToDelete { + _, delErr := journeyApi.DeleteJourneySegment(*journeySegment.Id) + if delErr != nil { + util.BuildDiagnosticError("genesyscloud_journey_segment", fmt.Sprintf("failed to delete journey segment %s (%s)", *journeySegment.Id, *journeySegment.DisplayName), delErr) + return + } + log.Printf("Deleted journey segment %s (%s)", *journeySegment.Id, *journeySegment.DisplayName) } } @@ -106,36 +107,3 @@ func testVerifyJourneySegmentsDestroyed(state *terraform.State) error { // Success. All Journey segment destroyed return nil } - -func customerSegmentationIsSupported(t *testing.T) (bool, string) { - segmentRequest := platformclientv2.Journeysegmentrequest{ - DisplayName: platformclientv2.String("terraform_test_" + uuid.NewString()), - Color: platformclientv2.String("#008000"), - Scope: platformclientv2.String("Customer"), - ShouldDisplayToAgent: platformclientv2.Bool(false), - ExternalSegment: &platformclientv2.Requestexternalsegment{ - Id: platformclientv2.String("4654654654"), - Name: platformclientv2.String("external segment name"), - Source: platformclientv2.String("AdobeExperiencePlatform"), - }, - } - - apiInstance := platformclientv2.NewJourneyApiWithConfig(sdkConfig) - segment, response, err := apiInstance.PostJourneySegments(segmentRequest) - if err != nil { - if response != nil && response.StatusCode == 501 && strings.Contains(response.ErrorMessage, "not currently supported") { - return false, response.ErrorMessage - } - t.Logf("failed to create segment inside method customerSegmentationIsSupported: %v", err) - return true, "" - } - - t.Logf("Customer segmentation has been implemented.") - - // cleanup segment - if _, err := apiInstance.DeleteJourneySegment(*segment.Id); err != nil { - t.Logf("failed to cleanup segment inside method customerSegmentationIsSupported. Segment ID: '%s'. Error: '%v'", *segment.Id, err) - } - - return true, "" -} diff --git a/genesyscloud/resource_genesyscloud_knowledge_category.go b/genesyscloud/resource_genesyscloud_knowledge_category.go index 5f302d90f..dc097759d 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_category.go +++ b/genesyscloud/resource_genesyscloud_knowledge_category.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_knowledge_category_test.go b/genesyscloud/resource_genesyscloud_knowledge_category_test.go index 0b4484661..06ca7764f 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_category_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_category_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceKnowledgeCategoryBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_document.go b/genesyscloud/resource_genesyscloud_knowledge_document.go index b11bb00c3..7c91e51bf 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_document.go +++ b/genesyscloud/resource_genesyscloud_knowledge_document.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_knowledge_document_test.go b/genesyscloud/resource_genesyscloud_knowledge_document_test.go index 33c78b2a8..0e47251ac 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_document_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_document_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceKnowledgeDocumentBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_document_variation.go b/genesyscloud/resource_genesyscloud_knowledge_document_variation.go index 9b55dc283..b0ed284f2 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_document_variation.go +++ b/genesyscloud/resource_genesyscloud_knowledge_document_variation.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_knowledge_document_variation_test.go b/genesyscloud/resource_genesyscloud_knowledge_document_variation_test.go index 68e05a00b..72e6fbfc4 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_document_variation_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_document_variation_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceKnowledgeDocumentVariationBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_knowledgebase.go b/genesyscloud/resource_genesyscloud_knowledge_knowledgebase.go index 0c549673a..4e824d71e 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_knowledgebase.go +++ b/genesyscloud/resource_genesyscloud_knowledge_knowledgebase.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllKnowledgeKnowledgebases(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_knowledgebase_test.go b/genesyscloud/resource_genesyscloud_knowledge_knowledgebase_test.go index 896cf6fce..798715ee1 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_knowledgebase_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_knowledgebase_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceKnowledgeKnowledgebaseBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_label.go b/genesyscloud/resource_genesyscloud_knowledge_label.go index 6e439d2b9..9b622e0ae 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_label.go +++ b/genesyscloud/resource_genesyscloud_knowledge_label.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_knowledge_label_test.go b/genesyscloud/resource_genesyscloud_knowledge_label_test.go index ef825655b..146fa7f36 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_label_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_label_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceKnowledgeLabelBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_v1_category.go b/genesyscloud/resource_genesyscloud_knowledge_v1_category.go index 6cb614dac..b5af3291e 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_v1_category.go +++ b/genesyscloud/resource_genesyscloud_knowledge_v1_category.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_knowledge_v1_category_test.go b/genesyscloud/resource_genesyscloud_knowledge_v1_category_test.go index b6f7b76d9..578c23b26 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_v1_category_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_v1_category_test.go @@ -8,7 +8,7 @@ package genesyscloud // "github.com/google/uuid" // "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" // "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" -// "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" +// "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" // ) // func TestAccResourceKnowledgeV1CategoryBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_v1_document.go b/genesyscloud/resource_genesyscloud_knowledge_v1_document.go index 6e9a363ad..a87a90384 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_v1_document.go +++ b/genesyscloud/resource_genesyscloud_knowledge_v1_document.go @@ -22,7 +22,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_knowledge_v1_document_test.go b/genesyscloud/resource_genesyscloud_knowledge_v1_document_test.go index 38266012f..b9ef197c6 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_v1_document_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_v1_document_test.go @@ -8,7 +8,7 @@ package genesyscloud // "github.com/google/uuid" // "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" // "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" -// "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" +// "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" // ) // func TestAccResourceKnowledgeV1DocumentBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_location.go b/genesyscloud/resource_genesyscloud_location.go index 693d9c7f5..eb2ac88e0 100644 --- a/genesyscloud/resource_genesyscloud_location.go +++ b/genesyscloud/resource_genesyscloud_location.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/nyaruka/phonenumbers" ) diff --git a/genesyscloud/resource_genesyscloud_location_test.go b/genesyscloud/resource_genesyscloud_location_test.go index db2a7036b..b34a8c149 100644 --- a/genesyscloud/resource_genesyscloud_location_test.go +++ b/genesyscloud/resource_genesyscloud_location_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceLocationBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_quality_forms_evaluation.go b/genesyscloud/resource_genesyscloud_quality_forms_evaluation.go index e037532e6..b048bda93 100644 --- a/genesyscloud/resource_genesyscloud_quality_forms_evaluation.go +++ b/genesyscloud/resource_genesyscloud_quality_forms_evaluation.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_quality_forms_evaluation_test.go b/genesyscloud/resource_genesyscloud_quality_forms_evaluation_test.go index da3edc9e7..bceeeff41 100644 --- a/genesyscloud/resource_genesyscloud_quality_forms_evaluation_test.go +++ b/genesyscloud/resource_genesyscloud_quality_forms_evaluation_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceEvaluationFormBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_quality_forms_survey.go b/genesyscloud/resource_genesyscloud_quality_forms_survey.go index fe3f68747..a8941b378 100644 --- a/genesyscloud/resource_genesyscloud_quality_forms_survey.go +++ b/genesyscloud/resource_genesyscloud_quality_forms_survey.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type SurveyFormStruct struct { diff --git a/genesyscloud/resource_genesyscloud_quality_forms_survey_test.go b/genesyscloud/resource_genesyscloud_quality_forms_survey_test.go index 774504d74..cf763718c 100644 --- a/genesyscloud/resource_genesyscloud_quality_forms_survey_test.go +++ b/genesyscloud/resource_genesyscloud_quality_forms_survey_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceSurveyFormBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_routing_email_domain.go b/genesyscloud/resource_genesyscloud_routing_email_domain.go index 9d1115f5d..e17c91191 100644 --- a/genesyscloud/resource_genesyscloud_routing_email_domain.go +++ b/genesyscloud/resource_genesyscloud_routing_email_domain.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllRoutingEmailDomains(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_routing_email_domain_test.go b/genesyscloud/resource_genesyscloud_routing_email_domain_test.go index 7b2684574..016f54c20 100644 --- a/genesyscloud/resource_genesyscloud_routing_email_domain_test.go +++ b/genesyscloud/resource_genesyscloud_routing_email_domain_test.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceRoutingEmailDomainSub(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_routing_language.go b/genesyscloud/resource_genesyscloud_routing_language.go index bb08ca53e..e30132331 100644 --- a/genesyscloud/resource_genesyscloud_routing_language.go +++ b/genesyscloud/resource_genesyscloud_routing_language.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllRoutingLanguages(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_routing_language_test.go b/genesyscloud/resource_genesyscloud_routing_language_test.go index 228fd997d..a3f416a09 100644 --- a/genesyscloud/resource_genesyscloud_routing_language_test.go +++ b/genesyscloud/resource_genesyscloud_routing_language_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceRoutingLanguageBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_routing_settings.go b/genesyscloud/resource_genesyscloud_routing_settings.go deleted file mode 100644 index 0e79aff55..000000000 --- a/genesyscloud/resource_genesyscloud_routing_settings.go +++ /dev/null @@ -1,308 +0,0 @@ -package genesyscloud - -import ( - "context" - "fmt" - "log" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" - "terraform-provider-genesyscloud/genesyscloud/util/constants" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - - "terraform-provider-genesyscloud/genesyscloud/consistency_checker" - - resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" -) - -func ResourceRoutingSettings() *schema.Resource { - return &schema.Resource{ - Description: "An organization's routing settings", - - CreateContext: provider.CreateWithPooledClient(createRoutingSettings), - ReadContext: provider.ReadWithPooledClient(readRoutingSettings), - UpdateContext: provider.UpdateWithPooledClient(updateRoutingSettings), - DeleteContext: provider.DeleteWithPooledClient(deleteRoutingSettings), - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - SchemaVersion: 1, - Schema: map[string]*schema.Schema{ - "reset_agent_on_presence_change": { - Description: "Reset agent score when agent presence changes from off-queue to on-queue", - Type: schema.TypeBool, - Optional: true, - Computed: true, - }, - "contactcenter": { - Description: "Contact center settings", - Type: schema.TypeList, - Optional: true, - Computed: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "remove_skills_from_blind_transfer": { - Description: "Strip skills from transfer", - Type: schema.TypeBool, - Optional: true, - }, - }, - }, - }, - "transcription": { - Description: "Transcription settings", - Type: schema.TypeList, - Optional: true, - Computed: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "transcription": { - Description: "Setting to enable/disable transcription capability.Valid values: Disabled, EnabledGlobally, EnabledQueueFlow", - Type: schema.TypeString, - Optional: true, - }, - "transcription_confidence_threshold": { - Description: "Configure confidence threshold. The possible values are from 1 to 100", - Type: schema.TypeInt, - Optional: true, - }, - "low_latency_transcription_enabled": { - Description: "Boolean flag indicating whether low latency transcription via Notification API is enabled", - Type: schema.TypeBool, - Optional: true, - }, - "content_search_enabled": { - Description: "Setting to enable/disable content search", - Type: schema.TypeBool, - Optional: true, - }, - }, - }, - }, - }, - } -} - -func getAllRoutingSettings(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { - resources := make(resourceExporter.ResourceIDMetaMap) - resources["0"] = &resourceExporter.ResourceMeta{Name: "routing_settings"} - return resources, nil -} - -func RoutingSettingsExporter() *resourceExporter.ResourceExporter { - return &resourceExporter.ResourceExporter{ - GetResourcesFunc: provider.GetAllWithPooledClient(getAllRoutingSettings), - RefAttrs: map[string]*resourceExporter.RefAttrSettings{}, // No references - } -} - -func createRoutingSettings(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - log.Printf("Creating Routing Setting") - d.SetId("settings") - return updateRoutingSettings(ctx, d, meta) -} - -func readRoutingSettings(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceRoutingSettings(), constants.DefaultConsistencyChecks, "genesyscloud_routing_settings") - - log.Printf("Reading setting: %s", d.Id()) - return util.WithRetriesForRead(ctx, d, func() *retry.RetryError { - settings, resp, getErr := routingAPI.GetRoutingSettings() - - if getErr != nil { - if util.IsStatus404(resp) { - //createRoutingSettings(ctx, d, meta) - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_settings", fmt.Sprintf("Failed to read Routing Setting %s | error: %s", d.Id(), getErr), resp)) - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_settings", fmt.Sprintf("Failed to read Routing Setting %s | error: %s", d.Id(), getErr), resp)) - } - - if settings.ResetAgentScoreOnPresenceChange != nil { - d.Set("reset_agent_on_presence_change", *settings.ResetAgentScoreOnPresenceChange) - } else { - d.Set("reset_agent_on_presence_change", nil) - } - - if diagErr := readRoutingSettingsContactCenter(d, routingAPI); diagErr != nil { - return retry.NonRetryableError(fmt.Errorf("%v", diagErr)) - } - - if diagErr := readRoutingSettingsTranscription(d, routingAPI); diagErr != nil { - return retry.NonRetryableError(fmt.Errorf("%v", diagErr)) - } - - log.Printf("Read Routing Setting") - return cc.CheckState(d) - }) -} - -func updateRoutingSettings(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - resetAgentOnPresenceChange := d.Get("reset_agent_on_presence_change").(bool) - - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - - log.Printf("Updating Routing Settings") - update := platformclientv2.Routingsettings{ - ResetAgentScoreOnPresenceChange: &resetAgentOnPresenceChange, - } - - diagErr := updateContactCenter(d, routingAPI) - if diagErr != nil { - return diagErr - } - - diagErr = updateTranscription(d, routingAPI) - if diagErr != nil { - return diagErr - } - - _, resp, err := routingAPI.PutRoutingSettings(update) - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_routing_settings", fmt.Sprintf("Failed to update routing settings %s error: %s", d.Id(), err), resp) - } - - time.Sleep(5 * time.Second) - - log.Printf("Updated Routing Settings") - return readRoutingSettings(ctx, d, meta) -} - -func deleteRoutingSettings(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - - log.Printf("Resetting Routing Setting") - resp, err := routingAPI.DeleteRoutingSettings() - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_routing_settings", fmt.Sprintf("Failed to delete routing settings error: %s", err), resp) - } - log.Printf("Reset Routing Settings") - return nil -} - -func readRoutingSettingsContactCenter(d *schema.ResourceData, routingAPI *platformclientv2.RoutingApi) diag.Diagnostics { - contactcenter, resp, getErr := routingAPI.GetRoutingSettingsContactcenter() - if getErr != nil { - if util.IsStatus404(resp) { - return nil - } - return util.BuildAPIDiagnosticError("genesyscloud_routing_settings", fmt.Sprintf("Failed to read contact center for routing setting %s error: %s", d.Id(), getErr), resp) - } - - if contactcenter == nil { - d.Set("contactcenter", nil) - return nil - } - - contactSettings := make(map[string]interface{}) - - if contactcenter.RemoveSkillsFromBlindTransfer != nil { - contactSettings["remove_skills_from_blind_transfer"] = *contactcenter.RemoveSkillsFromBlindTransfer - } - - d.Set("contactcenter", []interface{}{contactSettings}) - return nil -} - -func readRoutingSettingsTranscription(d *schema.ResourceData, routingAPI *platformclientv2.RoutingApi) diag.Diagnostics { - transcription, resp, getErr := routingAPI.GetRoutingSettingsTranscription() - if getErr != nil { - if util.IsStatus404(resp) { - return nil - } - return util.BuildAPIDiagnosticError("genesyscloud_routing_settings", fmt.Sprintf("Failed to read contact center for routing settings %s error: %s", d.Id(), getErr), resp) - } - - if transcription == nil { - d.Set("transcription", nil) - return nil - } - - transcriptionSettings := make(map[string]interface{}) - - if transcription.Transcription != nil { - transcriptionSettings["transcription"] = *transcription.Transcription - } - if transcription.TranscriptionConfidenceThreshold != nil { - transcriptionSettings["transcription_confidence_threshold"] = *transcription.TranscriptionConfidenceThreshold - } - if transcription.LowLatencyTranscriptionEnabled != nil { - transcriptionSettings["low_latency_transcription_enabled"] = *transcription.LowLatencyTranscriptionEnabled - } - if transcription.ContentSearchEnabled != nil { - transcriptionSettings["content_search_enabled"] = *transcription.ContentSearchEnabled - } - - d.Set("transcription", []interface{}{transcriptionSettings}) - return nil -} - -func updateContactCenter(d *schema.ResourceData, routingAPI *platformclientv2.RoutingApi) diag.Diagnostics { - var removeSkillsFromBlindTransfer bool - - if contactCenterConfig := d.Get("contactcenter"); contactCenterConfig != nil { - if contactCenterList := contactCenterConfig.([]interface{}); len(contactCenterList) > 0 { - contactCenterMap := contactCenterList[0].(map[string]interface{}) - - if contactCenterMap["remove_skills_from_blind_transfer"] != nil { - removeSkillsFromBlindTransfer = contactCenterMap["remove_skills_from_blind_transfer"].(bool) - } - resp, err := routingAPI.PatchRoutingSettingsContactcenter(platformclientv2.Contactcentersettings{ - RemoveSkillsFromBlindTransfer: &removeSkillsFromBlindTransfer, - }) - - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_routing_settings", fmt.Sprintf("Failed to update contact center for routing settings %s error: %s", d.Id(), err), resp) - } - } - } - return nil -} - -func updateTranscription(d *schema.ResourceData, routingAPI *platformclientv2.RoutingApi) diag.Diagnostics { - if transcriptionConfig := d.Get("transcription"); transcriptionConfig != nil { - if transcriptionList := transcriptionConfig.([]interface{}); len(transcriptionList) > 0 { - transcriptionMap := transcriptionList[0].(map[string]interface{}) - - var transcription string - var transcriptionConfidenceThreshold int - var lowLatencyTranscriptionEnabled bool - var contentSearchEnabled bool - - if transcriptionMap["transcription"] != nil { - transcription = transcriptionMap["transcription"].(string) - } - if transcriptionMap["transcription_confidence_threshold"] != nil { - transcriptionConfidenceThreshold = transcriptionMap["transcription_confidence_threshold"].(int) - } - if transcriptionMap["low_latency_transcription_enabled"] != nil { - lowLatencyTranscriptionEnabled = transcriptionMap["low_latency_transcription_enabled"].(bool) - } - if transcriptionMap["content_search_enabled"] != nil { - contentSearchEnabled = transcriptionMap["content_search_enabled"].(bool) - } - - _, resp, err := routingAPI.PutRoutingSettingsTranscription(platformclientv2.Transcriptionsettings{ - Transcription: &transcription, - TranscriptionConfidenceThreshold: &transcriptionConfidenceThreshold, - LowLatencyTranscriptionEnabled: &lowLatencyTranscriptionEnabled, - ContentSearchEnabled: &contentSearchEnabled, - }) - - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_routing_settings", fmt.Sprintf("Failed to update Transcription for routing settings %s error: %s", d.Id(), err), resp) - } - } - } - return nil -} diff --git a/genesyscloud/resource_genesyscloud_routing_skill.go b/genesyscloud/resource_genesyscloud_routing_skill.go index d0ac11e3e..91ccf0574 100644 --- a/genesyscloud/resource_genesyscloud_routing_skill.go +++ b/genesyscloud/resource_genesyscloud_routing_skill.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllRoutingSkills(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_routing_skill_group.go b/genesyscloud/resource_genesyscloud_routing_skill_group.go index b91cbd6d4..6508806de 100644 --- a/genesyscloud/resource_genesyscloud_routing_skill_group.go +++ b/genesyscloud/resource_genesyscloud_routing_skill_group.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type SkillGroupsRequest struct { @@ -34,54 +34,18 @@ type SkillGroupsRequest struct { SkillConditions struct{} `json:"skillConditions"` //Keep this here. Even though we do not use this field in the struct The generated attributed is used as a placeholder } -type AllSkillGroups struct { - Entities []struct { - ID string `json:"id"` - Name string `json:"name"` - } - NextURI string `json:"nextUri"` - SelfURI string `json:"selfUri"` - PreviousURI string `json:"previousUri"` -} - -func getAllSkillGroups(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { +func getAllSkillGroups(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { resources := make(resourceExporter.ResourceIDMetaMap) routingAPI := platformclientv2.NewRoutingApiWithConfig(clientConfig) - apiClient := &routingAPI.Configuration.APIClient - route := "/api/v2/routing/skillgroups" - - headerParams := buildHeaderParams(routingAPI) - - for { - path := routingAPI.Configuration.BasePath + route - skillGroupPayload := &AllSkillGroups{} - - response, err := apiClient.CallAPI(path, "GET", nil, headerParams, nil, nil, "", nil) - - if err != nil { - return nil, util.BuildAPIDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Failed to get page of skill groups error: %s", err), response) - } - - err = json.Unmarshal(response.RawBody, &skillGroupPayload) - if err != nil { - return nil, util.BuildDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Failed to unmarshal skill groups"), err) - } - - if skillGroupPayload.Entities == nil || len(skillGroupPayload.Entities) == 0 { - break - } - - for _, skillGroup := range skillGroupPayload.Entities { - - resources[skillGroup.ID] = &resourceExporter.ResourceMeta{Name: skillGroup.Name} - } - if route == skillGroupPayload.NextURI || skillGroupPayload.NextURI == "" { - break - } else { - route = skillGroupPayload.NextURI - } + allSkillGroups, resp, err := getAllSkillGroupsByName(routingAPI, "") + if err != nil { + msg := fmt.Sprintf("failed to read skill groups: %v", err) + return nil, util.BuildAPIDiagnosticError(getSkillGroupResourceName(), msg, resp) + } + for _, skillGroup := range allSkillGroups { + resources[*skillGroup.Id] = &resourceExporter.ResourceMeta{Name: *skillGroup.Name} } return resources, nil @@ -101,6 +65,10 @@ func ResourceSkillGroupExporter() *resourceExporter.ResourceExporter { } } +func getSkillGroupResourceName() string { + return "genesyscloud_routing_skill_group" +} + func ResourceRoutingSkillGroup() *schema.Resource { return &schema.Resource{ Description: `Genesys Cloud Skill Group`, @@ -174,14 +142,14 @@ func createOrUpdateSkillGroups(ctx context.Context, d *schema.ResourceData, meta //Merge in skill conditions finalSkillGroupsJson, err := mergeSkillConditionsIntoSkillGroups(d, skillGroupsRequest) if err != nil { - return util.BuildDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Failed to read the before skills groups request before: %s", skillGroupsRequest.Name), err) + return util.BuildDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf("Failed to read the before skills groups request before: %s", skillGroupsRequest.Name), err) } sdkConfig := meta.(*provider.ProviderMeta).ClientConfig routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) apiClient := &routingAPI.Configuration.APIClient path := routingAPI.Configuration.BasePath + route - headerParams := buildHeaderParams(routingAPI) + headerParams := BuildHeaderParams(routingAPI) /* Since API Client expects either a struct or map of maps (of json), convert the JSON string to a map @@ -190,7 +158,7 @@ func createOrUpdateSkillGroups(ctx context.Context, d *schema.ResourceData, meta var skillGroupsPayload map[string]interface{} err = json.Unmarshal([]byte(finalSkillGroupsJson), &skillGroupsPayload) if err != nil { - return util.BuildDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Failed to unmarshal the JSON payload while creating/updating the skills group %s", skillGroupsRequest.Name), err) + return util.BuildDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf("Failed to unmarshal the JSON payload while creating/updating the skills group %s", skillGroupsRequest.Name), err) } httpMethod := "POST" @@ -200,14 +168,14 @@ func createOrUpdateSkillGroups(ctx context.Context, d *schema.ResourceData, meta response, err := apiClient.CallAPI(path, httpMethod, skillGroupsPayload, headerParams, nil, nil, "", nil) if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Failed to create/update skill groups %s error: %s", skillGroupsRequest.Name, err), response) + return util.BuildAPIDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf("Failed to create/update skill groups %s error: %s", skillGroupsRequest.Name, err), response) } //Get the results and pull out the id skillGroupPayload := make(map[string]interface{}) err = json.Unmarshal(response.RawBody, &skillGroupPayload) if err != nil { - return util.BuildDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Failed to unmarshal skill groups"), err) + return util.BuildDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf("Failed to unmarshal skill groups"), err) } if create == true { @@ -265,12 +233,12 @@ func postSkillGroupMemberDivisions(ctx context.Context, d *schema.ResourceData, skillGroupsMemberDivisionIdsPayload["addDivisionIds"] = toAdd } - headerParams := buildHeaderParams(routingAPI) + headerParams := BuildHeaderParams(routingAPI) apiClient := &routingAPI.Configuration.APIClient path := fmt.Sprintf("%s/api/v2/routing/skillgroups/%s/members/divisions", routingAPI.Configuration.BasePath, d.Id()) response, err := apiClient.CallAPI(path, "POST", skillGroupsMemberDivisionIdsPayload, headerParams, nil, nil, "", nil) if err != nil || response.Error != nil { - return util.BuildAPIDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Failed to create/update skill group %s member divisions error: %s", d.Id(), err), response) + return util.BuildAPIDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf("Failed to create/update skill group %s member divisions error: %s", d.Id(), err), response) } log.Printf("Updated skill group %s member divisions", name) @@ -300,7 +268,7 @@ func createListsForSkillgroupsMembersDivisionsPost(schemaMemberDivisionIds []str if allMemberDivisionsSpecified(schemaMemberDivisionIds) { if len(schemaMemberDivisionIds) > 1 { - return nil, nil, util.BuildDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf(`member_division_ids should not contain more than one item when the value of an item is "*"`), fmt.Errorf(`member_division_ids should not contain more than one item when the value of an item is "*"`)) + return nil, nil, util.BuildDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf(`member_division_ids should not contain more than one item when the value of an item is "*"`), fmt.Errorf(`member_division_ids should not contain more than one item when the value of an item is "*"`)) } toAdd, err := getAllAuthDivisionIds(meta) return toAdd, nil, err @@ -361,7 +329,7 @@ func readSkillGroups(ctx context.Context, d *schema.ResourceData, meta interface path := routingAPI.Configuration.BasePath + "/api/v2/routing/skillgroups/" + d.Id() // add default headers if any - headerParams := buildHeaderParams(routingAPI) + headerParams := BuildHeaderParams(routingAPI) log.Printf("Reading skills group %s", d.Id()) @@ -371,11 +339,11 @@ func readSkillGroups(ctx context.Context, d *schema.ResourceData, meta interface response, err := apiClient.CallAPI(path, "GET", nil, headerParams, nil, nil, "", nil) if err != nil { - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Failed to retrieve skill groups %s", err), response)) + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf("Failed to retrieve skill groups %s", err), response)) } if err == nil && response.Error != nil && response.StatusCode != http.StatusNotFound { - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Failed to retrieve skill groups. %s", err), response)) + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf("Failed to retrieve skill groups. %s", err), response)) } err = json.Unmarshal(response.RawBody, &skillGroupPayload) @@ -384,7 +352,7 @@ func readSkillGroups(ctx context.Context, d *schema.ResourceData, meta interface } if err == nil && util.IsStatus404(response) { - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Failed to read skill groups %s | error: %s", d.Id(), err), response)) + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf("Failed to read skill groups %s | error: %s", d.Id(), err), response)) } name := skillGroupPayload["name"] @@ -440,7 +408,7 @@ func readSkillGroups(ctx context.Context, d *schema.ResourceData, meta interface }) } -func buildHeaderParams(routingAPI *platformclientv2.RoutingApi) map[string]string { +func BuildHeaderParams(routingAPI *platformclientv2.RoutingApi) map[string]string { headerParams := make(map[string]string) for key := range routingAPI.Configuration.DefaultHeader { @@ -470,7 +438,7 @@ func deleteSkillGroups(ctx context.Context, d *schema.ResourceData, meta interfa path := routingAPI.Configuration.BasePath + "/api/v2/routing/skillgroups/" + d.Id() // add default headers if any - headerParams := buildHeaderParams(routingAPI) + headerParams := BuildHeaderParams(routingAPI) log.Printf("Deleting skills group %s", name) response, err := apiClient.CallAPI(path, "DELETE", nil, headerParams, nil, nil, "", nil) @@ -481,7 +449,7 @@ func deleteSkillGroups(ctx context.Context, d *schema.ResourceData, meta interfa log.Printf("Skills Group was already deleted %s", d.Id()) return nil } - return util.BuildAPIDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Failed to delete skill group %s error: %s", d.Id(), err), response) + return util.BuildAPIDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf("Failed to delete skill group %s error: %s", d.Id(), err), response) } return util.WithRetries(ctx, 30*time.Second, func() *retry.RetryError { @@ -494,14 +462,14 @@ func deleteSkillGroups(ctx context.Context, d *schema.ResourceData, meta interfa log.Printf("Deleted skills group %s", d.Id()) return nil } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Error deleting skill group %s | error: %s", d.Id(), err), response)) + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf("Error deleting skill group %s | error: %s", d.Id(), err), response)) } - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Skill group %s still exists", d.Id()), response)) + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf("Skill group %s still exists", d.Id()), response)) }) } func readSkillGroupMemberDivisionIds(d *schema.ResourceData, routingAPI *platformclientv2.RoutingApi) ([]string, diag.Diagnostics) { - headers := buildHeaderParams(routingAPI) + headers := BuildHeaderParams(routingAPI) apiClient := &routingAPI.Configuration.APIClient path := fmt.Sprintf("%s/api/v2/routing/skillgroups/%s/members/divisions", routingAPI.Configuration.BasePath, d.Id()) @@ -509,13 +477,13 @@ func readSkillGroupMemberDivisionIds(d *schema.ResourceData, routingAPI *platfor response, err := apiClient.CallAPI(path, "GET", nil, headers, nil, nil, "", nil) if err != nil || response.Error != nil { - return nil, util.BuildAPIDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Failed to get member divisions for skill group %s error: %s", d.Id(), err), response) + return nil, util.BuildAPIDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf("Failed to get member divisions for skill group %s error: %s", d.Id(), err), response) } memberDivisionsPayload := make(map[string]interface{}, 0) err = json.Unmarshal(response.RawBody, &memberDivisionsPayload) if err != nil { - return nil, util.BuildDiagnosticError("genesyscloud_routing_skill_group", fmt.Sprintf("Failed to unmarshal member divisions"), err) + return nil, util.BuildDiagnosticError(getSkillGroupResourceName(), fmt.Sprintf("Failed to unmarshal member divisions"), err) } apiSkillGroupMemberDivisionIds := make([]string, 0) @@ -593,9 +561,9 @@ func GenerateRoutingSkillGroupResourceBasic( resourceID string, name string, description string) string { - return fmt.Sprintf(`resource "genesyscloud_routing_skill_group" "%s" { + return fmt.Sprintf(`resource "%s" "%s" { name = "%s" description="%s" } - `, resourceID, name, description) + `, getSkillGroupResourceName(), resourceID, name, description) } diff --git a/genesyscloud/resource_genesyscloud_routing_skill_group_test.go b/genesyscloud/resource_genesyscloud_routing_skill_group_test.go index 4c7caa783..311e08fc7 100644 --- a/genesyscloud/resource_genesyscloud_routing_skill_group_test.go +++ b/genesyscloud/resource_genesyscloud_routing_skill_group_test.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func testAccCheckSkillConditions(resourceName string, targetSkillConditionJson string) resource.TestCheckFunc { @@ -391,7 +391,6 @@ data "genesyscloud_auth_division_home" "home" {} 3. Verify the skill group added those users when they match the skill expression. */ func TestAccResourceRoutingSkillGroupMemberDivisionsUsersAssigned(t *testing.T) { - t.Parallel() var ( skillGroupResourceId = "testskillgroup3" skillGroupName = "testskillgroup3 " + uuid.NewString() @@ -422,6 +421,9 @@ func TestAccResourceRoutingSkillGroupMemberDivisionsUsersAssigned(t *testing.T) "genesyscloud_auth_division." + division2ResourceId + ".id", "genesyscloud_auth_division." + division3ResourceId + ".id", } + userID1 string + userID2 string + userID3 string ) routingSkillResource := GenerateRoutingSkillResource(routingSkillResourceId, routingSkillName) @@ -501,6 +503,9 @@ resource "genesyscloud_routing_skill_group" "%s" { ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), Steps: []resource.TestStep{ { + PreConfig: func() { + time.Sleep(30 * time.Second) + }, Config: skillGroupResource + routingSkillResource + division1Resource + @@ -511,6 +516,25 @@ resource "genesyscloud_routing_skill_group" "%s" { user3Resource, Check: resource.ComposeTestCheckFunc( testVerifySkillGroupMemberCount("genesyscloud_routing_skill_group."+skillGroupResourceId, "3"), + func(s *terraform.State) error { + rs, ok := s.RootModule().Resources["genesyscloud_user."+user1ResourceId] + if !ok { + return fmt.Errorf("not found: %s", "genesyscloud_user."+user1ResourceId) + } + userID1 = rs.Primary.ID + log.Printf("User ID: %s\n", userID1) // Print user ID + rs, ok = s.RootModule().Resources["genesyscloud_user."+user2ResourceId] + if !ok { + return fmt.Errorf("not found: %s", "genesyscloud_user."+user2ResourceId) + } + userID2 = rs.Primary.ID + rs, ok = s.RootModule().Resources["genesyscloud_user."+user3ResourceId] + if !ok { + return fmt.Errorf("not found: %s", "genesyscloud_user."+user3ResourceId) + } + userID3 = rs.Primary.ID + return nil + }, ), }, { @@ -518,6 +542,11 @@ resource "genesyscloud_routing_skill_group" "%s" { ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{"member_division_ids"}, + Check: resource.ComposeTestCheckFunc( + checkUserDeleted(userID1), + checkUserDeleted(userID2), + checkUserDeleted(userID3), + ), }, }, CheckDestroy: testVerifySkillGroupDestroyed, @@ -574,7 +603,7 @@ func testVerifySkillGroupMemberCount(resourceName string, count string) resource // get skill group via GET /api/v2/routing/skillgroups/{skillGroupId} path := fmt.Sprintf("%s/api/v2/routing/skillgroups/%s", routingAPI.Configuration.BasePath, resourceID) - headers := buildHeaderParams(routingAPI) + headers := BuildHeaderParams(routingAPI) apiClient := &routingAPI.Configuration.APIClient response, err := apiClient.CallAPI(path, "GET", nil, headers, nil, nil, "", nil) @@ -706,7 +735,7 @@ func testVerifySkillGroupDestroyed(state *terraform.State) error { // TODO Once this code has been released into the public API we should fix this and use the SDK - headerParams := buildHeaderParams(routingAPI) + headerParams := BuildHeaderParams(routingAPI) for _, rs := range state.RootModule().Resources { if rs.Type != "genesyscloud_routing_skill_group" { continue @@ -737,7 +766,7 @@ func testVerifySkillGroupDestroyed(state *terraform.State) error { } func getAllSkillGroupMemberDivisionIds(routingAPI *platformclientv2.RoutingApi, resourceId string) ([]string, diag.Diagnostics) { - headers := buildHeaderParams(routingAPI) + headers := BuildHeaderParams(routingAPI) apiClient := &routingAPI.Configuration.APIClient path := fmt.Sprintf("%s/api/v2/routing/skillgroups/%s/members/divisions", routingAPI.Configuration.BasePath, resourceId) response, err := apiClient.CallAPI(path, "GET", nil, headers, nil, nil, "", nil) @@ -761,3 +790,45 @@ func getAllSkillGroupMemberDivisionIds(routingAPI *platformclientv2.RoutingApi, return apiSkillGroupMemberDivisionIds, nil } + +func checkUserDeleted(id string) resource.TestCheckFunc { + log.Printf("Fetching user with ID: %s\n", id) + return func(s *terraform.State) error { + maxAttempts := 18 + for i := 0; i < maxAttempts; i++ { + + deleted, err := isUserDeleted(id) + if err != nil { + return err + } + if deleted { + return nil + } + time.Sleep(10 * time.Second) + } + return fmt.Errorf("user %s was not deleted properly", id) + } +} + +func isUserDeleted(id string) (bool, error) { + mu.Lock() + defer mu.Unlock() + + usersAPI := platformclientv2.NewUsersApiWithConfig(sdkConfig) + // Attempt to get the user + _, response, err := usersAPI.GetUser(id, nil, "", "") + + // Check if the user is not found (deleted) + if response != nil && response.StatusCode == 404 { + return true, nil // User is deleted + } + + // Handle other errors + if err != nil { + log.Printf("Error fetching user: %v", err) + return false, err + } + + // If user is found, it means the user is not deleted + return false, nil +} diff --git a/genesyscloud/resource_genesyscloud_routing_skill_test.go b/genesyscloud/resource_genesyscloud_routing_skill_test.go index b213ac5af..551c061a6 100644 --- a/genesyscloud/resource_genesyscloud_routing_skill_test.go +++ b/genesyscloud/resource_genesyscloud_routing_skill_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceRoutingSkillBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_routing_utilization.go b/genesyscloud/resource_genesyscloud_routing_utilization.go deleted file mode 100644 index 3cc9614df..000000000 --- a/genesyscloud/resource_genesyscloud_routing_utilization.go +++ /dev/null @@ -1,389 +0,0 @@ -package genesyscloud - -import ( - "context" - "encoding/json" - "fmt" - "log" - "sort" - "strings" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" - "terraform-provider-genesyscloud/genesyscloud/util/constants" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - - "terraform-provider-genesyscloud/genesyscloud/consistency_checker" - - resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" - lists "terraform-provider-genesyscloud/genesyscloud/util/lists" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" -) - -type MediaUtilization struct { - MaximumCapacity int32 `json:"maximumCapacity"` - InterruptableMediaTypes []string `json:"interruptableMediaTypes"` - IncludeNonAcd bool `json:"includeNonAcd"` -} - -type LabelUtilization struct { - MaximumCapacity int32 `json:"maximumCapacity"` - InterruptingLabelIds []string `json:"interruptingLabelIds"` -} - -type OrgUtilizationWithLabels struct { - Utilization map[string]MediaUtilization `json:"utilization"` - LabelUtilizations map[string]LabelUtilization `json:"labelUtilizations"` -} - -var ( - // Map of SDK media type name to schema media type name - utilizationMediaTypes = map[string]string{ - "call": "call", - "callback": "callback", - "chat": "chat", - "email": "email", - "message": "message", - } - - utilizationSettingsResource = &schema.Resource{ - Schema: map[string]*schema.Schema{ - "maximum_capacity": { - Description: "Maximum capacity of conversations of this media type. Value must be between 0 and 25.", - Type: schema.TypeInt, - Required: true, - ValidateFunc: validation.IntBetween(0, 25), - }, - "interruptible_media_types": { - Description: fmt.Sprintf("Set of other media types that can interrupt this media type (%s).", strings.Join(getSdkUtilizationTypes(), " | ")), - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "include_non_acd": { - Description: "Block this media type when on a non-ACD conversation.", - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - }, - } - - utilizationLabelResource = &schema.Resource{ - Schema: map[string]*schema.Schema{ - "label_id": { - Description: "Id of the label being configured.", - Type: schema.TypeString, - Required: true, - }, - "maximum_capacity": { - Description: "Maximum capacity of conversations with this label. Value must be between 0 and 25.", - Type: schema.TypeInt, - Required: true, - ValidateFunc: validation.IntBetween(0, 25), - }, - "interrupting_label_ids": { - Description: "Set of other labels that can interrupt this label.", - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - }, - } -) - -func getSdkUtilizationTypes() []string { - types := make([]string, 0, len(utilizationMediaTypes)) - for t := range utilizationMediaTypes { - types = append(types, t) - } - sort.Strings(types) - return types -} - -func getAllRoutingUtilization(_ context.Context, _ *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { - // Routing utilization config always exists - resources := make(resourceExporter.ResourceIDMetaMap) - resources["0"] = &resourceExporter.ResourceMeta{Name: "routing_utilization"} - return resources, nil -} - -func RoutingUtilizationExporter() *resourceExporter.ResourceExporter { - return &resourceExporter.ResourceExporter{ - GetResourcesFunc: provider.GetAllWithPooledClient(getAllRoutingUtilization), - RefAttrs: map[string]*resourceExporter.RefAttrSettings{}, // No references - AllowZeroValues: []string{"maximum_capacity"}, - } -} - -func ResourceRoutingUtilization() *schema.Resource { - return &schema.Resource{ - Description: "Genesys Cloud Org-wide Routing Utilization Settings.", - - CreateContext: provider.CreateWithPooledClient(createRoutingUtilization), - ReadContext: provider.ReadWithPooledClient(readRoutingUtilization), - UpdateContext: provider.UpdateWithPooledClient(updateRoutingUtilization), - DeleteContext: provider.DeleteWithPooledClient(deleteRoutingUtilization), - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - SchemaVersion: 1, - Timeouts: &schema.ResourceTimeout{ - Update: schema.DefaultTimeout(8 * time.Minute), - Read: schema.DefaultTimeout(8 * time.Minute), - }, - Schema: map[string]*schema.Schema{ - "call": { - Description: "Call media settings. If not set, this reverts to the default media type settings.", - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - Computed: true, - Elem: utilizationSettingsResource, - }, - "callback": { - Description: "Callback media settings. If not set, this reverts to the default media type settings.", - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - Computed: true, - Elem: utilizationSettingsResource, - }, - "message": { - Description: "Message media settings. If not set, this reverts to the default media type settings.", - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - Computed: true, - Elem: utilizationSettingsResource, - }, - "email": { - Description: "Email media settings. If not set, this reverts to the default media type settings.", - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - Computed: true, - Elem: utilizationSettingsResource, - }, - "chat": { - Description: "Chat media settings. If not set, this reverts to the default media type settings.", - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - Computed: true, - Elem: utilizationSettingsResource, - }, - "label_utilizations": { - Description: "Label utilization settings. If not set, default label settings will be applied. This is in PREVIEW and should not be used unless the feature is available to your organization.", - Type: schema.TypeList, - Optional: true, - Computed: true, - Elem: utilizationLabelResource, - }, - }, - } -} - -func createRoutingUtilization(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - log.Printf("Creating Routing Utilization") - d.SetId("routing_utilization") - return updateRoutingUtilization(ctx, d, meta) -} - -func readRoutingUtilization(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - // Calling the Utilization API directly while the label feature is not available. - // Once it is, this code can go back to using platformclientv2's RoutingApi to make the call. - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - apiClient := &routingAPI.Configuration.APIClient - cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceRoutingSkill(), constants.DefaultConsistencyChecks, "genesyscloud_routing_utilization") - - path := fmt.Sprintf("%s/api/v2/routing/utilization", routingAPI.Configuration.BasePath) - headerParams := buildHeaderParams(routingAPI) - - log.Printf("Reading Routing Utilization") - return util.WithRetriesForRead(ctx, d, func() *retry.RetryError { - response, err := apiClient.CallAPI(path, "GET", nil, headerParams, nil, nil, "", nil) - if err != nil { - if util.IsStatus404(response) { - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_utilization", fmt.Sprintf("Failed to read Routing Utilization: %s", err), response)) - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_utilization", fmt.Sprintf("Failed to read Routing Utilization: %s", err), response)) - } - - orgUtilization := &OrgUtilizationWithLabels{} - err = json.Unmarshal(response.RawBody, &orgUtilization) - - if orgUtilization.Utilization != nil { - for sdkType, schemaType := range utilizationMediaTypes { - if mediaSettings, ok := orgUtilization.Utilization[sdkType]; ok { - d.Set(schemaType, flattenUtilizationSetting(mediaSettings)) - } else { - d.Set(schemaType, nil) - } - } - } - - if orgUtilization.LabelUtilizations != nil { - originalLabelUtilizations := d.Get("label_utilizations").([]interface{}) - - // Only add to the state the configured labels, in the configured order, but not any extras, to help terraform with matching new and old state. - flattenedLabelUtilizations := filterAndFlattenLabelUtilizations(orgUtilization.LabelUtilizations, originalLabelUtilizations) - d.Set("label_utilizations", flattenedLabelUtilizations) - } - - log.Printf("Read Routing Utilization") - return cc.CheckState(d) - }) -} - -func updateRoutingUtilization(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - - var resp *platformclientv2.APIResponse - var err error - - log.Printf("Updating Routing Utilization") - - labelUtilizations := d.Get("label_utilizations").([]interface{}) - - // Retrying on 409s because if a label is created immediately before the utilization update, it can lead to a conflict while the utilization is being updated to handle the new label. - diagErr := util.RetryWhen(util.IsStatus409, func() (*platformclientv2.APIResponse, diag.Diagnostics) { - // If the resource has label(s), calls the Utilization API directly. - // This code can go back to using platformclientv2's RoutingApi to make the call once label utilization is available in platformclientv2's RoutingApi. - if labelUtilizations != nil && len(labelUtilizations) > 0 { - apiClient := &routingAPI.Configuration.APIClient - - path := fmt.Sprintf("%s/api/v2/routing/utilization", routingAPI.Configuration.BasePath) - headerParams := buildHeaderParams(routingAPI) - requestPayload := make(map[string]interface{}) - requestPayload["utilization"] = buildSdkMediaUtilizations(d) - requestPayload["labelUtilizations"] = buildLabelUtilizationsRequest(labelUtilizations) - resp, err = apiClient.CallAPI(path, "PUT", requestPayload, headerParams, nil, nil, "", nil) - } else { - _, resp, err = routingAPI.PutRoutingUtilization(platformclientv2.Utilizationrequest{ - Utilization: buildSdkMediaUtilizations(d), - }) - } - - if err != nil { - return resp, util.BuildAPIDiagnosticError("genesyscloud_routing_utilization", fmt.Sprintf("Failed to update Routing Utilization %s error: %s", d.Id(), err), resp) - } - return resp, nil - }) - - if diagErr != nil { - return diagErr - } - - log.Printf("Updated Routing Utilization") - return readRoutingUtilization(ctx, d, meta) -} - -func deleteRoutingUtilization(_ context.Context, _ *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - - // Resets to default values - log.Printf("Resetting Routing Utilization") - resp, err := routingAPI.DeleteRoutingUtilization() - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_routing_utilization", fmt.Sprintf("Failed to reset Routing Utilization error: %s", err), resp) - } - log.Printf("Reset Routing Utilization") - return nil -} - -func flattenUtilizationSetting(settings MediaUtilization) []interface{} { - settingsMap := make(map[string]interface{}) - - settingsMap["maximum_capacity"] = settings.MaximumCapacity - settingsMap["include_non_acd"] = settings.IncludeNonAcd - if settings.InterruptableMediaTypes != nil { - settingsMap["interruptible_media_types"] = lists.StringListToSet(settings.InterruptableMediaTypes) - } - - return []interface{}{settingsMap} -} - -func filterAndFlattenLabelUtilizations(labelUtilizations map[string]LabelUtilization, originalLabelUtilizations []interface{}) []interface{} { - flattenedLabelUtilizations := make([]interface{}, 0) - - for _, originalLabelUtilization := range originalLabelUtilizations { - originalLabelId := (originalLabelUtilization.(map[string]interface{}))["label_id"].(string) - - for currentLabelId, currentLabelUtilization := range labelUtilizations { - if currentLabelId == originalLabelId { - flattenedLabelUtilizations = append(flattenedLabelUtilizations, flattenLabelUtilization(currentLabelId, currentLabelUtilization)) - delete(labelUtilizations, currentLabelId) - break - } - } - } - - return flattenedLabelUtilizations -} - -func flattenLabelUtilization(labelId string, labelUtilization LabelUtilization) map[string]interface{} { - utilizationMap := make(map[string]interface{}) - - utilizationMap["label_id"] = labelId - utilizationMap["maximum_capacity"] = labelUtilization.MaximumCapacity - if labelUtilization.InterruptingLabelIds != nil { - utilizationMap["interrupting_label_ids"] = lists.StringListToSet(labelUtilization.InterruptingLabelIds) - } - - return utilizationMap -} - -func buildSdkMediaUtilizations(d *schema.ResourceData) *map[string]platformclientv2.Mediautilization { - settings := make(map[string]platformclientv2.Mediautilization) - - for sdkType, schemaType := range utilizationMediaTypes { - mediaSettings := d.Get(schemaType).([]interface{}) - if mediaSettings != nil && len(mediaSettings) > 0 { - settings[sdkType] = buildSdkMediaUtilization(mediaSettings) - } - } - - return &settings -} - -func buildSdkMediaUtilization(settings []interface{}) platformclientv2.Mediautilization { - settingsMap := settings[0].(map[string]interface{}) - - maxCapacity := settingsMap["maximum_capacity"].(int) - includeNonAcd := settingsMap["include_non_acd"].(bool) - - // Optional - interruptableMediaTypes := &[]string{} - if types, ok := settingsMap["interruptible_media_types"]; ok { - interruptableMediaTypes = lists.SetToStringList(types.(*schema.Set)) - } - - return platformclientv2.Mediautilization{ - MaximumCapacity: &maxCapacity, - IncludeNonAcd: &includeNonAcd, - InterruptableMediaTypes: interruptableMediaTypes, - } -} - -func buildLabelUtilizationsRequest(labelUtilizations []interface{}) map[string]LabelUtilization { - request := make(map[string]LabelUtilization) - for _, labelUtilization := range labelUtilizations { - labelUtilizationMap := labelUtilization.(map[string]interface{}) - interruptingLabelIds := lists.SetToStringList(labelUtilizationMap["interrupting_label_ids"].(*schema.Set)) - - request[labelUtilizationMap["label_id"].(string)] = LabelUtilization{ - MaximumCapacity: int32(labelUtilizationMap["maximum_capacity"].(int)), - InterruptingLabelIds: *interruptingLabelIds, - } - } - return request -} diff --git a/genesyscloud/resource_genesyscloud_routing_utilization_label.go b/genesyscloud/resource_genesyscloud_routing_utilization_label.go deleted file mode 100644 index 209be66a0..000000000 --- a/genesyscloud/resource_genesyscloud_routing_utilization_label.go +++ /dev/null @@ -1,162 +0,0 @@ -package genesyscloud - -import ( - "context" - "fmt" - "log" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" - "terraform-provider-genesyscloud/genesyscloud/util/constants" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - - "terraform-provider-genesyscloud/genesyscloud/consistency_checker" - - resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" -) - -func getAllRoutingUtilizationLabels(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { - resources := make(resourceExporter.ResourceIDMetaMap) - routingAPI := platformclientv2.NewRoutingApiWithConfig(clientConfig) - - for pageNum := 1; ; pageNum++ { - const pageSize = 100 - labels, resp, getErr := routingAPI.GetRoutingUtilizationLabels(pageSize, pageNum, "", "") - if getErr != nil { - return nil, util.BuildAPIDiagnosticError("genesyscloud_routing_utilization_label", fmt.Sprintf("Failed to get page of labels error: %s", getErr), resp) - } - - if labels.Entities == nil || len(*labels.Entities) == 0 { - break - } - - for _, label := range *labels.Entities { - resources[*label.Id] = &resourceExporter.ResourceMeta{Name: *label.Name} - } - } - - return resources, nil -} - -func RoutingUtilizationLabelExporter() *resourceExporter.ResourceExporter { - return &resourceExporter.ResourceExporter{ - GetResourcesFunc: provider.GetAllWithPooledClient(getAllRoutingUtilizationLabels), - RefAttrs: map[string]*resourceExporter.RefAttrSettings{}, // No references - } -} - -func ResourceRoutingUtilizationLabel() *schema.Resource { - return &schema.Resource{ - Description: "Genesys Cloud Routing Utilization Label. This resource is not yet widely available. Only use it if the feature is enabled.", - - CreateContext: provider.CreateWithPooledClient(createRoutingUtilizationLabel), - ReadContext: provider.ReadWithPooledClient(readRoutingUtilizationLabel), - UpdateContext: provider.UpdateWithPooledClient(updateRoutingUtilizationLabel), - DeleteContext: provider.DeleteWithPooledClient(deleteRoutingUtilizationLabel), - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - SchemaVersion: 1, - Schema: map[string]*schema.Schema{ - "name": { - Description: "Label name.", - Type: schema.TypeString, - Required: true, - }, - }, - } -} - -func createRoutingUtilizationLabel(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - name := d.Get("name").(string) - - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - - log.Printf("Creating label %s", name) - label, resp, err := routingAPI.PostRoutingUtilizationLabels(platformclientv2.Createutilizationlabelrequest{ - Name: &name, - }) - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_routing_utilization_label", fmt.Sprintf("Failed to create label %s error: %s", name, err), resp) - } - - d.SetId(*label.Id) - - log.Printf("Created label %s %s", name, *label.Id) - return readRoutingUtilizationLabel(ctx, d, meta) -} - -func updateRoutingUtilizationLabel(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - - id := d.Id() - name := d.Get("name").(string) - - log.Printf("Updating label %s with name %s", id, name) - - _, resp, err := routingAPI.PutRoutingUtilizationLabel(id, platformclientv2.Updateutilizationlabelrequest{ - Name: &name, - }) - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_routing_utilization_label", fmt.Sprintf("Failed to update label %s error: %s", id, err), resp) - } - - log.Printf("Updated label %s", id) - return readRoutingUtilizationLabel(ctx, d, meta) -} - -func readRoutingUtilizationLabel(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - routingApi := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceRoutingUtilizationLabel(), constants.DefaultConsistencyChecks, "genesyscloud_routing_utilization_label") - - log.Printf("Reading label %s", d.Id()) - return util.WithRetriesForRead(ctx, d, func() *retry.RetryError { - label, resp, getErr := routingApi.GetRoutingUtilizationLabel(d.Id()) - if getErr != nil { - if util.IsStatus404(resp) { - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_utilization_label", fmt.Sprintf("Failed to read label %s | error: %s", d.Id(), getErr), resp)) - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_utilization_label", fmt.Sprintf("Failed to read label %s | error: %s", d.Id(), getErr), resp)) - } - - d.Set("name", *label.Name) - log.Printf("Read label %s %s", d.Id(), *label.Name) - return cc.CheckState(d) - }) -} - -func deleteRoutingUtilizationLabel(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - name := d.Get("name").(string) - - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - routingApi := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - - log.Printf("Deleting label %s", name) - resp, err := routingApi.DeleteRoutingUtilizationLabel(d.Id(), true) - - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_routing_utilization_label", fmt.Sprintf("Failed to delete label %s error: %s", name, err), resp) - } - - return util.WithRetries(ctx, 30*time.Second, func() *retry.RetryError { - _, resp, err := routingApi.GetRoutingUtilizationLabel(d.Id()) - if err != nil { - if util.IsStatus404(resp) { - // Routing label deleted - log.Printf("Deleted Routing label %s", d.Id()) - return nil - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_utilization_label", fmt.Sprintf("Error deleting Routing label %s: %s", d.Id(), err), resp)) - } - - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_utilization_label", fmt.Sprintf("Routing label %s still exists", d.Id()), resp)) - }) -} diff --git a/genesyscloud/resource_genesyscloud_routing_wrapupcode.go b/genesyscloud/resource_genesyscloud_routing_wrapupcode.go index 32e3be970..962e28073 100644 --- a/genesyscloud/resource_genesyscloud_routing_wrapupcode.go +++ b/genesyscloud/resource_genesyscloud_routing_wrapupcode.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllRoutingWrapupCodes(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_routing_wrapupcode_test.go b/genesyscloud/resource_genesyscloud_routing_wrapupcode_test.go index 7102e6167..d4becc64d 100644 --- a/genesyscloud/resource_genesyscloud_routing_wrapupcode_test.go +++ b/genesyscloud/resource_genesyscloud_routing_wrapupcode_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceRoutingWrapupcode(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_user.go b/genesyscloud/resource_genesyscloud_user.go index 8387da786..79baca358 100644 --- a/genesyscloud/resource_genesyscloud_user.go +++ b/genesyscloud/resource_genesyscloud_user.go @@ -7,6 +7,7 @@ import ( "log" "strings" "terraform-provider-genesyscloud/genesyscloud/provider" + routingUtilization "terraform-provider-genesyscloud/genesyscloud/routing_utilization" "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/constants" "terraform-provider-genesyscloud/genesyscloud/validators" @@ -23,14 +24,14 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/nyaruka/phonenumbers" ) type AgentUtilizationWithLabels struct { - Utilization map[string]MediaUtilization `json:"utilization"` - LabelUtilizations map[string]LabelUtilization `json:"labelUtilizations"` - Level string `json:"level"` + Utilization map[string]routingUtilization.MediaUtilization `json:"utilization"` + LabelUtilizations map[string]routingUtilization.LabelUtilization `json:"labelUtilizations"` + Level string `json:"level"` } var ( @@ -377,7 +378,7 @@ func ResourceUser() *schema.Resource { Optional: true, Computed: true, ConfigMode: schema.SchemaConfigModeAttr, - Elem: utilizationSettingsResource, + Elem: routingUtilization.UtilizationSettingsResource, }, "callback": { Description: "Callback media settings. If not set, this reverts to the default media type settings.", @@ -386,7 +387,7 @@ func ResourceUser() *schema.Resource { Optional: true, Computed: true, ConfigMode: schema.SchemaConfigModeAttr, - Elem: utilizationSettingsResource, + Elem: routingUtilization.UtilizationSettingsResource, }, "message": { Description: "Message media settings. If not set, this reverts to the default media type settings.", @@ -395,7 +396,7 @@ func ResourceUser() *schema.Resource { Optional: true, Computed: true, ConfigMode: schema.SchemaConfigModeAttr, - Elem: utilizationSettingsResource, + Elem: routingUtilization.UtilizationSettingsResource, }, "email": { Description: "Email media settings. If not set, this reverts to the default media type settings.", @@ -404,7 +405,7 @@ func ResourceUser() *schema.Resource { Optional: true, Computed: true, ConfigMode: schema.SchemaConfigModeAttr, - Elem: utilizationSettingsResource, + Elem: routingUtilization.UtilizationSettingsResource, }, "chat": { Description: "Chat media settings. If not set, this reverts to the default media type settings.", @@ -413,7 +414,7 @@ func ResourceUser() *schema.Resource { Optional: true, Computed: true, ConfigMode: schema.SchemaConfigModeAttr, - Elem: utilizationSettingsResource, + Elem: routingUtilization.UtilizationSettingsResource, }, "label_utilizations": { Description: "Label utilization settings. If not set, default label settings will be applied. This is in PREVIEW and should not be used unless the feature is available to your organization.", @@ -421,7 +422,7 @@ func ResourceUser() *schema.Resource { Optional: true, Computed: true, ConfigMode: schema.SchemaConfigModeAttr, - Elem: utilizationLabelResource, + Elem: routingUtilization.UtilizationLabelResource, }, }, }, @@ -1050,7 +1051,7 @@ func readUserRoutingUtilization(d *schema.ResourceData, sdkConfig *platformclien apiClient := &routingAPI.Configuration.APIClient path := fmt.Sprintf("%s/api/v2/routing/users/%s/utilization", routingAPI.Configuration.BasePath, d.Id()) - headerParams := buildHeaderParams(routingAPI) + headerParams := BuildHeaderParams(routingAPI) response, err := apiClient.CallAPI(path, "GET", nil, headerParams, nil, nil, "", nil) if err != nil { @@ -1073,9 +1074,9 @@ func readUserRoutingUtilization(d *schema.ResourceData, sdkConfig *platformclien allSettings := map[string]interface{}{} if agentUtilization.Utilization != nil { - for sdkType, schemaType := range utilizationMediaTypes { + for sdkType, schemaType := range routingUtilization.UtilizationMediaTypes { if mediaSettings, ok := agentUtilization.Utilization[sdkType]; ok { - allSettings[schemaType] = flattenUtilizationSetting(mediaSettings) + allSettings[schemaType] = routingUtilization.FlattenUtilizationSetting(mediaSettings) } } } @@ -1087,7 +1088,7 @@ func readUserRoutingUtilization(d *schema.ResourceData, sdkConfig *platformclien originalLabelUtilizations := originalSettings["label_utilizations"].([]interface{}) // Only add to the state the configured labels, in the configured order, but not any extras, to help terraform with matching new and old state. - filteredLabelUtilizations := filterAndFlattenLabelUtilizations(agentUtilization.LabelUtilizations, originalLabelUtilizations) + filteredLabelUtilizations := routingUtilization.FilterAndFlattenLabelUtilizations(agentUtilization.LabelUtilizations, originalLabelUtilizations) allSettings["label_utilizations"] = filteredLabelUtilizations } else { @@ -1293,16 +1294,17 @@ func updateUserRoutingUtilization(d *schema.ResourceData, usersAPI *platformclie apiClient := &routingAPI.Configuration.APIClient path := fmt.Sprintf("%s/api/v2/routing/users/%s/utilization", routingAPI.Configuration.BasePath, d.Id()) - headerParams := buildHeaderParams(routingAPI) + headerParams := BuildHeaderParams(routingAPI) requestPayload := make(map[string]interface{}) requestPayload["utilization"] = buildMediaTypeUtilizations(allSettings) - requestPayload["labelUtilizations"] = buildLabelUtilizationsRequest(labelUtilizations) + + requestPayload["labelUtilizations"] = routingUtilization.BuildLabelUtilizationsRequest(labelUtilizations) _, err = apiClient.CallAPI(path, "PUT", requestPayload, headerParams, nil, nil, "", nil) } else { sdkSettings := make(map[string]platformclientv2.Mediautilization) - for sdkType, schemaType := range utilizationMediaTypes { + for sdkType, schemaType := range routingUtilization.UtilizationMediaTypes { if mediaSettings, ok := allSettings[schemaType]; ok && len(mediaSettings.([]interface{})) > 0 { - sdkSettings[sdkType] = buildSdkMediaUtilization(mediaSettings.([]interface{})) + sdkSettings[sdkType] = routingUtilization.BuildSdkMediaUtilization(mediaSettings.([]interface{})) } } @@ -1391,10 +1393,10 @@ func flattenUserCertifications(certs *[]string) *schema.Set { func buildMediaTypeUtilizations(allUtilizations map[string]interface{}) *map[string]platformclientv2.Mediautilization { settings := make(map[string]platformclientv2.Mediautilization) - for sdkType, schemaType := range utilizationMediaTypes { + for sdkType, schemaType := range routingUtilization.UtilizationMediaTypes { mediaSettings := allUtilizations[schemaType].([]interface{}) if mediaSettings != nil && len(mediaSettings) > 0 { - settings[sdkType] = buildSdkMediaUtilization(mediaSettings) + settings[sdkType] = routingUtilization.BuildSdkMediaUtilization(mediaSettings) } } diff --git a/genesyscloud/resource_genesyscloud_user_test.go b/genesyscloud/resource_genesyscloud_user_test.go index 37c39f245..c064114ea 100644 --- a/genesyscloud/resource_genesyscloud_user_test.go +++ b/genesyscloud/resource_genesyscloud_user_test.go @@ -6,6 +6,8 @@ import ( "strconv" "strings" "terraform-provider-genesyscloud/genesyscloud/provider" + routingUtilization "terraform-provider-genesyscloud/genesyscloud/routing_utilization" + routingUtilizationLabel "terraform-provider-genesyscloud/genesyscloud/routing_utilization_label" "terraform-provider-genesyscloud/genesyscloud/util" "testing" "time" @@ -14,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceUserBasic(t *testing.T) { @@ -731,11 +733,11 @@ func TestAccResourceUserroutingUtil(t *testing.T) { email1, userName, generateUserRoutingUtil( - generateRoutingUtilMediaType("call", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("callback", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("chat", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("email", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("message", maxCapacity1, util.FalseValue), + routingUtilization.GenerateRoutingUtilMediaType("call", maxCapacity1, util.FalseValue), + routingUtilization.GenerateRoutingUtilMediaType("callback", maxCapacity1, util.FalseValue), + routingUtilization.GenerateRoutingUtilMediaType("chat", maxCapacity1, util.FalseValue), + routingUtilization.GenerateRoutingUtilMediaType("email", maxCapacity1, util.FalseValue), + routingUtilization.GenerateRoutingUtilMediaType("message", maxCapacity1, util.FalseValue), ), ), Check: resource.ComposeTestCheckFunc( @@ -764,11 +766,11 @@ func TestAccResourceUserroutingUtil(t *testing.T) { email1, userName, generateUserRoutingUtil( - generateRoutingUtilMediaType("call", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeEmail)), - generateRoutingUtilMediaType("callback", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("chat", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("email", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("message", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("call", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeEmail)), + routingUtilization.GenerateRoutingUtilMediaType("callback", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("chat", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("email", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("message", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), ), ), Check: resource.ComposeTestCheckFunc( @@ -797,11 +799,11 @@ func TestAccResourceUserroutingUtil(t *testing.T) { email1, userName, generateUserRoutingUtil( - generateRoutingUtilMediaType("call", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeEmail)), - generateRoutingUtilMediaType("callback", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("chat", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("email", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("message", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("call", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeEmail)), + routingUtilization.GenerateRoutingUtilMediaType("callback", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("chat", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("email", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("message", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), ), ), Check: resource.ComposeTestCheckFunc( @@ -864,7 +866,7 @@ func TestAccResourceUserroutingUtilWithLabels(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) - if err := checkIfLabelsAreEnabled(); err != nil { + if err := routingUtilizationLabel.CheckIfLabelsAreEnabled(); err != nil { t.Skipf("%v", err) // be sure to skip the test and not fail it } }, @@ -872,21 +874,21 @@ func TestAccResourceUserroutingUtilWithLabels(t *testing.T) { Steps: []resource.TestStep{ { // Create with utilization settings - Config: GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + - GenerateRoutingUtilizationLabelResource(blueLabelResource, blueLabelName, redLabelResource) + - GenerateRoutingUtilizationLabelResource(greenLabelResource, greenLabelName, blueLabelResource) + + Config: routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + + routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(blueLabelResource, blueLabelName, redLabelResource) + + routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(greenLabelResource, greenLabelName, blueLabelResource) + generateUserWithCustomAttrs( userResource1, email1, userName, generateUserRoutingUtil( - generateRoutingUtilMediaType("call", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("callback", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("chat", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("email", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("message", maxCapacity1, util.FalseValue), - generateLabelUtilization(redLabelResource, maxCapacity1), - generateLabelUtilization(blueLabelResource, maxCapacity1, redLabelResource), + routingUtilization.GenerateRoutingUtilMediaType("call", maxCapacity1, util.FalseValue), + routingUtilization.GenerateRoutingUtilMediaType("callback", maxCapacity1, util.FalseValue), + routingUtilization.GenerateRoutingUtilMediaType("chat", maxCapacity1, util.FalseValue), + routingUtilization.GenerateRoutingUtilMediaType("email", maxCapacity1, util.FalseValue), + routingUtilization.GenerateRoutingUtilMediaType("message", maxCapacity1, util.FalseValue), + routingUtilizationLabel.GenerateLabelUtilization(redLabelResource, maxCapacity1), + routingUtilizationLabel.GenerateLabelUtilization(blueLabelResource, maxCapacity1, redLabelResource), ), ), Check: resource.ComposeTestCheckFunc( @@ -914,21 +916,21 @@ func TestAccResourceUserroutingUtilWithLabels(t *testing.T) { }, { // Update utilization settings and set different org-level settings - Config: GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + - GenerateRoutingUtilizationLabelResource(blueLabelResource, blueLabelName, redLabelResource) + - GenerateRoutingUtilizationLabelResource(greenLabelResource, greenLabelName, blueLabelResource) + + Config: routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + + routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(blueLabelResource, blueLabelName, redLabelResource) + + routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(greenLabelResource, greenLabelName, blueLabelResource) + generateUserWithCustomAttrs( userResource1, email1, userName, generateUserRoutingUtil( - generateRoutingUtilMediaType("call", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeEmail)), - generateRoutingUtilMediaType("callback", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("chat", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("email", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("message", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateLabelUtilization(redLabelResource, maxCapacity2), - generateLabelUtilization(blueLabelResource, maxCapacity2, redLabelResource), + routingUtilization.GenerateRoutingUtilMediaType("call", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeEmail)), + routingUtilization.GenerateRoutingUtilMediaType("callback", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("chat", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("email", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("message", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilizationLabel.GenerateLabelUtilization(redLabelResource, maxCapacity2), + routingUtilizationLabel.GenerateLabelUtilization(blueLabelResource, maxCapacity2, redLabelResource), ), ), Check: resource.ComposeTestCheckFunc( @@ -956,21 +958,21 @@ func TestAccResourceUserroutingUtilWithLabels(t *testing.T) { }, { // Ensure max capacity can be set to 0 - Config: GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + - GenerateRoutingUtilizationLabelResource(blueLabelResource, blueLabelName, redLabelResource) + - GenerateRoutingUtilizationLabelResource(greenLabelResource, greenLabelName, blueLabelResource) + + Config: routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + + routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(blueLabelResource, blueLabelName, redLabelResource) + + routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(greenLabelResource, greenLabelName, blueLabelResource) + generateUserWithCustomAttrs( userResource1, email1, userName, generateUserRoutingUtil( - generateRoutingUtilMediaType("call", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeEmail)), - generateRoutingUtilMediaType("callback", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("chat", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("email", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("message", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), - generateLabelUtilization(redLabelResource, maxCapacity0), - generateLabelUtilization(blueLabelResource, maxCapacity0, redLabelResource), + routingUtilization.GenerateRoutingUtilMediaType("call", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeEmail)), + routingUtilization.GenerateRoutingUtilMediaType("callback", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("chat", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("email", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilization.GenerateRoutingUtilMediaType("message", maxCapacity0, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilizationLabel.GenerateLabelUtilization(redLabelResource, maxCapacity0), + routingUtilizationLabel.GenerateLabelUtilization(blueLabelResource, maxCapacity0, redLabelResource), ), ), Check: resource.ComposeTestCheckFunc( diff --git a/genesyscloud/resource_genesyscloud_widget_deployment.go b/genesyscloud/resource_genesyscloud_widget_deployment.go index 9ca823d39..54ef064af 100644 --- a/genesyscloud/resource_genesyscloud_widget_deployment.go +++ b/genesyscloud/resource_genesyscloud_widget_deployment.go @@ -4,10 +4,11 @@ import ( "context" "fmt" "log" - "net/url" + "strings" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/constants" + "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "time" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" @@ -15,40 +16,34 @@ import ( "terraform-provider-genesyscloud/genesyscloud/consistency_checker" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" - lists "terraform-provider-genesyscloud/genesyscloud/util/lists" + "terraform-provider-genesyscloud/genesyscloud/util/lists" - "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) const ( - V1 = "v1" - V1HTTP = "v1-http" - V2 = "v2" - THIRDPARTY = "third-party" - HTTPSPROTOCOL = "https" - WEBSKINBASIC = "basic" - WEBSKINMODERN = "modern-caret-skin" + V1 = "v1" + V1HTTP = "v1-http" + V2 = "v2" + THIRDPARTY = "third-party" ) var ( + validClientTypes = []string{V1, V1HTTP, V2, THIRDPARTY} clientConfigSchemaResource = &schema.Resource{ Schema: map[string]*schema.Schema{ "webchat_skin": { - Description: "Skin for the webchat user. (basic, modern-caret-skin)", - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{WEBSKINBASIC, WEBSKINMODERN}, false), + Description: "Skin for the webchat user. (basic, modern-caret-skin)", + Type: schema.TypeString, + Optional: true, }, "authentication_url": { - Description: "Url endpoint to perform_authentication", - Type: schema.TypeString, - Required: false, - Optional: true, - ValidateDiagFunc: validateAuthURL, + Description: "Url endpoint to perform_authentication", + Type: schema.TypeString, + Optional: true, }, }, } @@ -69,78 +64,6 @@ func getAllWidgetDeployments(_ context.Context, clientConfig *platformclientv2.C return resources, nil } -func buildSdkAllowedDomains(d *schema.ResourceData) *[]string { - allowed_domains := []string{} - if domains, ok := d.GetOk("allowed_domains"); ok { - allowed_domains = lists.InterfaceListToStrings(domains.([]interface{})) - } - return &allowed_domains -} - -func parseSdkClientConfigData(d *schema.ResourceData) (webchatSkin *string, authenticationUrl *string) { - clientConfigSet := d.Get("client_config").(*schema.Set) - - if clientConfigSet != nil && len(clientConfigSet.List()) > 0 { - clientConfig := clientConfigSet.List()[0].(map[string]interface{}) - fields := make(map[string]string) - - for k, v := range clientConfig { - fields[k] = v.(string) - } - - webchatSkin := fields["webchat_skin"] - authUrl := fields["authentication_url"] - return &webchatSkin, &authUrl - } - return nil, nil -} - -func validateAuthURL(authUrl interface{}, _ cty.Path) diag.Diagnostics { - authUrlString := authUrl.(string) - u, err := url.Parse(authUrlString) - if err != nil { - return util.BuildDiagnosticError("genesyscloud_widget_deployment", fmt.Sprintf("Authorization url %s provided is not a valid URL", authUrlString), err) - } - - if u.Scheme == "" || u.Host == "" { - log.Printf("Scheme: %s", u.Scheme) - log.Printf("Host: %s", u.Host) - return util.BuildDiagnosticError("genesyscloud_widget_deployment", fmt.Sprintf("Authorization url %s provided is not valid url", authUrlString), fmt.Errorf("authorization url provided is not valid url")) - } - - if u.Scheme != HTTPSPROTOCOL { - return util.BuildDiagnosticError("genesyscloud_widget_deployment", fmt.Sprintf("Authorization url provided must begin with https"), fmt.Errorf("authorization url provided must begin with https")) - - } - - return nil -} - -func buildSDKClientConfig(clientType string, d *schema.ResourceData) (*platformclientv2.Widgetclientconfig, error) { - widgetClientConfig := &platformclientv2.Widgetclientconfig{} - clientConfig := d.Get("client_config").(*schema.Set) - - if (clientType == V1 || clientType == V1HTTP) && clientConfig.Len() == 0 { - return nil, fmt.Errorf("V1 and v1-http widget configurations must have a client_config defined. ") - } - - if clientType == V1 { - v1Client := &platformclientv2.Widgetclientconfigv1{} - - v1Client.WebChatSkin, v1Client.AuthenticationUrl = parseSdkClientConfigData(d) - - widgetClientConfig.V1 = v1Client - } - - if clientType == V1HTTP { - v1HttpClient := &platformclientv2.Widgetclientconfigv1http{} - v1HttpClient.WebChatSkin, v1HttpClient.AuthenticationUrl = parseSdkClientConfigData(d) - widgetClientConfig.V1Http = v1HttpClient - } - - return widgetClientConfig, nil -} - func WidgetDeploymentExporter() *resourceExporter.ResourceExporter { return &resourceExporter.ResourceExporter{ GetResourcesFunc: provider.GetAllWithPooledClient(getAllWidgetDeployments), @@ -192,56 +115,38 @@ func ResourceWidgetDeployment() *schema.Resource { Description: "The list of domains that are approved to use this Deployment; the list will be added to CORS headers for ease of web use", Type: schema.TypeList, Elem: &schema.Schema{Type: schema.TypeString}, - Required: false, Optional: true, }, "client_type": { - Description: "The type of display widget for which this Deployment is configured, which controls the administrator settings shown.Valid values: v1, v2, v1-http, third-party.", + Description: "The type of display widget for which this Deployment is configured, which controls the administrator settings shown. Valid values: " + strings.Join(validClientTypes, ", "), Type: schema.TypeString, Required: true, - ValidateFunc: validation.StringInSlice([]string{V1, V2, V1HTTP, THIRDPARTY}, false), + ValidateFunc: validation.StringInSlice(validClientTypes, false), }, "client_config": { - Description: " The V1 and V1-http client configuration options that should be made available to the clients of this Deployment.", + Description: "The V1 and V1-http client configuration options that should be made available to the clients of this Deployment.", Type: schema.TypeSet, MaxItems: 1, Optional: true, - Elem: clientConfigSchemaResource, + // when this field is removed, V1 and V1HTTP should also be removed from validClientTypes list + Deprecated: "This field is inactive and will be removed entirely in a later version. Please use `v2_client_config` or `third_party_client_config` instead.", + Elem: clientConfigSchemaResource, + }, + "v2_client_config": { + Description: "The v2 client configuration options that should be made available to the clients of this Deployment.", + Type: schema.TypeMap, + Optional: true, + }, + "third_party_client_config": { + Description: "The third party client configuration options that should be made available to the clients of this Deployment.", + Type: schema.TypeMap, + Optional: true, + ConflictsWith: []string{"v2_client_config"}, }, }, } } -func flattenClientConfig(clientType string, clientConfig platformclientv2.Widgetclientconfig) *schema.Set { - clientConfigSet := schema.NewSet(schema.HashResource(clientConfigSchemaResource), []interface{}{}) - - clientConfigMap := make(map[string]interface{}) - - if clientType == V1 { - if clientConfig.V1.WebChatSkin != nil { - clientConfigMap["webchat_skin"] = *clientConfig.V1.WebChatSkin - } - - if clientConfig.V1.AuthenticationUrl != nil { - clientConfigMap["authentication_url"] = *clientConfig.V1.AuthenticationUrl - } - } - - if clientType == V1HTTP { - if clientConfig.V1Http.WebChatSkin != nil { - clientConfigMap["webchat_skin"] = *clientConfig.V1Http.WebChatSkin - } - - if clientConfig.V1Http.AuthenticationUrl != nil { - clientConfigMap["authentication_url"] = *clientConfig.V1Http.AuthenticationUrl - } - } - - clientConfigSet.Add(clientConfigMap) - - return clientConfigSet -} - func readWidgetDeployment(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { sdkConfig := meta.(*provider.ProviderMeta).ClientConfig widgetsAPI := platformclientv2.NewWidgetsApiWithConfig(sdkConfig) @@ -259,47 +164,15 @@ func readWidgetDeployment(ctx context.Context, d *schema.ResourceData, meta inte return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_widget_deployment", fmt.Sprintf("Failed to read widget deployment %s | error: %s", d.Id(), getErr), resp)) } - d.Set("name", *currentWidget.Name) - if currentWidget.Description != nil { - d.Set("description", *currentWidget.Description) - } else { - d.Set("description", nil) - } - - if currentWidget.AuthenticationRequired != nil { - d.Set("authentication_required", *currentWidget.AuthenticationRequired) - } else { - d.Set("authentication_required", nil) - } - - if currentWidget.Disabled != nil { - d.Set("disabled", *currentWidget.Disabled) - } else { - d.Set("disabled", nil) - } - - if currentWidget.Flow != nil { - d.Set("flow_id", *currentWidget.Flow.Id) - } else { - d.Set("flow_id", nil) - } - - if currentWidget.AllowedDomains != nil { - d.Set("allowed_domains", *currentWidget.AllowedDomains) - } else { - d.Set("allowed_domains", nil) - } - - if currentWidget.ClientType != nil { - d.Set("client_type", *currentWidget.ClientType) - } else { - d.Set("client_type", nil) - } - + _ = d.Set("name", *currentWidget.Name) + resourcedata.SetNillableValue(d, "description", currentWidget.Description) + resourcedata.SetNillableValue(d, "authentication_required", currentWidget.AuthenticationRequired) + resourcedata.SetNillableValue(d, "disabled", currentWidget.Disabled) + resourcedata.SetNillableValue(d, "allowed_domains", currentWidget.AllowedDomains) + resourcedata.SetNillableValue(d, "client_type", currentWidget.ClientType) + resourcedata.SetNillableReference(d, "flow_id", currentWidget.Flow) if currentWidget.ClientConfig != nil { - d.Set("client_config", flattenClientConfig(*currentWidget.ClientType, *currentWidget.ClientConfig)) - } else { - d.Set("client_config", nil) + flattenClientConfig(d, *currentWidget.ClientConfig) } return cc.CheckState(d) @@ -308,30 +181,19 @@ func readWidgetDeployment(ctx context.Context, d *schema.ResourceData, meta inte func createWidgetDeployment(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { name := d.Get("name").(string) - description := d.Get("description").(string) - auth_required := d.Get("authentication_required").(bool) - disabled := d.Get("disabled").(bool) - flowId := util.BuildSdkDomainEntityRef(d, "flow_id") - allowed_domains := buildSdkAllowedDomains(d) //Need to make this an array of strings. - client_type := d.Get("client_type").(string) - client_config, client_config_err := buildSDKClientConfig(client_type, d) - - if client_config_err != nil { - return util.BuildDiagnosticError("genesyscloud_widget_deployment", fmt.Sprintf("Failed to create widget deployment %s", name), client_config_err) - } sdkConfig := meta.(*provider.ProviderMeta).ClientConfig widgetsAPI := platformclientv2.NewWidgetsApiWithConfig(sdkConfig) createWidget := platformclientv2.Widgetdeployment{ Name: &name, - Description: &description, - AuthenticationRequired: &auth_required, - Disabled: &disabled, - Flow: flowId, - AllowedDomains: allowed_domains, - ClientType: &client_type, - ClientConfig: client_config, + Description: platformclientv2.String(d.Get("description").(string)), + AuthenticationRequired: platformclientv2.Bool(d.Get("authentication_required").(bool)), + Disabled: platformclientv2.Bool(d.Get("disabled").(bool)), + Flow: util.BuildSdkDomainEntityRef(d, "flow_id"), + AllowedDomains: buildSdkAllowedDomains(d), + ClientType: platformclientv2.String(d.Get("client_type").(string)), + ClientConfig: buildSDKClientConfig(d), } log.Printf("Creating widgets deployment %s", name) @@ -355,28 +217,6 @@ func createWidgetDeployment(ctx context.Context, d *schema.ResourceData, meta in return readWidgetDeployment(ctx, d, meta) } -// Sometimes the Widget API creates 2 deployments due to a bug. This function will delete any duplicates -func deletePotentialDuplicateDeployments(widgetAPI *platformclientv2.WidgetsApi, name, id string, existingResourceIDMetaMap, newResourceIDMetaMap resourceExporter.ResourceIDMetaMap) { - for _, val := range existingResourceIDMetaMap { - for key1, val1 := range newResourceIDMetaMap { - if val.Name == val1.Name { - delete(newResourceIDMetaMap, key1) - break - } - } - } - - for key, val := range newResourceIDMetaMap { - if key != id && val.Name == name { - log.Printf("Deleting duplicate widget deployment %s", name) - _, err := widgetAPI.DeleteWidgetsDeployment(key) - if err != nil { - log.Printf("failed to delete widget deployment %s: %s", name, err) - } - } - } -} - func deleteWidgetDeployment(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { name := d.Get("name").(string) @@ -404,30 +244,19 @@ func deleteWidgetDeployment(ctx context.Context, d *schema.ResourceData, meta in func updateWidgetDeployment(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { name := d.Get("name").(string) - description := d.Get("description").(string) - auth_required := d.Get("authentication_required").(bool) - disabled := d.Get("disabled").(bool) - flowId := util.BuildSdkDomainEntityRef(d, "flow_id") - allowed_domains := buildSdkAllowedDomains(d) //Need to make this an array of strings. - client_type := d.Get("client_type").(string) - client_config, client_config_err := buildSDKClientConfig(client_type, d) - - if client_config_err != nil { - return util.BuildDiagnosticError("genesyscloud_widget_deployment", fmt.Sprintf("Failed updating widget deployment %s", name), client_config_err) - } sdkConfig := meta.(*provider.ProviderMeta).ClientConfig widgetsAPI := platformclientv2.NewWidgetsApiWithConfig(sdkConfig) updateWidget := platformclientv2.Widgetdeployment{ Name: &name, - Description: &description, - AuthenticationRequired: &auth_required, - Disabled: &disabled, - Flow: flowId, - AllowedDomains: allowed_domains, - ClientType: &client_type, - ClientConfig: client_config, + Description: platformclientv2.String(d.Get("description").(string)), + AuthenticationRequired: platformclientv2.Bool(d.Get("authentication_required").(bool)), + Disabled: platformclientv2.Bool(d.Get("disabled").(bool)), + Flow: util.BuildSdkDomainEntityRef(d, "flow_id"), + AllowedDomains: buildSdkAllowedDomains(d), + ClientType: platformclientv2.String(d.Get("client_type").(string)), + ClientConfig: buildSDKClientConfig(d), } log.Printf("Updating widget deployment %s", name) @@ -440,3 +269,61 @@ func updateWidgetDeployment(ctx context.Context, d *schema.ResourceData, meta in log.Printf("Finished updating widget deployment %s", name) return readWidgetDeployment(ctx, d, meta) } + +func buildSDKClientConfig(d *schema.ResourceData) *platformclientv2.Widgetclientconfig { + v2ClientConfig := d.Get("v2_client_config") + if m, ok := v2ClientConfig.(map[string]any); ok && len(m) > 0 { + return &platformclientv2.Widgetclientconfig{V2: &v2ClientConfig} + } + thirdPartyClientConfig := d.Get("third_party_client_config") + if m, ok := thirdPartyClientConfig.(map[string]any); ok && len(m) > 0 { + return &platformclientv2.Widgetclientconfig{ThirdParty: &thirdPartyClientConfig} + } + return nil +} + +func buildSdkAllowedDomains(d *schema.ResourceData) *[]string { + if domains, ok := d.Get("allowed_domains").([]any); ok { + allowedDomains := lists.InterfaceListToStrings(domains) + return &allowedDomains + } + return nil +} + +func flattenClientConfig(d *schema.ResourceData, config platformclientv2.Widgetclientconfig) { + if config.ThirdParty != nil { + thirdParty := *config.ThirdParty + if thirdPartyMap, _ := thirdParty.(map[string]any); len(thirdPartyMap) > 0 { + _ = d.Set("third_party_client_config", thirdPartyMap) + return + } + } + if config.V2 != nil { + v2Config := *config.V2 + if v2ConfigMap, _ := v2Config.(map[string]any); len(v2ConfigMap) > 0 { + _ = d.Set("v2_client_config", v2ConfigMap) + } + } +} + +// deletePotentialDuplicateDeployments Sometimes the Widget API creates 2 deployments due to a bug. This function will delete any duplicates +func deletePotentialDuplicateDeployments(widgetAPI *platformclientv2.WidgetsApi, name, id string, existingResourceIDMetaMap, newResourceIDMetaMap resourceExporter.ResourceIDMetaMap) { + for _, val := range existingResourceIDMetaMap { + for key1, val1 := range newResourceIDMetaMap { + if val.Name == val1.Name { + delete(newResourceIDMetaMap, key1) + break + } + } + } + + for key, val := range newResourceIDMetaMap { + if key != id && val.Name == name { + log.Printf("Deleting duplicate widget deployment %s", name) + _, err := widgetAPI.DeleteWidgetsDeployment(key) + if err != nil { + log.Printf("failed to delete widget deployment %s: %s", name, err) + } + } + } +} diff --git a/genesyscloud/resource_genesyscloud_widget_deployment_test.go b/genesyscloud/resource_genesyscloud_widget_deployment_test.go index e3552fd4f..2f4b56c25 100644 --- a/genesyscloud/resource_genesyscloud_widget_deployment_test.go +++ b/genesyscloud/resource_genesyscloud_widget_deployment_test.go @@ -2,6 +2,7 @@ package genesyscloud import ( "fmt" + "strconv" "strings" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" @@ -10,7 +11,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type widgetDeploymentConfig struct { @@ -22,8 +23,8 @@ type widgetDeploymentConfig struct { flowID string allowedDomains []string clientType string - webChatSkin string - authenticationUrl string + v2ClientConfig map[string]string + thirdPartyClientConfig map[string]string } func deleteWidgetDeploymentWithName(name string) { @@ -35,139 +36,86 @@ func deleteWidgetDeploymentWithName(name string) { for _, widgetDeployment := range *widgetDeployments.Entities { if strings.Contains(*widgetDeployment.Name, name) { - widgetsAPI.DeleteWidgetsDeployment(*widgetDeployment.Id) + _, _ = widgetsAPI.DeleteWidgetsDeployment(*widgetDeployment.Id) } } } -func generateWidgetDeployV2(widgetDeploymentConfig *widgetDeploymentConfig) string { - return fmt.Sprintf(`resource "genesyscloud_widget_deployment" "%s" { - name = "%s" - description = "%s" - flow_id = "%s" - client_type = "%s" - authentication_required = %s - disabled = %s +func generateWidgetDeploymentResource(wdConfig *widgetDeploymentConfig) string { + var ( + v2ClientConfigStr string + thirdPartyConfigStr string + ) + if wdConfig.v2ClientConfig != nil { + v2ClientConfigStr = util.GenerateMapAttrWithMapProperties("v2_client_config", wdConfig.v2ClientConfig) + } + if wdConfig.thirdPartyClientConfig != nil { + thirdPartyConfigStr = util.GenerateMapAttrWithMapProperties("third_party_client_config", wdConfig.thirdPartyClientConfig) } - `, widgetDeploymentConfig.resourceID, - widgetDeploymentConfig.name, - widgetDeploymentConfig.description, - widgetDeploymentConfig.flowID, - widgetDeploymentConfig.clientType, - widgetDeploymentConfig.authenticationRequired, - widgetDeploymentConfig.disabled) -} - -func generateWidgetDeployV1(widgetDeploymentConfig *widgetDeploymentConfig) string { return fmt.Sprintf(`resource "genesyscloud_widget_deployment" "%s" { - name = "%s" - description = "%s" - flow_id = "%s" - client_type = "%s" + name = "%s" + description = %s + flow_id = %s + client_type = "%s" authentication_required = %s - disabled = %s - client_config { - authentication_url = "%s" - webchat_skin = "%s" - } + disabled = %s + %s + %s } - `, widgetDeploymentConfig.resourceID, - widgetDeploymentConfig.name, - widgetDeploymentConfig.description, - widgetDeploymentConfig.flowID, - widgetDeploymentConfig.clientType, - widgetDeploymentConfig.authenticationRequired, - widgetDeploymentConfig.disabled, - widgetDeploymentConfig.authenticationUrl, - widgetDeploymentConfig.webChatSkin) + `, wdConfig.resourceID, + wdConfig.name, + wdConfig.description, + wdConfig.flowID, + wdConfig.clientType, + wdConfig.authenticationRequired, + wdConfig.disabled, + v2ClientConfigStr, + thirdPartyConfigStr, + ) } -func TestAccResourceWidgetDeploymentV2Widget(t *testing.T) { - t.Parallel() - name := "My Test V2 Widget" - widgetDeployV2 := &widgetDeploymentConfig{ - resourceID: "myTestV2Widget", - name: name + uuid.NewString(), - description: "This is a test description", - flowID: uuid.NewString(), - clientType: "v2", - authenticationRequired: "false", - disabled: "true", - } - - _, err := provider.AuthorizeSdk() - if err != nil { - t.Fatal(err) +func copyWidgetDeploymentConfig(original widgetDeploymentConfig) *widgetDeploymentConfig { + var widgetCopy widgetDeploymentConfig + widgetCopy = widgetDeploymentConfig{ + resourceID: original.resourceID, + name: original.name, + description: original.description, + authenticationRequired: original.authenticationRequired, + disabled: original.disabled, + flowID: original.flowID, + allowedDomains: append(widgetCopy.allowedDomains, original.allowedDomains...), + clientType: original.clientType, + v2ClientConfig: original.v2ClientConfig, + thirdPartyClientConfig: original.thirdPartyClientConfig, } - deleteWidgetDeploymentWithName(name) - - resource.Test(t, resource.TestCase{ - PreCheck: func() { util.TestAccPreCheck(t) }, - ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), - - Steps: []resource.TestStep{ - { - //create - Config: generateWidgetDeployV2(widgetDeployV2), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV2.resourceID, "name", widgetDeployV2.name), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV2.resourceID, "description", widgetDeployV2.description), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV2.resourceID, "flow_id", widgetDeployV2.flowID), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV2.resourceID, "client_type", widgetDeployV2.clientType), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV2.resourceID, "authentication_required", widgetDeployV2.authenticationRequired), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV2.resourceID, "disabled", widgetDeployV2.disabled), - ), - }, - { - //update - Config: generateWidgetDeployV2(&widgetDeploymentConfig{ - resourceID: widgetDeployV2.resourceID, - name: widgetDeployV2.name, - description: "New test description", - flowID: widgetDeployV2.flowID, - clientType: widgetDeployV2.clientType, - authenticationRequired: widgetDeployV2.authenticationRequired, - disabled: widgetDeployV2.disabled, - }), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV2.resourceID, "name", widgetDeployV2.name), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV2.resourceID, "description", "New test description"), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV2.resourceID, "flow_id", widgetDeployV2.flowID), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV2.resourceID, "client_type", widgetDeployV2.clientType), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV2.resourceID, "authentication_required", widgetDeployV2.authenticationRequired), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV2.resourceID, "disabled", widgetDeployV2.disabled), - ), - }, - { - // Import/Read - ResourceName: "genesyscloud_widget_deployment." + widgetDeployV2.resourceID, - ImportState: true, - ImportStateVerify: true, - }, - }, - CheckDestroy: testVerifyWidgetDeploymentDestroyed, - }) + return &widgetCopy } -func TestAccResourceWidgetDeploymentV1Widget(t *testing.T) { +func TestAccResourceWidgetDeploymentThirdPartyWidget(t *testing.T) { t.Parallel() - name := "My Text V1 Widget" - widgetDeployV1 := &widgetDeploymentConfig{ - resourceID: "myTestV1Widget", - name: name + uuid.NewString(), - description: "This is a test description", - flowID: uuid.NewString(), - clientType: "v1", - authenticationRequired: "true", - disabled: "true", - webChatSkin: "basic", - authenticationUrl: "https://localhost", + name := "My Test Third Party Widget" + uuid.NewString() + description := "This is a test description" + flowId := uuid.NewString() + widgetDeployment := &widgetDeploymentConfig{ + resourceID: "third_party_widget", + name: name, + description: strconv.Quote(description), + flowID: strconv.Quote(flowId), + clientType: V2, + authenticationRequired: util.FalseValue, + disabled: util.TrueValue, + thirdPartyClientConfig: map[string]string{ + "foo": strconv.Quote("bar"), + }, } - _, err := provider.AuthorizeSdk() - if err != nil { - t.Fatal(err) + updatedDescription := "New description" + widgetDeploymentUpdate := copyWidgetDeploymentConfig(*widgetDeployment) + widgetDeploymentUpdate.description = strconv.Quote(updatedDescription) + widgetDeploymentUpdate.thirdPartyClientConfig = map[string]string{ + "foo": strconv.Quote("bar2"), } + deleteWidgetDeploymentWithName(name) resource.Test(t, resource.TestCase{ @@ -177,43 +125,33 @@ func TestAccResourceWidgetDeploymentV1Widget(t *testing.T) { Steps: []resource.TestStep{ { //create - Config: generateWidgetDeployV1(widgetDeployV1), + Config: generateWidgetDeploymentResource(widgetDeployment), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "name", widgetDeployV1.name), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "description", widgetDeployV1.description), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "flow_id", widgetDeployV1.flowID), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "client_type", widgetDeployV1.clientType), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "authentication_required", widgetDeployV1.authenticationRequired), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "disabled", widgetDeployV1.disabled), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "client_config.0.authentication_url", widgetDeployV1.authenticationUrl), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "client_config.0.webchat_skin", widgetDeployV1.webChatSkin), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "name", name), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "description", description), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "flow_id", flowId), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "client_type", widgetDeployment.clientType), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "authentication_required", widgetDeployment.authenticationRequired), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "disabled", widgetDeployment.disabled), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "third_party_client_config.foo", "bar"), ), }, { //update - Config: generateWidgetDeployV1(&widgetDeploymentConfig{ - resourceID: widgetDeployV1.resourceID, - name: widgetDeployV1.name, - description: "New test description", - flowID: widgetDeployV1.flowID, - clientType: widgetDeployV1.clientType, - authenticationRequired: widgetDeployV1.authenticationRequired, - disabled: widgetDeployV1.disabled, - webChatSkin: widgetDeployV1.webChatSkin, - authenticationUrl: widgetDeployV1.authenticationUrl, - }), + Config: generateWidgetDeploymentResource(widgetDeploymentUpdate), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "name", widgetDeployV1.name), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "description", "New test description"), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "flow_id", widgetDeployV1.flowID), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "client_type", widgetDeployV1.clientType), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "authentication_required", widgetDeployV1.authenticationRequired), - resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployV1.resourceID, "disabled", widgetDeployV1.disabled), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "name", name), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "description", updatedDescription), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "flow_id", flowId), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "client_type", widgetDeployment.clientType), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "authentication_required", widgetDeployment.authenticationRequired), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "disabled", widgetDeployment.disabled), + resource.TestCheckResourceAttr("genesyscloud_widget_deployment."+widgetDeployment.resourceID, "third_party_client_config.foo", "bar2"), ), }, { // Import/Read - ResourceName: "genesyscloud_widget_deployment." + widgetDeployV1.resourceID, + ResourceName: "genesyscloud_widget_deployment." + widgetDeployment.resourceID, ImportState: true, ImportStateVerify: true, }, diff --git a/genesyscloud/responsemanagement_library/genesyscloud_responsemanagement_library_proxy.go b/genesyscloud/responsemanagement_library/genesyscloud_responsemanagement_library_proxy.go index e7e23345e..9478205ec 100644 --- a/genesyscloud/responsemanagement_library/genesyscloud_responsemanagement_library_proxy.go +++ b/genesyscloud/responsemanagement_library/genesyscloud_responsemanagement_library_proxy.go @@ -3,7 +3,7 @@ package responsemanagement_library import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" ) diff --git a/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library.go b/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library.go index 0e2f0be41..2970dd174 100644 --- a/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library.go +++ b/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" diff --git a/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library_test.go b/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library_test.go index 3b1498207..2724c81d1 100644 --- a/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library_test.go +++ b/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceResponseManagementLibrary(t *testing.T) { diff --git a/genesyscloud/responsemanagement_response/genesyscloud_responsemanagement_response_proxy.go b/genesyscloud/responsemanagement_response/genesyscloud_responsemanagement_response_proxy.go index c953cc583..70921cbd8 100644 --- a/genesyscloud/responsemanagement_response/genesyscloud_responsemanagement_response_proxy.go +++ b/genesyscloud/responsemanagement_response/genesyscloud_responsemanagement_response_proxy.go @@ -3,7 +3,7 @@ package responsemanagement_response import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" ) diff --git a/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response.go b/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response.go index bdfc740c5..5e7dec46c 100644 --- a/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response.go +++ b/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_test.go b/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_test.go index b3ea85af4..c9dbca7a6 100644 --- a/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_test.go +++ b/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_test.go @@ -16,7 +16,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceResponseManagementResponseFooterField(t *testing.T) { diff --git a/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_utils.go b/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_utils.go index de743a6d8..f2dd8555f 100644 --- a/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_utils.go +++ b/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_utils.go @@ -2,7 +2,7 @@ package responsemanagement_response import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/lists" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" diff --git a/genesyscloud/responsemanagement_responseasset/genesyscloud_responsemanagement_responseasset_proxy.go b/genesyscloud/responsemanagement_responseasset/genesyscloud_responsemanagement_responseasset_proxy.go index 7280c1cb2..fe64370e1 100644 --- a/genesyscloud/responsemanagement_responseasset/genesyscloud_responsemanagement_responseasset_proxy.go +++ b/genesyscloud/responsemanagement_responseasset/genesyscloud_responsemanagement_responseasset_proxy.go @@ -6,7 +6,7 @@ import ( "log" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset.go b/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset.go index 811114b7b..94a4a0c2e 100644 --- a/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset.go +++ b/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset_test.go b/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset_test.go index 5442793fb..7cb665c73 100644 --- a/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset_test.go +++ b/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceResponseManagementResponseAsset(t *testing.T) { diff --git a/genesyscloud/routing_email_route/genesyscloud_routing_email_route_proxy.go b/genesyscloud/routing_email_route/genesyscloud_routing_email_route_proxy.go index 771340b62..6c8df29b3 100644 --- a/genesyscloud/routing_email_route/genesyscloud_routing_email_route_proxy.go +++ b/genesyscloud/routing_email_route/genesyscloud_routing_email_route_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route.go b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route.go index 0ede89be7..8bdffc449 100644 --- a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route.go +++ b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go index 941e6c4c8..4cec51ca3 100644 --- a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go +++ b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceRoutingEmailRoute(t *testing.T) { diff --git a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_utils.go b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_utils.go index 1eeb0cc73..c47783f4b 100644 --- a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_utils.go +++ b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_utils.go @@ -8,7 +8,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/routing_queue/data_source_genesyscloud_routing_queue.go b/genesyscloud/routing_queue/data_source_genesyscloud_routing_queue.go index 67c47b23e..cd47befaa 100644 --- a/genesyscloud/routing_queue/data_source_genesyscloud_routing_queue.go +++ b/genesyscloud/routing_queue/data_source_genesyscloud_routing_queue.go @@ -11,10 +11,11 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" - rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/routing_queue/genesyscloud_routing_queue_init_test.go b/genesyscloud/routing_queue/genesyscloud_routing_queue_init_test.go index df495eba4..6a9d21473 100644 --- a/genesyscloud/routing_queue/genesyscloud_routing_queue_init_test.go +++ b/genesyscloud/routing_queue/genesyscloud_routing_queue_init_test.go @@ -4,6 +4,7 @@ import ( "sync" gcloud "terraform-provider-genesyscloud/genesyscloud" architectFlow "terraform-provider-genesyscloud/genesyscloud/architect_flow" + "terraform-provider-genesyscloud/genesyscloud/architect_user_prompt" "terraform-provider-genesyscloud/genesyscloud/group" "testing" @@ -38,6 +39,7 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_routing_wrapupcode"] = gcloud.ResourceRoutingWrapupCode() providerResources["genesyscloud_flow"] = architectFlow.ResourceArchitectFlow() providerResources["genesyscloud_routing_skill_group"] = gcloud.ResourceRoutingSkillGroup() + providerResources["genesyscloud_architect_user_prompt"] = architect_user_prompt.ResourceArchitectUserPrompt() } // registerTestDataSources registers all data sources used in the tests. diff --git a/genesyscloud/routing_queue/genesyscloud_routing_queue_proxy.go b/genesyscloud/routing_queue/genesyscloud_routing_queue_proxy.go index 932d59931..3a06aa969 100644 --- a/genesyscloud/routing_queue/genesyscloud_routing_queue_proxy.go +++ b/genesyscloud/routing_queue/genesyscloud_routing_queue_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue.go b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue.go index c9704f65a..46ae0cba6 100644 --- a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue.go +++ b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue.go @@ -25,7 +25,7 @@ import ( "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var bullseyeExpansionTypeTimeout = "TIMEOUT_SECONDS" @@ -74,6 +74,7 @@ func createQueue(ctx context.Context, d *schema.ResourceData, meta interface{}) EmailInQueueFlow: util.BuildSdkDomainEntityRef(d, "email_in_queue_flow_id"), MessageInQueueFlow: util.BuildSdkDomainEntityRef(d, "message_in_queue_flow_id"), WhisperPrompt: util.BuildSdkDomainEntityRef(d, "whisper_prompt_id"), + OnHoldPrompt: util.BuildSdkDomainEntityRef(d, "on_hold_prompt_id"), AutoAnswerOnly: platformclientv2.Bool(d.Get("auto_answer_only").(bool)), CallingPartyName: platformclientv2.String(d.Get("calling_party_name").(string)), CallingPartyNumber: platformclientv2.String(d.Get("calling_party_number").(string)), @@ -192,6 +193,7 @@ func readQueue(ctx context.Context, d *schema.ResourceData, meta interface{}) di resourcedata.SetNillableReference(d, "message_in_queue_flow_id", currentQueue.MessageInQueueFlow) resourcedata.SetNillableReference(d, "email_in_queue_flow_id", currentQueue.EmailInQueueFlow) resourcedata.SetNillableReference(d, "whisper_prompt_id", currentQueue.WhisperPrompt) + resourcedata.SetNillableReference(d, "on_hold_prompt_id", currentQueue.OnHoldPrompt) resourcedata.SetNillableValue(d, "auto_answer_only", currentQueue.AutoAnswerOnly) resourcedata.SetNillableValue(d, "enable_transcription", currentQueue.EnableTranscription) resourcedata.SetNillableValue(d, "suppress_in_queue_call_recording", currentQueue.SuppressInQueueCallRecording) @@ -279,6 +281,7 @@ func updateQueue(ctx context.Context, d *schema.ResourceData, meta interface{}) EmailInQueueFlow: util.BuildSdkDomainEntityRef(d, "email_in_queue_flow_id"), MessageInQueueFlow: util.BuildSdkDomainEntityRef(d, "message_in_queue_flow_id"), WhisperPrompt: util.BuildSdkDomainEntityRef(d, "whisper_prompt_id"), + OnHoldPrompt: util.BuildSdkDomainEntityRef(d, "on_hold_prompt_id"), AutoAnswerOnly: platformclientv2.Bool(d.Get("auto_answer_only").(bool)), CallingPartyName: platformclientv2.String(d.Get("calling_party_name").(string)), CallingPartyNumber: platformclientv2.String(d.Get("calling_party_number").(string)), @@ -1030,9 +1033,15 @@ func updateQueueMembers(d *schema.ResourceData, sdkConfig *platformclientv2.Conf if len(newUserIds) > 0 { log.Printf("Sleeping for 10 seconds") time.Sleep(10 * time.Second) + + members, diagErr := getRoutingQueueMembers(d.Id(), "group", sdkConfig) + if diagErr != nil { + return diagErr + } + for _, userId := range newUserIds { - if err := verifyUserIsNotGroupMemberOfQueue(d.Id(), userId, sdkConfig); err != nil { - log.Println(err.Error()) + if err := verifyUserIsNotGroupMemberOfQueue(d.Id(), userId, members); err != nil { + return util.BuildDiagnosticError(resourceName, "failed to update queue member: ", err) } } } @@ -1115,39 +1124,12 @@ func removeAllExistingUserMembersFromQueue(queueId string, sdkConfig *platformcl } // verifyUserIsNotGroupMemberOfQueue Search through queue group members to verify that a given user is not a group member -func verifyUserIsNotGroupMemberOfQueue(queueId, userId string, sdkConfig *platformclientv2.Configuration) error { - var ( - userName string - routingApi = platformclientv2.NewRoutingApiWithConfig(sdkConfig) - usersApi = platformclientv2.NewUsersApiWithConfig(sdkConfig) - ) - +func verifyUserIsNotGroupMemberOfQueue(queueId, userId string, members []platformclientv2.Queuemember) error { log.Printf("verifying that member '%s' is not assinged to the queue '%s' via a group", userId, queueId) - // Read name of user to filter results when listing members of queue - log.Printf("reading user %s to fetch name", userId) - user, _, err := usersApi.GetUser(userId, nil, "", "") - if err != nil { - log.Printf("Failed to read name of user '%s' inside verifyUserIsNotGroupMemberOfQueue: %s. Queue ID: %s", userId, err, queueId) - } else { - userName = *user.Name - log.Printf("read user %s %s", userId, userName) - } - - const pageSize = 100 - for pageNum := 1; ; pageNum++ { - users, resp, err := sdkGetRoutingQueueMembers(queueId, "group", userName, pageNum, pageSize, routingApi) - if err != nil || resp.StatusCode != http.StatusOK { - log.Printf("Error requesting group members of queue '%s': %v. Cannot validate that user '%s' is not already assigned via a group", queueId, err, userId) - break - } - if users == nil || users.Entities == nil || len(*users.Entities) == 0 { - break - } - for _, member := range *users.Entities { - if userId == *member.Id { - return fmt.Errorf("member %s '%s' is already assigned to queue '%s' via a group, and therefore should not be assigned as a member", userName, userId, queueId) - } + for _, member := range members { + if *member.Id == userId { + return fmt.Errorf("member %s is already assigned to queue %s via a group, and therefore should not be assigned as a member", userId, queueId) } } @@ -1207,25 +1189,25 @@ func getRoutingQueueMembers(queueID string, memberBy string, sdkConfig *platform log.Printf("%d members belong to queue %s", queueMembers, queueID) for pageNum := 1; ; pageNum++ { - users, resp, err := sdkGetRoutingQueueMembers(queueID, memberBy, "", pageNum, pageSize, api) + users, resp, err := sdkGetRoutingQueueMembers(queueID, memberBy, pageNum, pageSize, api) if err != nil || resp.StatusCode != http.StatusOK { return nil, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to query users for queue %s error: %s", queueID, err), resp) } if users == nil || users.Entities == nil || len(*users.Entities) == 0 { membersFound := len(members) log.Printf("%d queue members found for queue %s", membersFound, queueID) + if membersFound != queueMembers { log.Printf("Member count is not equal to queue member found for queue %s, Correlation Id: %s", queueID, resp.CorrelationID) } return members, nil } - for _, user := range *users.Entities { - members = append(members, user) - } + + members = append(members, *users.Entities...) } } -func sdkGetRoutingQueueMembers(queueID, memberBy, name string, pageNumber, pageSize int, api *platformclientv2.RoutingApi) (*platformclientv2.Queuememberentitylisting, *platformclientv2.APIResponse, error) { +func sdkGetRoutingQueueMembers(queueID, memberBy string, pageNumber, pageSize int, api *platformclientv2.RoutingApi) (*platformclientv2.Queuememberentitylisting, *platformclientv2.APIResponse, error) { // SDK does not support nil values for boolean query params yet, so we must manually construct this HTTP request for now apiClient := &api.Configuration.APIClient @@ -1254,9 +1236,6 @@ func sdkGetRoutingQueueMembers(queueID, memberBy, name string, pageNumber, pageS if memberBy != "" { queryParams["memberBy"] = memberBy } - if name != "" { - queryParams["name"] = name - } headerParams["Content-Type"] = "application/json" headerParams["Accept"] = "application/json" diff --git a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_schema.go b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_schema.go index 896ea6e8a..58d7e83af 100644 --- a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_schema.go +++ b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_schema.go @@ -380,6 +380,11 @@ func ResourceRoutingQueue() *schema.Resource { Type: schema.TypeString, Optional: true, }, + "on_hold_prompt_id": { + Description: "The audio to be played when calls on this queue are on hold. If not configured, the default on-hold music will play.", + Type: schema.TypeString, + Optional: true, + }, "auto_answer_only": { Description: "Specifies whether the configured whisper should play for all ACD calls, or only for those which are auto-answered.", Type: schema.TypeBool, @@ -507,6 +512,7 @@ func RoutingQueueExporter() *resourceExporter.ResourceExporter { "email_in_queue_flow_id": {RefType: "genesyscloud_flow"}, "message_in_queue_flow_id": {RefType: "genesyscloud_flow"}, "whisper_prompt_id": {RefType: "genesyscloud_architect_user_prompt"}, + "on_hold_prompt_id": {RefType: "genesyscloud_architect_user_prompt"}, "outbound_messaging_sms_address_id": {}, // Ref type not yet defined "default_script_ids.*": {RefType: "genesyscloud_script"}, // Ref type not yet defined "outbound_email_address.route_id": {RefType: "genesyscloud_routing_email_route"}, diff --git a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go index d4a8c70c1..20252e1db 100644 --- a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go +++ b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go @@ -5,19 +5,27 @@ import ( "log" "strconv" "strings" + "sync" "terraform-provider-genesyscloud/genesyscloud" "terraform-provider-genesyscloud/genesyscloud/architect_flow" + "terraform-provider-genesyscloud/genesyscloud/architect_user_prompt" "terraform-provider-genesyscloud/genesyscloud/group" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" featureToggles "terraform-provider-genesyscloud/genesyscloud/util/feature_toggles" + "terraform-provider-genesyscloud/genesyscloud/util/testrunner" "testing" "time" "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" +) + +var ( + sdkConfig *platformclientv2.Configuration + mu sync.Mutex ) func TestAccResourceRoutingQueueBasic(t *testing.T) { @@ -523,6 +531,32 @@ func TestAccResourceRoutingQueueFlows(t *testing.T) { queueFlowInboundcallConfig1 = fmt.Sprintf("inboundCall:\n name: %s\n defaultLanguage: en-us\n startUpRef: ./menus/menu[mainMenu]\n initialGreeting:\n tts: Archy says hi!!!\n menus:\n - menu:\n name: Main Menu\n audio:\n tts: You are at the Main Menu, press 9 to disconnect.\n refId: mainMenu\n choices:\n - menuDisconnect:\n name: Disconnect\n dtmf: digit_9", queueFlowName1) messageInQueueFlowInboundcallConfig3 = fmt.Sprintf("inboundCall:\n name: %s\n defaultLanguage: en-us\n startUpRef: ./menus/menu[mainMenu]\n initialGreeting:\n tts: Archy says hi!!!!!\n menus:\n - menu:\n name: Main Menu\n audio:\n tts: You are at the Main Menu, press 9 to disconnect.\n refId: mainMenu\n choices:\n - menuDisconnect:\n name: Disconnect\n dtmf: digit_9", queueFlowName3) + + //variables for testing 'on_hold_prompt_id' + userPromptResource1 = "test-user_prompt_1" + userPromptName1 = "TestUserPrompt_1" + strings.Replace(uuid.NewString(), "-", "", -1) + userPromptDescription1 = "Test description" + userPromptResourceLang1 = "en-us" + userPromptResourceText1 = "This is a test greeting!" + userPromptResourceFileName2 = "../" + testrunner.GetTestDataPath("test-prompt-02.wav") + userPromptResourceTTS1 = "This is a test greeting!" + userPromptAsset1 = architect_user_prompt.UserPromptResourceStruct{ + Language: userPromptResourceLang1, + Tts_string: strconv.Quote(userPromptResourceTTS1), + Text: util.NullValue, + Filename: util.NullValue, + FileContentHash: util.NullValue, + } + userPromptAsset2 = architect_user_prompt.UserPromptResourceStruct{ + Language: userPromptResourceLang1, + Tts_string: util.NullValue, + Text: strconv.Quote(userPromptResourceText1), + Filename: strconv.Quote(userPromptResourceFileName2), + FileContentHash: userPromptResourceFileName2, + } + + userPromptResources1 = []*architect_user_prompt.UserPromptResourceStruct{&userPromptAsset1} + userPromptResources2 = []*architect_user_prompt.UserPromptResourceStruct{&userPromptAsset2} ) var homeDivisionName string @@ -586,17 +620,24 @@ func TestAccResourceRoutingQueueFlows(t *testing.T) { queueFlowFilePath3, messageInQueueFlowInboundcallConfig3, false, - ) + GenerateRoutingQueueResourceBasic( + ) + architect_user_prompt.GenerateUserPromptResource(&architect_user_prompt.UserPromptStruct{ + ResourceID: userPromptResource1, + Name: userPromptName1, + Description: strconv.Quote(userPromptDescription1), + Resources: userPromptResources1, + }) + GenerateRoutingQueueResourceBasic( queueResource1, queueName1, "queue_flow_id = genesyscloud_flow."+queueFlowResource1+".id", "email_in_queue_flow_id = genesyscloud_flow."+emailInQueueFlowResource1+".id", "message_in_queue_flow_id = genesyscloud_flow."+messageInQueueFlowResource1+".id", + "on_hold_prompt_id = genesyscloud_architect_user_prompt."+userPromptResource1+".id", ), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair("genesyscloud_routing_queue."+queueResource1, "queue_flow_id", "genesyscloud_flow."+queueFlowResource1, "id"), resource.TestCheckResourceAttrPair("genesyscloud_routing_queue."+queueResource1, "email_in_queue_flow_id", "genesyscloud_flow."+emailInQueueFlowResource1, "id"), resource.TestCheckResourceAttrPair("genesyscloud_routing_queue."+queueResource1, "message_in_queue_flow_id", "genesyscloud_flow."+messageInQueueFlowResource1, "id"), + resource.TestCheckResourceAttrPair("genesyscloud_routing_queue."+queueResource1, "on_hold_prompt_id", "genesyscloud_architect_user_prompt."+userPromptResource1, "id"), ), }, { @@ -616,17 +657,24 @@ func TestAccResourceRoutingQueueFlows(t *testing.T) { queueFlowFilePath3, messageInQueueFlowInboundcallConfig3, false, - ) + GenerateRoutingQueueResourceBasic( + ) + architect_user_prompt.GenerateUserPromptResource(&architect_user_prompt.UserPromptStruct{ + ResourceID: userPromptResource1, + Name: userPromptName1, + Description: strconv.Quote(userPromptDescription1), + Resources: userPromptResources2, + }) + GenerateRoutingQueueResourceBasic( queueResource1, queueName1, "queue_flow_id = genesyscloud_flow."+queueFlowResource2+".id", "email_in_queue_flow_id = genesyscloud_flow."+emailInQueueFlowResource2+".id", "message_in_queue_flow_id = genesyscloud_flow."+messageInQueueFlowResource2+".id", + "on_hold_prompt_id = genesyscloud_architect_user_prompt."+userPromptResource1+".id", ), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair("genesyscloud_routing_queue."+queueResource1, "queue_flow_id", "genesyscloud_flow."+queueFlowResource2, "id"), resource.TestCheckResourceAttrPair("genesyscloud_routing_queue."+queueResource1, "email_in_queue_flow_id", "genesyscloud_flow."+emailInQueueFlowResource2, "id"), resource.TestCheckResourceAttrPair("genesyscloud_routing_queue."+queueResource1, "message_in_queue_flow_id", "genesyscloud_flow."+messageInQueueFlowResource2, "id"), + resource.TestCheckResourceAttrPair("genesyscloud_routing_queue."+queueResource1, "on_hold_prompt_id", "genesyscloud_architect_user_prompt."+userPromptResource1, "id"), func(s *terraform.State) error { time.Sleep(45 * time.Second) // Wait for 45 seconds for proper deletion of user return nil @@ -681,6 +729,10 @@ func TestAccResourceRoutingQueueMembers(t *testing.T) { ), }, { + PreConfig: func() { + // Wait for a specified duration to avoid runtime error + time.Sleep(30 * time.Second) + }, // Update with another queue member and modify rings Config: genesyscloud.GenerateBasicUserResource( queueMemberResource1, @@ -1088,6 +1140,7 @@ func TestAccResourceRoutingQueueMembersOutsideOfConfig(t *testing.T) { userEmail = fmt.Sprintf("user%s@test.com", strings.Replace(uuid.NewString(), "-", "", -1)) queueResourceId = "queue" queueName = "tf test queue " + uuid.NewString() + userID string ) queueResource := fmt.Sprintf(` @@ -1116,12 +1169,26 @@ resource "genesyscloud_user" "%s" { { Config: queueResource + userResource, ExpectNonEmptyPlan: false, + Check: resource.ComposeTestCheckFunc( + func(s *terraform.State) error { + rs, ok := s.RootModule().Resources["genesyscloud_user."+userResourceId] + if !ok { + return fmt.Errorf("not found: %s", "genesyscloud_user."+userResourceId) + } + userID = rs.Primary.ID + log.Printf("User ID: %s\n", userID) // Print user ID + return nil + }, + ), }, { // Import/Read ResourceName: "genesyscloud_routing_queue." + queueResourceId, ImportState: true, ImportStateVerify: true, + Check: resource.ComposeTestCheckFunc( + checkUserDeleted(userID), + ), }, }, CheckDestroy: testVerifyQueuesDestroyed, @@ -1477,3 +1544,45 @@ func generateUserWithCustomAttrs(resourceID string, email string, name string, a } `, resourceID, email, name, strings.Join(attrs, "\n")) } + +func checkUserDeleted(id string) resource.TestCheckFunc { + log.Printf("Fetching user with ID: %s\n", id) + return func(s *terraform.State) error { + maxAttempts := 18 + for i := 0; i < maxAttempts; i++ { + + deleted, err := isUserDeleted(id) + if err != nil { + return err + } + if deleted { + return nil + } + time.Sleep(10 * time.Second) + } + return fmt.Errorf("user %s was not deleted properly", id) + } +} + +func isUserDeleted(id string) (bool, error) { + mu.Lock() + defer mu.Unlock() + + usersAPI := platformclientv2.NewUsersApiWithConfig(sdkConfig) + // Attempt to get the user + _, response, err := usersAPI.GetUser(id, nil, "", "") + + // Check if the user is not found (deleted) + if response != nil && response.StatusCode == 404 { + return true, nil // User is deleted + } + + // Handle other errors + if err != nil { + log.Printf("Error fetching user: %v", err) + return false, err + } + + // If user is found, it means the user is not deleted + return false, nil +} diff --git a/genesyscloud/routing_queue_conditional_group_routing/genesyscloud_routing_queue_conditional_group_routing_proxy.go b/genesyscloud/routing_queue_conditional_group_routing/genesyscloud_routing_queue_conditional_group_routing_proxy.go index 362c8d5eb..8072bfcc7 100644 --- a/genesyscloud/routing_queue_conditional_group_routing/genesyscloud_routing_queue_conditional_group_routing_proxy.go +++ b/genesyscloud/routing_queue_conditional_group_routing/genesyscloud_routing_queue_conditional_group_routing_proxy.go @@ -3,7 +3,7 @@ package routing_queue_conditional_group_routing import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" ) diff --git a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing.go b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing.go index 028b585e7..a0d3b94a3 100644 --- a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing.go +++ b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "strings" consistencyChecker "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_test.go b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_test.go index 03d3566a0..dadf085c8 100644 --- a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_test.go +++ b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_test.go @@ -18,7 +18,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( @@ -330,6 +330,7 @@ func generateUserWithCustomAttrs(resourceID string, email string, name string, a } `, resourceID, email, name, strings.Join(attrs, "\n")) } + func checkUserDeleted(id string) resource.TestCheckFunc { log.Printf("Fetching user with ID: %s\n", id) return func(s *terraform.State) error { diff --git a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_unit_test.go b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_unit_test.go index e71ff2d42..16b682245 100644 --- a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_unit_test.go +++ b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_unit_test.go @@ -5,7 +5,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/stretchr/testify/assert" "net/http" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/routing_queue_outbound_email_address/genesyscloud_routing_queue_outbound_email_address_proxy.go b/genesyscloud/routing_queue_outbound_email_address/genesyscloud_routing_queue_outbound_email_address_proxy.go index 0972d7cd5..e12da7114 100644 --- a/genesyscloud/routing_queue_outbound_email_address/genesyscloud_routing_queue_outbound_email_address_proxy.go +++ b/genesyscloud/routing_queue_outbound_email_address/genesyscloud_routing_queue_outbound_email_address_proxy.go @@ -3,7 +3,7 @@ package routing_queue_outbound_email_address import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" ) diff --git a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address.go b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address.go index 97a3e55b2..e94fdaee1 100644 --- a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address.go +++ b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "strings" consistencyChecker "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_test.go b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_test.go index 8bf3a50b9..cfac071ce 100644 --- a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_test.go +++ b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_test.go @@ -5,7 +5,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "os" "strings" diff --git a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_unit_test.go b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_unit_test.go index 4f0368308..6ef38582c 100644 --- a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_unit_test.go +++ b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_unit_test.go @@ -4,7 +4,7 @@ import ( "context" "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/stretchr/testify/assert" "net/http" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/routing_settings/genesyscloud_routing_settings_init_test.go b/genesyscloud/routing_settings/genesyscloud_routing_settings_init_test.go new file mode 100644 index 000000000..7e9c341f7 --- /dev/null +++ b/genesyscloud/routing_settings/genesyscloud_routing_settings_init_test.go @@ -0,0 +1,40 @@ +package routing_settings + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "sync" + "testing" +) + +// providerResources holds a map of all registered resources +var providerResources map[string]*schema.Resource + +type registerTestInstance struct { + resourceMapMutex sync.RWMutex +} + +// registerTestResources registers all resources used in the tests +func (r *registerTestInstance) registerTestResources() { + r.resourceMapMutex.Lock() + defer r.resourceMapMutex.Unlock() + + providerResources[resourceName] = ResourceRoutingSettings() +} + +// initTestResources initializes all test resources and data sources. +func initTestResources() { + providerResources = make(map[string]*schema.Resource) + + regInstance := ®isterTestInstance{} + + regInstance.registerTestResources() +} + +// TestMain is a "setup" function called by the testing framework when run the test +func TestMain(m *testing.M) { + // Run setup function before starting the test suite for routing_settings package + initTestResources() + + // Run the test suite for the routing_settings package + m.Run() +} diff --git a/genesyscloud/routing_settings/genesyscloud_routing_settings_proxy.go b/genesyscloud/routing_settings/genesyscloud_routing_settings_proxy.go new file mode 100644 index 000000000..111dcf6f1 --- /dev/null +++ b/genesyscloud/routing_settings/genesyscloud_routing_settings_proxy.go @@ -0,0 +1,110 @@ +package routing_settings + +import ( + "context" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" +) + +var internalProxy *routingSettingsProxy + +type getRoutingSettingsFunc func(ctx context.Context, p *routingSettingsProxy) (*platformclientv2.Routingsettings, *platformclientv2.APIResponse, error) +type updateRoutingSettingsFunc func(ctx context.Context, p *routingSettingsProxy, routingSettings *platformclientv2.Routingsettings) (*platformclientv2.Routingsettings, *platformclientv2.APIResponse, error) +type deleteRoutingSettingsFunc func(ctx context.Context, p *routingSettingsProxy) (*platformclientv2.APIResponse, error) + +type getRoutingSettingsContactCenterFunc func(ctx context.Context, p *routingSettingsProxy) (*platformclientv2.Contactcentersettings, *platformclientv2.APIResponse, error) +type updateRoutingSettingsContactCenterFunc func(ctx context.Context, p *routingSettingsProxy, contactCenterSettings platformclientv2.Contactcentersettings) (*platformclientv2.APIResponse, error) + +type getRoutingSettingsTranscriptionFunc func(ctx context.Context, p *routingSettingsProxy) (*platformclientv2.Transcriptionsettings, *platformclientv2.APIResponse, error) +type updateRoutingSettingsTranscriptionFunc func(ctx context.Context, p *routingSettingsProxy, transcriptionSettings platformclientv2.Transcriptionsettings) (*platformclientv2.Transcriptionsettings, *platformclientv2.APIResponse, error) + +type routingSettingsProxy struct { + clientConfig *platformclientv2.Configuration + routingSettingsApi *platformclientv2.RoutingApi + getRoutingSettingsAttr getRoutingSettingsFunc + updateRoutingSettingsAttr updateRoutingSettingsFunc + deleteRoutingSettingsAttr deleteRoutingSettingsFunc + + getRoutingSettingsContactCenterAttr getRoutingSettingsContactCenterFunc + updateRoutingSettingsContactCenterAttr updateRoutingSettingsContactCenterFunc + + getRoutingSettingsTranscriptionAttr getRoutingSettingsTranscriptionFunc + updateRoutingSettingsTranscriptionAttr updateRoutingSettingsTranscriptionFunc +} + +func newRoutingSettingsProxy(clientConfig *platformclientv2.Configuration) *routingSettingsProxy { + api := platformclientv2.NewRoutingApiWithConfig(clientConfig) + return &routingSettingsProxy{ + clientConfig: clientConfig, + routingSettingsApi: api, + getRoutingSettingsAttr: getRoutingSettingsFn, + updateRoutingSettingsAttr: updateRoutingSettingsFn, + deleteRoutingSettingsAttr: deleteRoutingSettingsFn, + getRoutingSettingsContactCenterAttr: getRoutingSettingsContactCenterFn, + updateRoutingSettingsContactCenterAttr: updateRoutingSettingsContactCenterFn, + getRoutingSettingsTranscriptionAttr: getRoutingSettingsTranscriptionFn, + updateRoutingSettingsTranscriptionAttr: updateRoutingSettingsTranscriptionFn, + } +} + +func getRoutingSettingsProxy(clientConfig *platformclientv2.Configuration) *routingSettingsProxy { + if internalProxy == nil { + internalProxy = newRoutingSettingsProxy(clientConfig) + } + return internalProxy +} + +func (p *routingSettingsProxy) getRoutingSettings(ctx context.Context) (*platformclientv2.Routingsettings, *platformclientv2.APIResponse, error) { + return p.getRoutingSettingsAttr(ctx, p) +} + +func (p *routingSettingsProxy) updateRoutingSettings(ctx context.Context, routingSettings *platformclientv2.Routingsettings) (*platformclientv2.Routingsettings, *platformclientv2.APIResponse, error) { + return p.updateRoutingSettingsAttr(ctx, p, routingSettings) +} + +func (p *routingSettingsProxy) deleteRoutingSettings(ctx context.Context) (*platformclientv2.APIResponse, error) { + return p.deleteRoutingSettingsAttr(ctx, p) +} + +func (p *routingSettingsProxy) getRoutingSettingsContactCenter(ctx context.Context) (*platformclientv2.Contactcentersettings, *platformclientv2.APIResponse, error) { + return p.getRoutingSettingsContactCenterAttr(ctx, p) +} + +func (p *routingSettingsProxy) updateRoutingSettingsContactCenter(ctx context.Context, contactCenterSettings platformclientv2.Contactcentersettings) (*platformclientv2.APIResponse, error) { + return p.updateRoutingSettingsContactCenterAttr(ctx, p, contactCenterSettings) +} + +func (p *routingSettingsProxy) getRoutingSettingsTranscription(ctx context.Context) (*platformclientv2.Transcriptionsettings, *platformclientv2.APIResponse, error) { + return p.getRoutingSettingsTranscriptionAttr(ctx, p) +} + +func (p *routingSettingsProxy) updateRoutingSettingsTranscription(ctx context.Context, transcriptionSettings platformclientv2.Transcriptionsettings) (*platformclientv2.Transcriptionsettings, *platformclientv2.APIResponse, error) { + return p.updateRoutingSettingsTranscriptionAttr(ctx, p, transcriptionSettings) +} + +func getRoutingSettingsFn(ctx context.Context, p *routingSettingsProxy) (*platformclientv2.Routingsettings, *platformclientv2.APIResponse, error) { + return p.routingSettingsApi.GetRoutingSettings() +} + +func updateRoutingSettingsFn(ctx context.Context, p *routingSettingsProxy, routingSettings *platformclientv2.Routingsettings) (*platformclientv2.Routingsettings, *platformclientv2.APIResponse, error) { + return p.routingSettingsApi.PutRoutingSettings(*routingSettings) +} + +func deleteRoutingSettingsFn(ctx context.Context, p *routingSettingsProxy) (*platformclientv2.APIResponse, error) { + return p.routingSettingsApi.DeleteRoutingSettings() +} + +func getRoutingSettingsContactCenterFn(ctx context.Context, p *routingSettingsProxy) (*platformclientv2.Contactcentersettings, *platformclientv2.APIResponse, error) { + return p.routingSettingsApi.GetRoutingSettingsContactcenter() +} + +func updateRoutingSettingsContactCenterFn(ctx context.Context, p *routingSettingsProxy, contactCenterSettings platformclientv2.Contactcentersettings) (*platformclientv2.APIResponse, error) { + return p.routingSettingsApi.PatchRoutingSettingsContactcenter(contactCenterSettings) +} + +func getRoutingSettingsTranscriptionFn(ctx context.Context, p *routingSettingsProxy) (*platformclientv2.Transcriptionsettings, *platformclientv2.APIResponse, error) { + return p.routingSettingsApi.GetRoutingSettingsTranscription() +} + +func updateRoutingSettingsTranscriptionFn(ctx context.Context, p *routingSettingsProxy, transcriptionSettings platformclientv2.Transcriptionsettings) (*platformclientv2.Transcriptionsettings, *platformclientv2.APIResponse, error) { + return p.routingSettingsApi.PutRoutingSettingsTranscription(transcriptionSettings) +} diff --git a/genesyscloud/routing_settings/resource_genesyscloud_routing_settings.go b/genesyscloud/routing_settings/resource_genesyscloud_routing_settings.go new file mode 100644 index 000000000..3f4a4f2e8 --- /dev/null +++ b/genesyscloud/routing_settings/resource_genesyscloud_routing_settings.go @@ -0,0 +1,216 @@ +package routing_settings + +import ( + "context" + "fmt" + "log" + "terraform-provider-genesyscloud/genesyscloud/provider" + "terraform-provider-genesyscloud/genesyscloud/util" + "terraform-provider-genesyscloud/genesyscloud/util/constants" + "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + + "terraform-provider-genesyscloud/genesyscloud/consistency_checker" + + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" +) + +func getAllRoutingSettings(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { + resources := make(resourceExporter.ResourceIDMetaMap) + resources["0"] = &resourceExporter.ResourceMeta{Name: "routing_settings"} + return resources, nil +} + +func createRoutingSettings(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + log.Printf("Creating Routing Setting") + d.SetId("settings") + return updateRoutingSettings(ctx, d, meta) +} + +func readRoutingSettings(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingSettingsProxy(sdkConfig) + cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceRoutingSettings(), constants.DefaultConsistencyChecks, resourceName) + + log.Printf("Reading routing settings") + + return util.WithRetriesForRead(ctx, d, func() *retry.RetryError { + settings, resp, getErr := proxy.getRoutingSettings(ctx) + if getErr != nil { + if util.IsStatus404(resp) { + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read Routing Setting %s | error: %s", d.Id(), getErr), resp)) + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read Routing Setting %s | error: %s", d.Id(), getErr), resp)) + } + + resourcedata.SetNillableValue(d, "reset_agent_on_presence_change", settings.ResetAgentScoreOnPresenceChange) + + if diagErr := readRoutingSettingsContactCenter(ctx, d, proxy); diagErr != nil { + return retry.NonRetryableError(fmt.Errorf("%v", diagErr)) + } + + if diagErr := readRoutingSettingsTranscription(ctx, d, proxy); diagErr != nil { + return retry.NonRetryableError(fmt.Errorf("%v", diagErr)) + } + + log.Printf("Read Routing Setting") + return cc.CheckState(d) + }) +} + +func updateRoutingSettings(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + resetAgentOnPresenceChange := d.Get("reset_agent_on_presence_change").(bool) + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingSettingsProxy(sdkConfig) + + log.Printf("Updating Routing Settings") + update := platformclientv2.Routingsettings{ + ResetAgentScoreOnPresenceChange: &resetAgentOnPresenceChange, + } + + diagErr := updateContactCenter(ctx, d, proxy) + if diagErr != nil { + return diagErr + } + + diagErr = updateTranscription(ctx, d, proxy) + if diagErr != nil { + return diagErr + } + + _, resp, err := proxy.updateRoutingSettings(ctx, &update) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to update routing settings %s error: %s", d.Id(), err), resp) + } + + time.Sleep(5 * time.Second) + + log.Printf("Updated Routing Settings") + return readRoutingSettings(ctx, d, meta) +} + +func deleteRoutingSettings(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingSettingsProxy(sdkConfig) + + log.Printf("Resetting Routing Setting") + resp, err := proxy.deleteRoutingSettings(ctx) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to delete routing settings %s error: %s", d.Id(), err), resp) + } + + log.Printf("Reset Routing Settings") + return nil +} + +func readRoutingSettingsContactCenter(ctx context.Context, d *schema.ResourceData, proxy *routingSettingsProxy) diag.Diagnostics { + contactCenter, resp, getErr := proxy.getRoutingSettingsContactCenter(ctx) + if getErr != nil { + if util.IsStatus404(resp) { + return nil + } + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to read contact center for routing setting %s error: %s", d.Id(), getErr), resp) + } + + if contactCenter == nil { + _ = d.Set("contactcenter", nil) + return nil + } + + contactSettings := make(map[string]interface{}) + resourcedata.SetMapValueIfNotNil(contactSettings, "remove_skills_from_blind_transfer", contactCenter.RemoveSkillsFromBlindTransfer) + + _ = d.Set("contactcenter", []interface{}{contactSettings}) + return nil +} + +func updateContactCenter(ctx context.Context, d *schema.ResourceData, proxy *routingSettingsProxy) diag.Diagnostics { + var removeSkillsFromBlindTransfer bool + + if contactCenterConfig := d.Get("contactcenter"); contactCenterConfig != nil { + if contactCenterList := contactCenterConfig.([]interface{}); len(contactCenterList) > 0 { + contactCenterMap := contactCenterList[0].(map[string]interface{}) + + if contactCenterMap["remove_skills_from_blind_transfer"] != nil { + removeSkillsFromBlindTransfer = contactCenterMap["remove_skills_from_blind_transfer"].(bool) + } + + contactCenterSettings := platformclientv2.Contactcentersettings{ + RemoveSkillsFromBlindTransfer: &removeSkillsFromBlindTransfer, + } + + resp, err := proxy.updateRoutingSettingsContactCenter(ctx, contactCenterSettings) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to update contact center for routing settings %s error: %s", d.Id(), err), resp) + } + } + } + return nil +} + +func readRoutingSettingsTranscription(ctx context.Context, d *schema.ResourceData, proxy *routingSettingsProxy) diag.Diagnostics { + transcription, resp, getErr := proxy.getRoutingSettingsTranscription(ctx) + if getErr != nil { + if util.IsStatus404(resp) { + return nil + } + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to read contact center for routing settings %s error: %s", d.Id(), getErr), resp) + } + + if transcription == nil { + _ = d.Set("transcription", nil) + return nil + } + + transcriptionSettings := make(map[string]interface{}) + resourcedata.SetMapValueIfNotNil(transcriptionSettings, "transcription", transcription.Transcription) + resourcedata.SetMapValueIfNotNil(transcriptionSettings, "transcription_confidence_threshold", transcription.TranscriptionConfidenceThreshold) + resourcedata.SetMapValueIfNotNil(transcriptionSettings, "low_latency_transcription_enabled", transcription.LowLatencyTranscriptionEnabled) + resourcedata.SetMapValueIfNotNil(transcriptionSettings, "content_search_enabled", transcription.ContentSearchEnabled) + resourcedata.SetMapValueIfNotNil(transcriptionSettings, "pci_dss_redaction_enabled", transcription.PciDssRedactionEnabled) + resourcedata.SetMapValueIfNotNil(transcriptionSettings, "pii_redaction_enabled", transcription.PiiRedactionEnabled) + + _ = d.Set("transcription", []interface{}{transcriptionSettings}) + return nil +} + +func updateTranscription(ctx context.Context, d *schema.ResourceData, proxy *routingSettingsProxy) diag.Diagnostics { + transcriptionRequest := platformclientv2.Transcriptionsettings{} + + if transcriptionConfigList, ok := d.Get("transcription").([]interface{}); ok && len(transcriptionConfigList) > 0 { + transcriptionMap, ok := transcriptionConfigList[0].(map[string]interface{}) + if !ok { + return nil + } + if transcription, ok := transcriptionMap["transcription"].(string); ok && transcription != "" { + transcriptionRequest.Transcription = &transcription + } + if transcriptionConfidenceThreshold, ok := transcriptionMap["transcription_confidence_threshold"].(int); ok { + transcriptionRequest.TranscriptionConfidenceThreshold = &transcriptionConfidenceThreshold + } + if lowLatencyTranscriptionEnabled, ok := transcriptionMap["low_latency_transcription_enabled"].(bool); ok { + transcriptionRequest.LowLatencyTranscriptionEnabled = &lowLatencyTranscriptionEnabled + } + if contentSearchEnabled, ok := transcriptionMap["content_search_enabled"].(bool); ok { + transcriptionRequest.ContentSearchEnabled = &contentSearchEnabled + } + if pciEnabled, ok := transcriptionMap["pci_dss_redaction_enabled"].(bool); ok { + transcriptionRequest.PciDssRedactionEnabled = &pciEnabled + } + if piiEnabled, ok := transcriptionMap["pii_redaction_enabled"].(bool); ok { + transcriptionRequest.PiiRedactionEnabled = &piiEnabled + } + + _, resp, err := proxy.updateRoutingSettingsTranscription(ctx, transcriptionRequest) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to update Transcription for routing settings %s error: %s", d.Id(), err), resp) + } + } + return nil +} diff --git a/genesyscloud/routing_settings/resource_genesyscloud_routing_settings_schema.go b/genesyscloud/routing_settings/resource_genesyscloud_routing_settings_schema.go new file mode 100644 index 000000000..0f0d50f28 --- /dev/null +++ b/genesyscloud/routing_settings/resource_genesyscloud_routing_settings_schema.go @@ -0,0 +1,101 @@ +package routing_settings + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" +) + +var resourceName = "genesyscloud_routing_settings" + +func SetRegistrar(regInstance registrar.Registrar) { + regInstance.RegisterResource(resourceName, ResourceRoutingSettings()) + regInstance.RegisterExporter(resourceName, RoutingSettingsExporter()) +} + +func ResourceRoutingSettings() *schema.Resource { + return &schema.Resource{ + Description: "An organization's routing settings", + + CreateContext: provider.CreateWithPooledClient(createRoutingSettings), + ReadContext: provider.ReadWithPooledClient(readRoutingSettings), + UpdateContext: provider.UpdateWithPooledClient(updateRoutingSettings), + DeleteContext: provider.DeleteWithPooledClient(deleteRoutingSettings), + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + SchemaVersion: 1, + Schema: map[string]*schema.Schema{ + "reset_agent_on_presence_change": { + Description: "Reset agent score when agent presence changes from off-queue to on-queue", + Type: schema.TypeBool, + Optional: true, + Computed: true, + }, + "contactcenter": { + Description: "Contact center settings", + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "remove_skills_from_blind_transfer": { + Description: "Strip skills from transfer", + Type: schema.TypeBool, + Optional: true, + }, + }, + }, + }, + "transcription": { + Description: "Transcription settings", + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "transcription": { + Description: "Setting to enable/disable transcription capability.Valid values: Disabled, EnabledGlobally, EnabledQueueFlow", + Type: schema.TypeString, + Optional: true, + }, + "transcription_confidence_threshold": { + Description: "Configure confidence threshold. The possible values are from 1 to 100", + Type: schema.TypeInt, + Optional: true, + }, + "low_latency_transcription_enabled": { + Description: "Boolean flag indicating whether low latency transcription via Notification API is enabled", + Type: schema.TypeBool, + Optional: true, + }, + "content_search_enabled": { + Description: "Setting to enable/disable content search", + Type: schema.TypeBool, + Optional: true, + }, + `pci_dss_redaction_enabled`: { + Description: `Setting to enable/disable PCI DSS Redaction`, + Optional: true, + Type: schema.TypeBool, + }, + `pii_redaction_enabled`: { + Description: `Setting to enable/disable PII Redaction`, + Optional: true, + Type: schema.TypeBool, + }, + }, + }, + }, + }, + } +} + +func RoutingSettingsExporter() *resourceExporter.ResourceExporter { + return &resourceExporter.ResourceExporter{ + GetResourcesFunc: provider.GetAllWithPooledClient(getAllRoutingSettings), + } +} diff --git a/genesyscloud/resource_genesyscloud_routing_settings_test.go b/genesyscloud/routing_settings/resource_genesyscloud_routing_settings_test.go similarity index 98% rename from genesyscloud/resource_genesyscloud_routing_settings_test.go rename to genesyscloud/routing_settings/resource_genesyscloud_routing_settings_test.go index 96b87f348..2539787b7 100644 --- a/genesyscloud/resource_genesyscloud_routing_settings_test.go +++ b/genesyscloud/routing_settings/resource_genesyscloud_routing_settings_test.go @@ -1,4 +1,4 @@ -package genesyscloud +package routing_settings import ( "fmt" @@ -17,7 +17,7 @@ func TestAccResourceRoutingSettingsBasic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) }, - ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + ProviderFactories: provider.GetProviderFactories(providerResources, nil), Steps: []resource.TestStep{ { // Create @@ -57,7 +57,7 @@ func TestAccResourceRoutingSettingsContactCenter(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) }, - ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + ProviderFactories: provider.GetProviderFactories(providerResources, nil), Steps: []resource.TestStep{ { // Create with contact center @@ -102,7 +102,7 @@ func TestAccResourceRoutingSettingsTranscription(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) }, - ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + ProviderFactories: provider.GetProviderFactories(providerResources, nil), Steps: []resource.TestStep{ { // Create with transcription diff --git a/genesyscloud/routing_sms_addresses/genesyscloud_routing_sms_addresses_proxy.go b/genesyscloud/routing_sms_addresses/genesyscloud_routing_sms_addresses_proxy.go index 950087dc4..4da161286 100644 --- a/genesyscloud/routing_sms_addresses/genesyscloud_routing_sms_addresses_proxy.go +++ b/genesyscloud/routing_sms_addresses/genesyscloud_routing_sms_addresses_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // Type definitions for each func on our proxy so we can easily mock them out later diff --git a/genesyscloud/routing_sms_addresses/genesyscloud_routing_sms_addresses_schema.go b/genesyscloud/routing_sms_addresses/genesyscloud_routing_sms_addresses_schema.go index c9a449d0c..edc7f69bf 100644 --- a/genesyscloud/routing_sms_addresses/genesyscloud_routing_sms_addresses_schema.go +++ b/genesyscloud/routing_sms_addresses/genesyscloud_routing_sms_addresses_schema.go @@ -5,7 +5,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" ) // SetRegistrar registers all the resources, data sources and exporters in the package @@ -68,7 +68,7 @@ func ResourceRoutingSmsAddress() *schema.Resource { Required: true, ForceNew: true, Type: schema.TypeString, - ValidateDiagFunc: gcloud.ValidateCountryCode, + ValidateDiagFunc: validators.ValidateCountryCode, }, `auto_correct_address`: { Description: `This is used when the address is created. If the value is not set or true, then the system will, if necessary, auto-correct the address you provide. Set this value to false if the system should not auto-correct the address.`, diff --git a/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses.go b/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses.go index 932dad163..d578d8b0c 100644 --- a/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses.go +++ b/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) const resourceName = "genesyscloud_routing_sms_address" diff --git a/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses_test.go b/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses_test.go index a54f64e56..4d4185ee8 100644 --- a/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses_test.go +++ b/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceRoutingSmsAddressesProdOrg(t *testing.T) { diff --git a/genesyscloud/routing_utilization/genesyscloud_routing_utilization_init_test.go b/genesyscloud/routing_utilization/genesyscloud_routing_utilization_init_test.go new file mode 100644 index 000000000..3a9ec469f --- /dev/null +++ b/genesyscloud/routing_utilization/genesyscloud_routing_utilization_init_test.go @@ -0,0 +1,47 @@ +package routing_utilization + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "sync" + "terraform-provider-genesyscloud/genesyscloud/routing_utilization_label" + "testing" +) + +/* +The genesyscloud_routing_utilization_init_test.go file is used to initialize the data sources and resources +used in testing the routing_utilization resource. +*/ + +// providerResources holds a map of all registered resources +var providerResources map[string]*schema.Resource + +type registerTestInstance struct { + resourceMapMutex sync.RWMutex +} + +// registerTestResources registers all resources used in the tests +func (r *registerTestInstance) registerTestResources() { + r.resourceMapMutex.Lock() + defer r.resourceMapMutex.Unlock() + + providerResources[resourceName] = ResourceRoutingUtilization() + providerResources["genesyscloud_routing_utilization_label"] = routing_utilization_label.ResourceRoutingUtilizationLabel() +} + +// initTestResources initializes all test resources and data sources. +func initTestResources() { + providerResources = make(map[string]*schema.Resource) + + regInstance := ®isterTestInstance{} + + regInstance.registerTestResources() +} + +// TestMain is a "setup" function called by the testing framework when run the test +func TestMain(m *testing.M) { + // Run setup function before starting the test suite for the package + initTestResources() + + // Run the test suite for the package + m.Run() +} diff --git a/genesyscloud/routing_utilization/genesyscloud_routing_utilization_proxy.go b/genesyscloud/routing_utilization/genesyscloud_routing_utilization_proxy.go new file mode 100644 index 000000000..776d9664a --- /dev/null +++ b/genesyscloud/routing_utilization/genesyscloud_routing_utilization_proxy.go @@ -0,0 +1,99 @@ +package routing_utilization + +import ( + "context" + "fmt" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" +) + +var internalProxy *routingUtilizationProxy + +type getRoutingUtilizationFunc func(ctx context.Context, p *routingUtilizationProxy) (*platformclientv2.APIResponse, error) +type updateRoutingUtilizationFunc func(ctx context.Context, p *routingUtilizationProxy, request *platformclientv2.Utilizationrequest) (*platformclientv2.Utilizationresponse, *platformclientv2.APIResponse, error) +type deleteRoutingUtilizationFunc func(ctx context.Context, p *routingUtilizationProxy) (*platformclientv2.APIResponse, error) + +type updateDirectlyFunc func(ctx context.Context, p *routingUtilizationProxy, d *schema.ResourceData, utilizationRequest []interface{}) (*platformclientv2.APIResponse, error) + +type routingUtilizationProxy struct { + clientConfig *platformclientv2.Configuration + routingApi *platformclientv2.RoutingApi + getRoutingUtilizationAttr getRoutingUtilizationFunc + updateRoutingUtilizationAttr updateRoutingUtilizationFunc + deleteRoutingUtilizationAttr deleteRoutingUtilizationFunc + + updateDirectlyAttr updateDirectlyFunc +} + +func newRoutingUtilizationProxy(clientConfig *platformclientv2.Configuration) *routingUtilizationProxy { + api := platformclientv2.NewRoutingApiWithConfig(clientConfig) + return &routingUtilizationProxy{ + clientConfig: clientConfig, + routingApi: api, + getRoutingUtilizationAttr: getRoutingUtilizationFn, + updateRoutingUtilizationAttr: updateRoutingUtilizationFn, + deleteRoutingUtilizationAttr: deleteRoutingUtilizationFn, + + updateDirectlyAttr: updateDirectlyFn, + } +} + +func getRoutingUtilizationProxy(clientConfig *platformclientv2.Configuration) *routingUtilizationProxy { + if internalProxy == nil { + internalProxy = newRoutingUtilizationProxy(clientConfig) + } + return internalProxy +} + +func (p *routingUtilizationProxy) getRoutingUtilization(ctx context.Context) (*platformclientv2.APIResponse, error) { + return p.getRoutingUtilizationAttr(ctx, p) +} +func (p *routingUtilizationProxy) updateRoutingUtilization(ctx context.Context, request *platformclientv2.Utilizationrequest) (*platformclientv2.Utilizationresponse, *platformclientv2.APIResponse, error) { + return p.updateRoutingUtilizationAttr(ctx, p, request) +} +func (p *routingUtilizationProxy) deleteRoutingUtilization(ctx context.Context) (*platformclientv2.APIResponse, error) { + return p.deleteRoutingUtilizationAttr(ctx, p) +} + +func (p *routingUtilizationProxy) updateDirectly(ctx context.Context, d *schema.ResourceData, utilizationRequest []interface{}) (*platformclientv2.APIResponse, error) { + return p.updateDirectlyAttr(ctx, p, d, utilizationRequest) +} + +// Calling the Utilization API directly while the label feature is not available. +// Once it is, this code can go back to using platformclientv2's RoutingApi to make the call. +func getRoutingUtilizationFn(ctx context.Context, p *routingUtilizationProxy) (*platformclientv2.APIResponse, error) { + apiClient := &p.routingApi.Configuration.APIClient + path := fmt.Sprintf("%s/api/v2/routing/utilization", p.routingApi.Configuration.BasePath) + headerParams := buildHeaderParams(p.routingApi) + resp, err := apiClient.CallAPI(path, "GET", nil, headerParams, nil, nil, "", nil) + if err != nil { + return resp, fmt.Errorf("failed to get routing utilization %s ", err) + } + return resp, nil +} + +func updateRoutingUtilizationFn(ctx context.Context, p *routingUtilizationProxy, utilizationRequest *platformclientv2.Utilizationrequest) (*platformclientv2.Utilizationresponse, *platformclientv2.APIResponse, error) { + return p.routingApi.PutRoutingUtilization(*utilizationRequest) +} + +func deleteRoutingUtilizationFn(ctx context.Context, p *routingUtilizationProxy) (*platformclientv2.APIResponse, error) { + return p.routingApi.DeleteRoutingUtilization() +} + +// If the resource has label(s), calls the Utilization API directly. +// This code can go back to using platformclientv2's RoutingApi to make the call once label utilization is available in platformclientv2's RoutingApi +func updateDirectlyFn(ctx context.Context, p *routingUtilizationProxy, d *schema.ResourceData, utilizationRequest []interface{}) (*platformclientv2.APIResponse, error) { + apiClient := &p.routingApi.Configuration.APIClient + + path := fmt.Sprintf("%s/api/v2/routing/utilization", p.routingApi.Configuration.BasePath) + headerParams := buildHeaderParams(p.routingApi) + requestPayload := make(map[string]interface{}) + requestPayload["utilization"] = buildSdkMediaUtilizations(d) + requestPayload["labelUtilizations"] = BuildLabelUtilizationsRequest(utilizationRequest) + + resp, err := apiClient.CallAPI(path, "PUT", requestPayload, headerParams, nil, nil, "", nil) + if err != nil { + return resp, fmt.Errorf("error updating directly %s", err) + } + return resp, nil +} diff --git a/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization.go b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization.go new file mode 100644 index 000000000..27acc28ba --- /dev/null +++ b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization.go @@ -0,0 +1,128 @@ +package routing_utilization + +import ( + "context" + "encoding/json" + "fmt" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "log" + "terraform-provider-genesyscloud/genesyscloud/provider" + "terraform-provider-genesyscloud/genesyscloud/util" + "terraform-provider-genesyscloud/genesyscloud/util/constants" + + "terraform-provider-genesyscloud/genesyscloud/consistency_checker" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" +) + +func getAllRoutingUtilization(_ context.Context, _ *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { + // Routing utilization config always exists + resources := make(resourceExporter.ResourceIDMetaMap) + resources["0"] = &resourceExporter.ResourceMeta{Name: "routing_utilization"} + return resources, nil +} + +func createRoutingUtilization(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + log.Printf("Creating Routing Utilization") + d.SetId("routing_utilization") + return updateRoutingUtilization(ctx, d, meta) +} + +func readRoutingUtilization(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + // Calling the Utilization API directly while the label feature is not available. + // Once it is, this code can go back to using platformclientv2's RoutingApi to make the call. + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingUtilizationProxy(sdkConfig) + cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceRoutingUtilization(), constants.DefaultConsistencyChecks, resourceName) + orgUtilization := &OrgUtilizationWithLabels{} + + log.Printf("Reading Routing Utilization") + + return util.WithRetriesForRead(ctx, d, func() *retry.RetryError { + resp, err := proxy.getRoutingUtilization(ctx) + if err != nil { + if util.IsStatus404(resp) { + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read Routing Utilization: %s", err), resp)) + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read Routing Utilization: %s", err), resp)) + } + + err = json.Unmarshal(resp.RawBody, &orgUtilization) + + if orgUtilization.Utilization != nil { + for sdkType, schemaType := range UtilizationMediaTypes { + if mediaSettings, ok := orgUtilization.Utilization[sdkType]; ok { + _ = d.Set(schemaType, FlattenUtilizationSetting(mediaSettings)) + } else { + _ = d.Set(schemaType, nil) + } + } + } + + if orgUtilization.LabelUtilizations != nil { + originalLabelUtilizations := d.Get("label_utilizations").([]interface{}) + // Only add to the state the configured labels, in the configured order, but not any extras, to help terraform with matching new and old state. + flattenedLabelUtilizations := FilterAndFlattenLabelUtilizations(orgUtilization.LabelUtilizations, originalLabelUtilizations) + _ = d.Set("label_utilizations", flattenedLabelUtilizations) + } + + log.Printf("Read Routing Utilization") + return cc.CheckState(d) + }) +} + +func updateRoutingUtilization(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingUtilizationProxy(sdkConfig) + + labelUtilizations := d.Get("label_utilizations").([]interface{}) + var resp *platformclientv2.APIResponse + var err error + + log.Printf("Updating Routing Utilization") + + // Retrying on 409s because if a label is created immediately before the utilization update, it can lead to a conflict while the utilization is being updated to handle the new label. + diagErr := util.RetryWhen(util.IsStatus409, func() (*platformclientv2.APIResponse, diag.Diagnostics) { + // If the resource has label(s), calls the Utilization API directly. + // This code can go back to using platformclientv2's RoutingApi to make the call once label utilization is available in platformclientv2's RoutingApi. + if labelUtilizations != nil && len(labelUtilizations) > 0 { + resp, err := proxy.updateDirectly(ctx, d, labelUtilizations) + if err != nil { + return resp, util.BuildAPIDiagnosticError(resourceName, "Failed to update routing utilization directly", resp) + } + } else { + _, resp, err = proxy.updateRoutingUtilization(ctx, &platformclientv2.Utilizationrequest{ + Utilization: buildSdkMediaUtilizations(d), + }) + } + + if err != nil { + return resp, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to update Routing Utilization %s error: %s", d.Id(), err), resp) + } + return resp, nil + }) + if diagErr != nil { + return diagErr + } + + log.Printf("Updated Routing Utilization") + return readRoutingUtilization(ctx, d, meta) +} + +func deleteRoutingUtilization(ctx context.Context, _ *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingUtilizationProxy(sdkConfig) + + // Resets to default values + log.Printf("Resetting Routing Utilization") + + resp, err := proxy.deleteRoutingUtilization(ctx) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to reset Routing Utilization | error: %s", err), resp) + } + log.Printf("Reset Routing Utilization") + return nil +} diff --git a/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_schema.go b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_schema.go new file mode 100644 index 000000000..0ebba6209 --- /dev/null +++ b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_schema.go @@ -0,0 +1,167 @@ +package routing_utilization + +import ( + "fmt" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "strings" + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" + "time" +) + +const resourceName = "genesyscloud_routing_utilization" + +// SetRegistrar registers all the resources and exporters in the package +func SetRegistrar(regInstance registrar.Registrar) { + regInstance.RegisterResource(resourceName, ResourceRoutingUtilization()) + regInstance.RegisterExporter(resourceName, RoutingUtilizationExporter()) +} + +type MediaUtilization struct { + MaximumCapacity int32 `json:"maximumCapacity"` + InterruptableMediaTypes []string `json:"interruptableMediaTypes"` + IncludeNonAcd bool `json:"includeNonAcd"` +} + +type LabelUtilization struct { + MaximumCapacity int32 `json:"maximumCapacity"` + InterruptingLabelIds []string `json:"interruptingLabelIds"` +} + +type OrgUtilizationWithLabels struct { + Utilization map[string]MediaUtilization `json:"utilization"` + LabelUtilizations map[string]LabelUtilization `json:"labelUtilizations"` +} + +var ( + // Map of SDK media type name to schema media type name + UtilizationMediaTypes = map[string]string{ + "call": "call", + "callback": "callback", + "chat": "chat", + "email": "email", + "message": "message", + } + + UtilizationSettingsResource = &schema.Resource{ + Schema: map[string]*schema.Schema{ + "maximum_capacity": { + Description: "Maximum capacity of conversations of this media type. Value must be between 0 and 25.", + Type: schema.TypeInt, + Required: true, + ValidateFunc: validation.IntBetween(0, 25), + }, + "interruptible_media_types": { + Description: fmt.Sprintf("Set of other media types that can interrupt this media type (%s).", strings.Join(getSdkUtilizationTypes(), " | ")), + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "include_non_acd": { + Description: "Block this media type when on a non-ACD conversation.", + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + }, + } + + UtilizationLabelResource = &schema.Resource{ + Schema: map[string]*schema.Schema{ + "label_id": { + Description: "Id of the label being configured.", + Type: schema.TypeString, + Required: true, + }, + "maximum_capacity": { + Description: "Maximum capacity of conversations with this label. Value must be between 0 and 25.", + Type: schema.TypeInt, + Required: true, + ValidateFunc: validation.IntBetween(0, 25), + }, + "interrupting_label_ids": { + Description: "Set of other labels that can interrupt this label.", + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + }, + } +) + +func ResourceRoutingUtilization() *schema.Resource { + return &schema.Resource{ + Description: "Genesys Cloud Org-wide Routing Utilization Settings.", + + CreateContext: provider.CreateWithPooledClient(createRoutingUtilization), + ReadContext: provider.ReadWithPooledClient(readRoutingUtilization), + UpdateContext: provider.UpdateWithPooledClient(updateRoutingUtilization), + DeleteContext: provider.DeleteWithPooledClient(deleteRoutingUtilization), + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + SchemaVersion: 1, + Timeouts: &schema.ResourceTimeout{ + Update: schema.DefaultTimeout(8 * time.Minute), + Read: schema.DefaultTimeout(8 * time.Minute), + }, + Schema: map[string]*schema.Schema{ + "call": { + Description: "Call media settings. If not set, this reverts to the default media type settings.", + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Computed: true, + Elem: UtilizationSettingsResource, + }, + "callback": { + Description: "Callback media settings. If not set, this reverts to the default media type settings.", + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Computed: true, + Elem: UtilizationSettingsResource, + }, + "message": { + Description: "Message media settings. If not set, this reverts to the default media type settings.", + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Computed: true, + Elem: UtilizationSettingsResource, + }, + "email": { + Description: "Email media settings. If not set, this reverts to the default media type settings.", + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Computed: true, + Elem: UtilizationSettingsResource, + }, + "chat": { + Description: "Chat media settings. If not set, this reverts to the default media type settings.", + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Computed: true, + Elem: UtilizationSettingsResource, + }, + "label_utilizations": { + Description: "Label utilization settings. If not set, default label settings will be applied. This is in PREVIEW and should not be used unless the feature is available to your organization.", + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: UtilizationLabelResource, + }, + }, + } +} + +func RoutingUtilizationExporter() *resourceExporter.ResourceExporter { + return &resourceExporter.ResourceExporter{ + GetResourcesFunc: provider.GetAllWithPooledClient(getAllRoutingUtilization), + AllowZeroValues: []string{"maximum_capacity"}, + } +} diff --git a/genesyscloud/resource_genesyscloud_routing_utilization_test.go b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_test.go similarity index 77% rename from genesyscloud/resource_genesyscloud_routing_utilization_test.go rename to genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_test.go index 65f90323c..0e5019ce6 100644 --- a/genesyscloud/resource_genesyscloud_routing_utilization_test.go +++ b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_test.go @@ -1,4 +1,4 @@ -package genesyscloud +package routing_utilization import ( "fmt" @@ -6,6 +6,7 @@ import ( "strconv" "strings" "terraform-provider-genesyscloud/genesyscloud/provider" + routingUtilizationLabel "terraform-provider-genesyscloud/genesyscloud/routing_utilization_label" "terraform-provider-genesyscloud/genesyscloud/util" "testing" "time" @@ -13,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceBasicRoutingUtilization(t *testing.T) { @@ -27,16 +28,16 @@ func TestAccResourceBasicRoutingUtilization(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) }, - ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + ProviderFactories: provider.GetProviderFactories(providerResources, nil), Steps: []resource.TestStep{ { // Create Config: generateRoutingUtilizationResource( - generateRoutingUtilMediaType("call", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("callback", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("chat", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("email", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("message", maxCapacity1, util.FalseValue), + GenerateRoutingUtilMediaType("call", maxCapacity1, util.FalseValue), + GenerateRoutingUtilMediaType("callback", maxCapacity1, util.FalseValue), + GenerateRoutingUtilMediaType("chat", maxCapacity1, util.FalseValue), + GenerateRoutingUtilMediaType("email", maxCapacity1, util.FalseValue), + GenerateRoutingUtilMediaType("message", maxCapacity1, util.FalseValue), ), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("genesyscloud_routing_utilization.routing-util", "call.0.maximum_capacity", maxCapacity1), @@ -59,11 +60,11 @@ func TestAccResourceBasicRoutingUtilization(t *testing.T) { { // Update with a new max capacities and interruptible media types Config: generateRoutingUtilizationResource( - generateRoutingUtilMediaType("call", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeEmail)), - generateRoutingUtilMediaType("callback", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("chat", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("email", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("message", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + GenerateRoutingUtilMediaType("call", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeEmail)), + GenerateRoutingUtilMediaType("callback", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + GenerateRoutingUtilMediaType("chat", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + GenerateRoutingUtilMediaType("email", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + GenerateRoutingUtilMediaType("message", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), ), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("genesyscloud_routing_utilization.routing-util", "call.0.maximum_capacity", maxCapacity2), @@ -108,30 +109,32 @@ func TestAccResourceRoutingUtilizationWithLabels(t *testing.T) { greenLabelName = "Terraform Green Label" + uuid.NewString() ) - CleanupRoutingUtilizationLabel() + if err := CleanupRoutingUtilizationLabel(); err != nil { + t.Skipf("%v", err) // Skip the test and not fail it + } resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) - if err := checkIfLabelsAreEnabled(); err != nil { + if err := routingUtilizationLabel.CheckIfLabelsAreEnabled(); err != nil { t.Skipf("%v", err) // be sure to skip the test and not fail it } }, - ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + ProviderFactories: provider.GetProviderFactories(providerResources, nil), Steps: []resource.TestStep{ { // Create - Config: GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + - GenerateRoutingUtilizationLabelResource(blueLabelResource, blueLabelName, redLabelResource) + - GenerateRoutingUtilizationLabelResource(greenLabelResource, greenLabelName, blueLabelResource) + + Config: routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + + routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(blueLabelResource, blueLabelName, redLabelResource) + + routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(greenLabelResource, greenLabelName, blueLabelResource) + generateRoutingUtilizationResource( - generateRoutingUtilMediaType("call", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("callback", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("chat", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("email", maxCapacity1, util.FalseValue), - generateRoutingUtilMediaType("message", maxCapacity1, util.FalseValue), - generateLabelUtilization(redLabelResource, maxCapacity1), - generateLabelUtilization(blueLabelResource, maxCapacity1, redLabelResource), + GenerateRoutingUtilMediaType("call", maxCapacity1, util.FalseValue), + GenerateRoutingUtilMediaType("callback", maxCapacity1, util.FalseValue), + GenerateRoutingUtilMediaType("chat", maxCapacity1, util.FalseValue), + GenerateRoutingUtilMediaType("email", maxCapacity1, util.FalseValue), + GenerateRoutingUtilMediaType("message", maxCapacity1, util.FalseValue), + routingUtilizationLabel.GenerateLabelUtilization(redLabelResource, maxCapacity1), + routingUtilizationLabel.GenerateLabelUtilization(blueLabelResource, maxCapacity1, redLabelResource), ), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("genesyscloud_routing_utilization.routing-util", "call.0.maximum_capacity", maxCapacity1), @@ -157,17 +160,17 @@ func TestAccResourceRoutingUtilizationWithLabels(t *testing.T) { }, { // Update with a new max capacities and interruptible media types - Config: GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + - GenerateRoutingUtilizationLabelResource(blueLabelResource, blueLabelName, redLabelResource) + - GenerateRoutingUtilizationLabelResource(greenLabelResource, greenLabelName, blueLabelResource) + + Config: routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + + routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(blueLabelResource, blueLabelName, redLabelResource) + + routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(greenLabelResource, greenLabelName, blueLabelResource) + generateRoutingUtilizationResource( - generateRoutingUtilMediaType("call", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeEmail)), - generateRoutingUtilMediaType("callback", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("chat", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("email", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("message", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateLabelUtilization(redLabelResource, maxCapacity2), - generateLabelUtilization(blueLabelResource, maxCapacity2, redLabelResource), + GenerateRoutingUtilMediaType("call", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeEmail)), + GenerateRoutingUtilMediaType("callback", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + GenerateRoutingUtilMediaType("chat", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + GenerateRoutingUtilMediaType("email", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + GenerateRoutingUtilMediaType("message", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilizationLabel.GenerateLabelUtilization(redLabelResource, maxCapacity2), + routingUtilizationLabel.GenerateLabelUtilization(blueLabelResource, maxCapacity2, redLabelResource), ), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("genesyscloud_routing_utilization.routing-util", "call.0.maximum_capacity", maxCapacity2), @@ -192,27 +195,27 @@ func TestAccResourceRoutingUtilizationWithLabels(t *testing.T) { ), }, { //Delete one by one to avoid conflict - Config: GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + - GenerateRoutingUtilizationLabelResource(blueLabelResource, blueLabelName, redLabelResource) + + Config: routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + + routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(blueLabelResource, blueLabelName, redLabelResource) + generateRoutingUtilizationResource( - generateRoutingUtilMediaType("call", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeEmail)), - generateRoutingUtilMediaType("callback", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("chat", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("email", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("message", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateLabelUtilization(redLabelResource, maxCapacity2), - generateLabelUtilization(blueLabelResource, maxCapacity2, redLabelResource), + GenerateRoutingUtilMediaType("call", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeEmail)), + GenerateRoutingUtilMediaType("callback", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + GenerateRoutingUtilMediaType("chat", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + GenerateRoutingUtilMediaType("email", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + GenerateRoutingUtilMediaType("message", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilizationLabel.GenerateLabelUtilization(redLabelResource, maxCapacity2), + routingUtilizationLabel.GenerateLabelUtilization(blueLabelResource, maxCapacity2, redLabelResource), ), }, { - Config: GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + + Config: routingUtilizationLabel.GenerateRoutingUtilizationLabelResource(redLabelResource, redLabelName, "") + generateRoutingUtilizationResource( - generateRoutingUtilMediaType("call", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeEmail)), - generateRoutingUtilMediaType("callback", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("chat", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("email", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateRoutingUtilMediaType("message", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), - generateLabelUtilization(redLabelResource, maxCapacity2), + GenerateRoutingUtilMediaType("call", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeEmail)), + GenerateRoutingUtilMediaType("callback", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + GenerateRoutingUtilMediaType("chat", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + GenerateRoutingUtilMediaType("email", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + GenerateRoutingUtilMediaType("message", maxCapacity2, util.TrueValue, strconv.Quote(utilTypeCall)), + routingUtilizationLabel.GenerateLabelUtilization(redLabelResource, maxCapacity2), ), }, { @@ -273,37 +276,6 @@ func assertAttributeEquals(state *terraform.InstanceState, attributeName, expect } } -func generateRoutingUtilMediaType( - mediaType string, - maxCapacity string, - includeNonAcd string, - interruptTypes ...string) string { - return fmt.Sprintf(`%s { - maximum_capacity = %s - include_non_acd = %s - interruptible_media_types = [%s] - } - `, mediaType, maxCapacity, includeNonAcd, strings.Join(interruptTypes, ",")) -} - -func generateLabelUtilization( - labelResource string, - maxCapacity string, - interruptingLabelResourceNames ...string) string { - - interruptingLabelResources := make([]string, 0) - for _, resourceName := range interruptingLabelResourceNames { - interruptingLabelResources = append(interruptingLabelResources, "genesyscloud_routing_utilization_label."+resourceName+".id") - } - - return fmt.Sprintf(`label_utilizations { - label_id = genesyscloud_routing_utilization_label.%s.id - maximum_capacity = %s - interrupting_label_ids = [%s] - } - `, labelResource, maxCapacity, strings.Join(interruptingLabelResources, ",")) -} - func generateRoutingUtilizationResource(attributes ...string) string { return fmt.Sprintf(`resource "genesyscloud_routing_utilization" "routing-util" { %s @@ -311,19 +283,24 @@ func generateRoutingUtilizationResource(attributes ...string) string { `, strings.Join(attributes, "\n")) } -func CleanupRoutingUtilizationLabel() { - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) +func CleanupRoutingUtilizationLabel() error { + config, err := provider.AuthorizeSdk() + if err != nil { + return err + } + + routingAPI := platformclientv2.NewRoutingApiWithConfig(config) for pageNum := 1; ; pageNum++ { const pageSize = 100 labels, _, getErr := routingAPI.GetRoutingUtilizationLabels(pageSize, pageNum, "", "") if getErr != nil { log.Printf("failed to get page %v of routing email domains: %v", pageNum, getErr) - return + return getErr } if labels.Entities == nil || len(*labels.Entities) == 0 { - return + return nil } for _, label := range *labels.Entities { diff --git a/genesyscloud/routing_utilization/resource_routing_utilization_utils.go b/genesyscloud/routing_utilization/resource_routing_utilization_utils.go new file mode 100644 index 000000000..060d857b8 --- /dev/null +++ b/genesyscloud/routing_utilization/resource_routing_utilization_utils.go @@ -0,0 +1,135 @@ +package routing_utilization + +import ( + "fmt" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "sort" + "strings" + "terraform-provider-genesyscloud/genesyscloud/util/lists" +) + +func buildSdkMediaUtilizations(d *schema.ResourceData) *map[string]platformclientv2.Mediautilization { + settings := make(map[string]platformclientv2.Mediautilization) + + for sdkType, schemaType := range UtilizationMediaTypes { + mediaSettings := d.Get(schemaType).([]interface{}) + if mediaSettings != nil && len(mediaSettings) > 0 { + settings[sdkType] = BuildSdkMediaUtilization(mediaSettings) + } + } + + return &settings +} + +func BuildSdkMediaUtilization(settings []interface{}) platformclientv2.Mediautilization { + settingsMap := settings[0].(map[string]interface{}) + + maxCapacity := settingsMap["maximum_capacity"].(int) + includeNonAcd := settingsMap["include_non_acd"].(bool) + + // Optional + interruptableMediaTypes := &[]string{} + if types, ok := settingsMap["interruptible_media_types"]; ok { + interruptableMediaTypes = lists.SetToStringList(types.(*schema.Set)) + } + + return platformclientv2.Mediautilization{ + MaximumCapacity: &maxCapacity, + IncludeNonAcd: &includeNonAcd, + InterruptableMediaTypes: interruptableMediaTypes, + } +} + +func BuildLabelUtilizationsRequest(labelUtilizations []interface{}) map[string]LabelUtilization { + request := make(map[string]LabelUtilization) + for _, labelUtilization := range labelUtilizations { + labelUtilizationMap := labelUtilization.(map[string]interface{}) + interruptingLabelIds := lists.SetToStringList(labelUtilizationMap["interrupting_label_ids"].(*schema.Set)) + + request[labelUtilizationMap["label_id"].(string)] = LabelUtilization{ + MaximumCapacity: int32(labelUtilizationMap["maximum_capacity"].(int)), + InterruptingLabelIds: *interruptingLabelIds, + } + } + return request +} + +func FlattenUtilizationSetting(settings MediaUtilization) []interface{} { + settingsMap := make(map[string]interface{}) + + settingsMap["maximum_capacity"] = settings.MaximumCapacity + settingsMap["include_non_acd"] = settings.IncludeNonAcd + if settings.InterruptableMediaTypes != nil { + settingsMap["interruptible_media_types"] = lists.StringListToSet(settings.InterruptableMediaTypes) + } + + return []interface{}{settingsMap} +} + +func FilterAndFlattenLabelUtilizations(labelUtilizations map[string]LabelUtilization, originalLabelUtilizations []interface{}) []interface{} { + flattenedLabelUtilizations := make([]interface{}, 0) + + for _, originalLabelUtilization := range originalLabelUtilizations { + originalLabelId := (originalLabelUtilization.(map[string]interface{}))["label_id"].(string) + + for currentLabelId, currentLabelUtilization := range labelUtilizations { + if currentLabelId == originalLabelId { + flattenedLabelUtilizations = append(flattenedLabelUtilizations, flattenLabelUtilization(currentLabelId, currentLabelUtilization)) + delete(labelUtilizations, currentLabelId) + break + } + } + } + + return flattenedLabelUtilizations +} + +func flattenLabelUtilization(labelId string, labelUtilization LabelUtilization) map[string]interface{} { + utilizationMap := make(map[string]interface{}) + + utilizationMap["label_id"] = labelId + utilizationMap["maximum_capacity"] = labelUtilization.MaximumCapacity + if labelUtilization.InterruptingLabelIds != nil { + utilizationMap["interrupting_label_ids"] = lists.StringListToSet(labelUtilization.InterruptingLabelIds) + } + + return utilizationMap +} + +func GenerateRoutingUtilMediaType( + mediaType string, + maxCapacity string, + includeNonAcd string, + interruptTypes ...string) string { + return fmt.Sprintf(`%s { + maximum_capacity = %s + include_non_acd = %s + interruptible_media_types = [%s] + } + `, mediaType, maxCapacity, includeNonAcd, strings.Join(interruptTypes, ",")) +} + +func getSdkUtilizationTypes() []string { + types := make([]string, 0, len(UtilizationMediaTypes)) + for t := range UtilizationMediaTypes { + types = append(types, t) + } + sort.Strings(types) + return types +} + +// TODO: remove when routing skill group is refactored +func buildHeaderParams(routingAPI *platformclientv2.RoutingApi) map[string]string { + headerParams := make(map[string]string) + + for key := range routingAPI.Configuration.DefaultHeader { + headerParams[key] = routingAPI.Configuration.DefaultHeader[key] + } + + headerParams["Authorization"] = "Bearer " + routingAPI.Configuration.AccessToken + headerParams["Content-Type"] = "application/json" + headerParams["Accept"] = "application/json" + + return headerParams +} diff --git a/genesyscloud/routing_utilization_label/data_source_genesyscloud_routing_utilization_label.go b/genesyscloud/routing_utilization_label/data_source_genesyscloud_routing_utilization_label.go new file mode 100644 index 000000000..f4c1e55a9 --- /dev/null +++ b/genesyscloud/routing_utilization_label/data_source_genesyscloud_routing_utilization_label.go @@ -0,0 +1,33 @@ +package routing_utilization_label + +import ( + "context" + "fmt" + "terraform-provider-genesyscloud/genesyscloud/provider" + "terraform-provider-genesyscloud/genesyscloud/util" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceRoutingUtilizationLabelRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + sdkConfig := m.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingUtilizationLabelProxy(sdkConfig) + name := d.Get("name").(string) + + return util.WithRetries(ctx, 15*time.Second, func() *retry.RetryError { + label, retryable, resp, getErr := proxy.getRoutingUtilizationLabelByName(ctx, name) + + if getErr != nil && !retryable{ + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Error requesting label %s | error: %s", name, getErr), resp)) + } + + if retryable { + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("No labels found with name %s", name), resp)) + } + d.SetId(*label.Id) + return nil + }) +} diff --git a/genesyscloud/data_source_genesyscloud_routing_utilization_label_test.go b/genesyscloud/routing_utilization_label/data_source_genesyscloud_routing_utilization_label_test.go similarity index 95% rename from genesyscloud/data_source_genesyscloud_routing_utilization_label_test.go rename to genesyscloud/routing_utilization_label/data_source_genesyscloud_routing_utilization_label_test.go index 7822c81e5..d30634274 100644 --- a/genesyscloud/data_source_genesyscloud_routing_utilization_label_test.go +++ b/genesyscloud/routing_utilization_label/data_source_genesyscloud_routing_utilization_label_test.go @@ -1,4 +1,4 @@ -package genesyscloud +package routing_utilization_label import ( "fmt" @@ -20,7 +20,7 @@ func TestAccDataSourceRoutingUtilizationLabel(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) - if err := checkIfLabelsAreEnabled(); err != nil { + if err := CheckIfLabelsAreEnabled(); err != nil { t.Skipf("%v", err) // be sure to skip the test and not fail it } }, diff --git a/genesyscloud/routing_utilization_label/genesyscloud_routing_utilization_label_init_test.go b/genesyscloud/routing_utilization_label/genesyscloud_routing_utilization_label_init_test.go new file mode 100644 index 000000000..4de37bfab --- /dev/null +++ b/genesyscloud/routing_utilization_label/genesyscloud_routing_utilization_label_init_test.go @@ -0,0 +1,52 @@ +package routing_utilization_label + +import ( + "sync" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +var providerDataSources map[string]*schema.Resource +var providerResources map[string]*schema.Resource + +type registerTestInstance struct { + resourceMapMutex sync.RWMutex + datasourceMapMutex sync.RWMutex +} + +// registerTestResources registers all resources used in the tests +func (r *registerTestInstance) registerTestResources() { + r.resourceMapMutex.Lock() + defer r.resourceMapMutex.Unlock() + + providerResources[resourceName] = ResourceRoutingUtilizationLabel() +} + +// registerTestDataSources registers all data sources used in the tests. +func (r *registerTestInstance) registerTestDataSources() { + r.datasourceMapMutex.Lock() + defer r.datasourceMapMutex.Unlock() + + providerDataSources[resourceName] = DataSourceRoutingUtilizationLabel() +} + +// initTestResources initializes all test resources and data sources. +func initTestResources() { + providerDataSources = make(map[string]*schema.Resource) + providerResources = make(map[string]*schema.Resource) + + regInstance := ®isterTestInstance{} + + regInstance.registerTestDataSources() + regInstance.registerTestResources() +} + +// TestMain is a "setup" function called by the testing framework when run the test +func TestMain(m *testing.M) { + // Run setup function before starting the test suite for routing_utilization_label package + initTestResources() + + // Run the test suite for the routing_utilization_label package + m.Run() +} diff --git a/genesyscloud/routing_utilization_label/genesyscloud_routing_utilization_label_proxy.go b/genesyscloud/routing_utilization_label/genesyscloud_routing_utilization_label_proxy.go new file mode 100644 index 000000000..fc19feb6c --- /dev/null +++ b/genesyscloud/routing_utilization_label/genesyscloud_routing_utilization_label_proxy.go @@ -0,0 +1,149 @@ +package routing_utilization_label + +import ( + "context" + "fmt" + "log" + rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" + + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" +) + +var internalProxy *routingUtilizationLabelProxy + +type getAllRoutingUtilizationLabelsFunc func(ctx context.Context, p *routingUtilizationLabelProxy, name string) (*[]platformclientv2.Utilizationlabel, *platformclientv2.APIResponse, error) +type createRoutingUtilizationLabelFunc func(ctx context.Context, p *routingUtilizationLabelProxy, req *platformclientv2.Createutilizationlabelrequest) (*platformclientv2.Utilizationlabel, *platformclientv2.APIResponse, error) +type getRoutingUtilizationLabelFunc func(ctx context.Context, p *routingUtilizationLabelProxy, id string) (*platformclientv2.Utilizationlabel, *platformclientv2.APIResponse, error) +type getRoutingUtilizationLabelByNameFunc func(ctx context.Context, p *routingUtilizationLabelProxy, name string) (*platformclientv2.Utilizationlabel, bool, *platformclientv2.APIResponse, error) +type updateRoutingUtilizationLabelFunc func(ctx context.Context, p *routingUtilizationLabelProxy, id string, updateutilizationlabelrequest *platformclientv2.Updateutilizationlabelrequest) (*platformclientv2.Utilizationlabel, *platformclientv2.APIResponse, error) +type deleteRoutingUtilizationLabelFunc func(ctx context.Context, p *routingUtilizationLabelProxy, id string, forceDelete bool) (*platformclientv2.APIResponse, error) + +type routingUtilizationLabelProxy struct { + clientConfig *platformclientv2.Configuration + routingApi *platformclientv2.RoutingApi + getAllRoutingUtilizationLabelsAttr getAllRoutingUtilizationLabelsFunc + createRoutingUtilizationLabelAttr createRoutingUtilizationLabelFunc + getRoutingUtilizationLabelAttr getRoutingUtilizationLabelFunc + getRoutingUtilizationLabelByNameAttr getRoutingUtilizationLabelByNameFunc + updateRoutingUtilizationLabelAttr updateRoutingUtilizationLabelFunc + deleteRoutingUtilizationLabelAttr deleteRoutingUtilizationLabelFunc + routingCache rc.CacheInterface[platformclientv2.Utilizationlabel] +} + +func newRoutingUtilizationLabelProxy(clientConfig *platformclientv2.Configuration) *routingUtilizationLabelProxy { + api := platformclientv2.NewRoutingApiWithConfig(clientConfig) + routingCache := rc.NewResourceCache[platformclientv2.Utilizationlabel]() + return &routingUtilizationLabelProxy{ + clientConfig: clientConfig, + routingApi: api, + getAllRoutingUtilizationLabelsAttr: getAllRoutingUtilizationLabelsFn, + createRoutingUtilizationLabelAttr: createRoutingUtilizationLabelFn, + getRoutingUtilizationLabelAttr: getRoutingUtilizationLabelFn, + getRoutingUtilizationLabelByNameAttr: getRoutingUtilizationLabelByNameFn, + updateRoutingUtilizationLabelAttr: updateRoutingUtilizationLabelFn, + deleteRoutingUtilizationLabelAttr: deleteRoutingUtilizationLabelFn, + routingCache: routingCache, + } +} + +func getRoutingUtilizationLabelProxy(clientConfig *platformclientv2.Configuration) *routingUtilizationLabelProxy { + if internalProxy == nil { + internalProxy = newRoutingUtilizationLabelProxy(clientConfig) + } + return internalProxy +} + +func (p *routingUtilizationLabelProxy) getAllRoutingUtilizationLabels(ctx context.Context, name string) (*[]platformclientv2.Utilizationlabel, *platformclientv2.APIResponse, error) { + return p.getAllRoutingUtilizationLabelsAttr(ctx, p, name) +} + +func (p *routingUtilizationLabelProxy) createRoutingUtilizationLabel(ctx context.Context, req *platformclientv2.Createutilizationlabelrequest) (*platformclientv2.Utilizationlabel, *platformclientv2.APIResponse, error) { + return p.createRoutingUtilizationLabelAttr(ctx, p, req) +} + +func (p *routingUtilizationLabelProxy) getRoutingUtilizationLabel(ctx context.Context, id string) (*platformclientv2.Utilizationlabel, *platformclientv2.APIResponse, error) { + return p.getRoutingUtilizationLabelAttr(ctx, p, id) +} + +func (p *routingUtilizationLabelProxy) getRoutingUtilizationLabelByName(ctx context.Context, name string) (*platformclientv2.Utilizationlabel, bool, *platformclientv2.APIResponse, error) { + return p.getRoutingUtilizationLabelByNameAttr(ctx, p, name) +} + +func (p *routingUtilizationLabelProxy) updateRoutingUtilizationLabel(ctx context.Context, id string, req *platformclientv2.Updateutilizationlabelrequest) (*platformclientv2.Utilizationlabel, *platformclientv2.APIResponse, error) { + return p.updateRoutingUtilizationLabelAttr(ctx, p, id, req) +} + +func (p *routingUtilizationLabelProxy) deleteRoutingUtilizationLabel(ctx context.Context, id string, forceDelete bool) (*platformclientv2.APIResponse, error) { + return p.deleteRoutingUtilizationLabelAttr(ctx, p, id, forceDelete) +} + +func getAllRoutingUtilizationLabelsFn(_ context.Context, p *routingUtilizationLabelProxy, name string) (*[]platformclientv2.Utilizationlabel, *platformclientv2.APIResponse, error) { + var allUtilizationLabels []platformclientv2.Utilizationlabel + const pageSize = 100 + + labels, resp, err := p.routingApi.GetRoutingUtilizationLabels(100, 1, "", name) + if err != nil { + return nil, resp, fmt.Errorf("failed to get routing utilization labels | error: %s", err) + } + + if labels.Entities == nil || len(*labels.Entities) == 0 { + return &allUtilizationLabels, resp, nil + } + allUtilizationLabels = append(allUtilizationLabels, *labels.Entities...) + + for pageNum := 2; pageNum <= *labels.PageCount; pageNum++ { + labels, resp, err := p.routingApi.GetRoutingUtilizationLabels(pageSize, pageNum, "", name) + if err != nil { + return nil, resp, fmt.Errorf("failed to get routing utilization labels | error: %s", err) + } + + if labels.Entities == nil || len(*labels.Entities) == 0 { + break + } + allUtilizationLabels = append(allUtilizationLabels, *labels.Entities...) + } + + for _, label := range allUtilizationLabels { + rc.SetCache(p.routingCache, *label.Id, label) + } + + return &allUtilizationLabels, resp, nil +} + +func createRoutingUtilizationLabelFn(_ context.Context, p *routingUtilizationLabelProxy, req *platformclientv2.Createutilizationlabelrequest) (*platformclientv2.Utilizationlabel, *platformclientv2.APIResponse, error) { + return p.routingApi.PostRoutingUtilizationLabels(*req) +} + +func getRoutingUtilizationLabelFn(_ context.Context, p *routingUtilizationLabelProxy, id string) (*platformclientv2.Utilizationlabel, *platformclientv2.APIResponse, error) { + if label := rc.GetCacheItem(p.routingCache, id); label != nil { + return label, nil, nil + } + return p.routingApi.GetRoutingUtilizationLabel(id) +} + +func getRoutingUtilizationLabelByNameFn(ctx context.Context, p *routingUtilizationLabelProxy, name string) (*platformclientv2.Utilizationlabel, bool, *platformclientv2.APIResponse, error) { + labels, resp, err := getAllRoutingUtilizationLabelsFn(ctx, p, name) + if err != nil { + return nil, false, resp, fmt.Errorf("error retrieving routing utilization label by name %s", err) + } + + if labels == nil || len(*labels) == 0{ + return nil, true, resp, fmt.Errorf("no routing utilization labels found with name %s", name) + } + + for _, label := range *labels { + if *label.Name == name { + log.Printf("Retrieved routing utilization label %s by name %s", *label.Id, name) + return &label, false, resp, nil + } + } + return nil, true, resp, fmt.Errorf("no routing utilization label found with name: %s", name) +} + +func updateRoutingUtilizationLabelFn(_ context.Context, p *routingUtilizationLabelProxy, id string, req *platformclientv2.Updateutilizationlabelrequest) (*platformclientv2.Utilizationlabel, *platformclientv2.APIResponse, error) { + return p.routingApi.PutRoutingUtilizationLabel(id, *req) +} + +func deleteRoutingUtilizationLabelFn(_ context.Context, p *routingUtilizationLabelProxy, id string, forceDelete bool) (*platformclientv2.APIResponse, error) { + return p.routingApi.DeleteRoutingUtilizationLabel(id, forceDelete) +} diff --git a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label.go b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label.go new file mode 100644 index 000000000..c4ca7d422 --- /dev/null +++ b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label.go @@ -0,0 +1,123 @@ +package routing_utilization_label + +import ( + "context" + "fmt" + "log" + "terraform-provider-genesyscloud/genesyscloud/provider" + "terraform-provider-genesyscloud/genesyscloud/util" + "terraform-provider-genesyscloud/genesyscloud/util/constants" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + + "terraform-provider-genesyscloud/genesyscloud/consistency_checker" + + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" +) + +func getAllRoutingUtilizationLabels(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { + resources := make(resourceExporter.ResourceIDMetaMap) + proxy := getRoutingUtilizationLabelProxy(clientConfig) + + labels, resp, getErr := proxy.getAllRoutingUtilizationLabels(ctx, "") + if getErr != nil { + return nil, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to get page of labels error: %s", getErr), resp) + } + + for _, label := range *labels { + resources[*label.Id] = &resourceExporter.ResourceMeta{Name: *label.Name} + } + return resources, nil +} + +func createRoutingUtilizationLabel(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + name := d.Get("name").(string) + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingUtilizationLabelProxy(sdkConfig) + + log.Printf("Creating label %s", name) + + label, resp, err := proxy.createRoutingUtilizationLabel(ctx, &platformclientv2.Createutilizationlabelrequest{ + Name: &name, + }) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to create label %s error: %s", name, err), resp) + } + + d.SetId(*label.Id) + + log.Printf("Created label %s %s", name, *label.Id) + return readRoutingUtilizationLabel(ctx, d, meta) +} + +func readRoutingUtilizationLabel(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingUtilizationLabelProxy(sdkConfig) + cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceRoutingUtilizationLabel(), constants.DefaultConsistencyChecks, resourceName) + + log.Printf("Reading label %s", d.Id()) + return util.WithRetriesForRead(ctx, d, func() *retry.RetryError { + label, resp, getErr := proxy.getRoutingUtilizationLabel(ctx, d.Id()) + + if getErr != nil { + if util.IsStatus404(resp) { + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read label %s | error: %s", d.Id(), getErr), resp)) + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read label %s | error: %s", d.Id(), getErr), resp)) + } + + _ = d.Set("name", *label.Name) + log.Printf("Read label %s %s", d.Id(), *label.Name) + return cc.CheckState(d) + }) +} + +func updateRoutingUtilizationLabel(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingUtilizationLabelProxy(sdkConfig) + + id := d.Id() + name := d.Get("name").(string) + + log.Printf("Updating label %s with name %s", id, name) + _, resp, err := proxy.updateRoutingUtilizationLabel(ctx, id, &platformclientv2.Updateutilizationlabelrequest{ + Name: &name, + }) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to update label %s error: %s", id, err), resp) + } + + log.Printf("Updated label %s", id) + return readRoutingUtilizationLabel(ctx, d, meta) +} + +func deleteRoutingUtilizationLabel(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + name := d.Get("name").(string) + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingUtilizationLabelProxy(sdkConfig) + + log.Printf("Deleting label %s %s", d.Id(), name) + resp, err := proxy.deleteRoutingUtilizationLabel(ctx, d.Id(), true) + + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to delete label %s error: %s", name, err), resp) + } + + return util.WithRetries(ctx, 30*time.Second, func() *retry.RetryError { + _, resp, err := proxy.getRoutingUtilizationLabel(ctx, d.Id()) + + if err != nil { + if util.IsStatus404(resp) { + log.Printf("Deleted Routing label %s", d.Id()) + return nil + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Error deleting Routing label %s: %s", d.Id(), err), resp)) + } + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Routing label %s still exists", d.Id()), resp)) + }) +} diff --git a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_schema.go b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_schema.go new file mode 100644 index 000000000..92761f50a --- /dev/null +++ b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_schema.go @@ -0,0 +1,61 @@ +package routing_utilization_label + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" +) + +const resourceName = "genesyscloud_routing_utilization_label" + +// SetRegistrar registers all the resources and exporters in the package +func SetRegistrar(regInstance registrar.Registrar) { + regInstance.RegisterResource(resourceName, ResourceRoutingUtilizationLabel()) + regInstance.RegisterDataSource(resourceName, DataSourceRoutingUtilizationLabel()) + regInstance.RegisterExporter(resourceName, RoutingUtilizationLabelExporter()) +} + +func ResourceRoutingUtilizationLabel() *schema.Resource { + return &schema.Resource{ + Description: "Genesys Cloud Routing Utilization Label. This resource is not yet widely available. Only use it if the feature is enabled.", + + CreateContext: provider.CreateWithPooledClient(createRoutingUtilizationLabel), + ReadContext: provider.ReadWithPooledClient(readRoutingUtilizationLabel), + UpdateContext: provider.UpdateWithPooledClient(updateRoutingUtilizationLabel), + DeleteContext: provider.DeleteWithPooledClient(deleteRoutingUtilizationLabel), + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + SchemaVersion: 1, + Schema: map[string]*schema.Schema{ + "name": { + Description: "Label name.", + Type: schema.TypeString, + Required: true, + }, + }, + } +} + +func DataSourceRoutingUtilizationLabel() *schema.Resource { + return &schema.Resource{ + Description: "Data source for Genesys Cloud Routing Utilization Labels. Select a label by name.", + ReadContext: provider.ReadWithPooledClient(dataSourceRoutingUtilizationLabelRead), + Schema: map[string]*schema.Schema{ + "name": { + Description: "Label name.", + Type: schema.TypeString, + ValidateFunc: validation.StringDoesNotContainAny("*"), + Required: true, + }, + }, + } +} + +func RoutingUtilizationLabelExporter() *resourceExporter.ResourceExporter { + return &resourceExporter.ResourceExporter{ + GetResourcesFunc: provider.GetAllWithPooledClient(getAllRoutingUtilizationLabels), + } +} diff --git a/genesyscloud/resource_genesyscloud_routing_utilization_label_test.go b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_test.go similarity index 69% rename from genesyscloud/resource_genesyscloud_routing_utilization_label_test.go rename to genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_test.go index f73fbfa58..793fb3f3f 100644 --- a/genesyscloud/resource_genesyscloud_routing_utilization_label_test.go +++ b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_test.go @@ -1,4 +1,4 @@ -package genesyscloud +package routing_utilization_label import ( "fmt" @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceRoutingUtilizationLabelBasic(t *testing.T) { @@ -22,7 +22,7 @@ func TestAccResourceRoutingUtilizationLabelBasic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) - if err := checkIfLabelsAreEnabled(); err != nil { + if err := CheckIfLabelsAreEnabled(); err != nil { t.Skipf("%v", err) // be sure to skip the test and not fail it } }, @@ -61,20 +61,6 @@ func TestAccResourceRoutingUtilizationLabelBasic(t *testing.T) { }) } -func GenerateRoutingUtilizationLabelResource(resourceID string, name string, dependsOnResource string) string { - dependsOn := "" - - if dependsOnResource != "" { - dependsOn = fmt.Sprintf("depends_on=[genesyscloud_routing_utilization_label.%s]", dependsOnResource) - } - - return fmt.Sprintf(`resource "genesyscloud_routing_utilization_label" "%s" { - name = "%s" - %s - } - `, resourceID, name, dependsOn) -} - func validateTestLabelDestroyed(state *terraform.State) error { routingApi := platformclientv2.NewRoutingApi() @@ -98,12 +84,3 @@ func validateTestLabelDestroyed(state *terraform.State) error { return fmt.Errorf("No label resource found") } - -func checkIfLabelsAreEnabled() error { // remove once the feature is globally enabled - api := platformclientv2.NewRoutingApiWithConfig(sdkConfig) // the variable sdkConfig exists at a package level in ./genesyscloud and is already authorized - _, resp, _ := api.GetRoutingUtilizationLabels(100, 1, "", "") - if resp.StatusCode == 501 { - return fmt.Errorf("feature is not yet implemented in this org.") - } - return nil -} diff --git a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_utils.go b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_utils.go new file mode 100644 index 000000000..22322c59d --- /dev/null +++ b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_utils.go @@ -0,0 +1,54 @@ +package routing_utilization_label + +import ( + "fmt" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "strings" + "terraform-provider-genesyscloud/genesyscloud/provider" +) + +func GenerateRoutingUtilizationLabelResource(resourceID string, name string, dependsOnResource string) string { + dependsOn := "" + + if dependsOnResource != "" { + dependsOn = fmt.Sprintf("depends_on=[genesyscloud_routing_utilization_label.%s]", dependsOnResource) + } + + return fmt.Sprintf(`resource "genesyscloud_routing_utilization_label" "%s" { + name = "%s" + %s + } + `, resourceID, name, dependsOn) +} + +func CheckIfLabelsAreEnabled() error { // remove once the feature is globally enabled + sdkConfig, err := provider.AuthorizeSdk() + if err != nil { + return err + } + + api := platformclientv2.NewRoutingApiWithConfig(sdkConfig) + _, resp, _ := api.GetRoutingUtilizationLabels(100, 1, "", "") + if resp.StatusCode == 501 { + return fmt.Errorf("feature is not yet implemented in this org.") + } + return nil +} + +func GenerateLabelUtilization( + labelResource string, + maxCapacity string, + interruptingLabelResourceNames ...string) string { + + interruptingLabelResources := make([]string, 0) + for _, resourceName := range interruptingLabelResourceNames { + interruptingLabelResources = append(interruptingLabelResources, "genesyscloud_routing_utilization_label."+resourceName+".id") + } + + return fmt.Sprintf(`label_utilizations { + label_id = genesyscloud_routing_utilization_label.%s.id + maximum_capacity = %s + interrupting_label_ids = [%s] + } + `, labelResource, maxCapacity, strings.Join(interruptingLabelResources, ",")) +} diff --git a/genesyscloud/scripts/genesyscloud_scripts_proxy.go b/genesyscloud/scripts/genesyscloud_scripts_proxy.go index f69d0ea13..7f5a53860 100644 --- a/genesyscloud/scripts/genesyscloud_scripts_proxy.go +++ b/genesyscloud/scripts/genesyscloud_scripts_proxy.go @@ -14,7 +14,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/files" "time" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/scripts/resource_genesyscloud_script.go b/genesyscloud/scripts/resource_genesyscloud_script.go index e2f63d14a..53df15885 100644 --- a/genesyscloud/scripts/resource_genesyscloud_script.go +++ b/genesyscloud/scripts/resource_genesyscloud_script.go @@ -12,7 +12,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/genesyscloud/scripts/resource_genesyscloud_script_test.go b/genesyscloud/scripts/resource_genesyscloud_script_test.go index 1c7d9d7cf..23d3a7471 100644 --- a/genesyscloud/scripts/resource_genesyscloud_script_test.go +++ b/genesyscloud/scripts/resource_genesyscloud_script_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/scripts/resource_scripts_schema.go b/genesyscloud/scripts/resource_scripts_schema.go index 459850ed1..d3381654e 100644 --- a/genesyscloud/scripts/resource_scripts_schema.go +++ b/genesyscloud/scripts/resource_scripts_schema.go @@ -5,7 +5,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" ) /* @@ -59,7 +59,7 @@ func ResourceScript() *schema.Resource { Description: "Path to the script file to upload.", Type: schema.TypeString, Required: true, - ValidateFunc: gcloud.ValidatePath, + ValidateFunc: validators.ValidatePath, }, "file_content_hash": { Description: "Hash value of the script file content. Used to detect changes.", diff --git a/genesyscloud/station/genesyscloud_station_init_test.go b/genesyscloud/station/genesyscloud_station_init_test.go index 3db79e890..9641ffcb3 100644 --- a/genesyscloud/station/genesyscloud_station_init_test.go +++ b/genesyscloud/station/genesyscloud_station_init_test.go @@ -6,7 +6,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" "testing" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" gcloud "terraform-provider-genesyscloud/genesyscloud" edgePhone "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_phone" diff --git a/genesyscloud/station/genesyscloud_station_proxy.go b/genesyscloud/station/genesyscloud_station_proxy.go index 7c53e5b68..7486790e1 100644 --- a/genesyscloud/station/genesyscloud_station_proxy.go +++ b/genesyscloud/station/genesyscloud_station_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // internalProxy holds a proxy instance that can be used throughout the package diff --git a/genesyscloud/task_management_workbin/genesyscloud_task_management_workbin_proxy.go b/genesyscloud/task_management_workbin/genesyscloud_task_management_workbin_proxy.go index 29ec9c976..acbe12980 100644 --- a/genesyscloud/task_management_workbin/genesyscloud_task_management_workbin_proxy.go +++ b/genesyscloud/task_management_workbin/genesyscloud_task_management_workbin_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin.go b/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin.go index fe2f8a596..5b4c8a5f5 100644 --- a/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin.go +++ b/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin_test.go b/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin_test.go index 42c8ab351..b468918ea 100644 --- a/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin_test.go +++ b/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin_test.go @@ -12,7 +12,7 @@ import ( gcloud "terraform-provider-genesyscloud/genesyscloud" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workitem/genesyscloud_task_management_workitem_proxy.go b/genesyscloud/task_management_workitem/genesyscloud_task_management_workitem_proxy.go index fa433e4bf..82aa8f0c4 100644 --- a/genesyscloud/task_management_workitem/genesyscloud_task_management_workitem_proxy.go +++ b/genesyscloud/task_management_workitem/genesyscloud_task_management_workitem_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem.go b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem.go index bbff9db3f..9f5494392 100644 --- a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem.go +++ b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_schema.go b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_schema.go index d639b207f..6e1c27978 100644 --- a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_schema.go +++ b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_schema.go @@ -7,7 +7,7 @@ import ( resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" "terraform-provider-genesyscloud/genesyscloud/util" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" ) /* @@ -91,14 +91,14 @@ func ResourceTaskManagementWorkitem() *schema.Resource { Optional: true, Computed: true, Type: schema.TypeString, - ValidateDiagFunc: gcloud.ValidateLocalDateTimes, + ValidateDiagFunc: validators.ValidateLocalDateTimes, }, `date_expires`: { Description: `The expiry date of the Workitem. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z`, Optional: true, Computed: true, Type: schema.TypeString, - ValidateDiagFunc: gcloud.ValidateLocalDateTimes, + ValidateDiagFunc: validators.ValidateLocalDateTimes, }, `duration_seconds`: { Description: `The estimated duration in seconds to complete the workitem.`, diff --git a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_test.go b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_test.go index 5b74074ae..c9d31132c 100644 --- a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_test.go +++ b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_test.go @@ -23,7 +23,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_unit_test.go b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_unit_test.go index 15c62f936..591301bbb 100644 --- a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_unit_test.go +++ b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_unit_test.go @@ -16,7 +16,7 @@ import ( lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_utils.go b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_utils.go index 9c60e471d..6d3ab7ebf 100644 --- a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_utils.go +++ b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_utils.go @@ -9,7 +9,7 @@ import ( lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workitem_schema/genesyscloud_task_management_workitem_schema_proxy.go b/genesyscloud/task_management_workitem_schema/genesyscloud_task_management_workitem_schema_proxy.go index 429ce6e42..a93f33c34 100644 --- a/genesyscloud/task_management_workitem_schema/genesyscloud_task_management_workitem_schema_proxy.go +++ b/genesyscloud/task_management_workitem_schema/genesyscloud_task_management_workitem_schema_proxy.go @@ -8,7 +8,7 @@ import ( "log" "net/http" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema.go b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema.go index 15fe49c6c..f96eba1df 100644 --- a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema.go +++ b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_test.go b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_test.go index ae8816ddc..f043ef040 100644 --- a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_test.go +++ b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_test.go @@ -15,7 +15,7 @@ import ( lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_unit_test.go b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_unit_test.go index e61aaa110..d9914e3b1 100644 --- a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_unit_test.go +++ b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_unit_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/stretchr/testify/assert" ) diff --git a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_utils.go b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_utils.go index 8ff481cfe..7594a8ccf 100644 --- a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_utils.go +++ b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_utils.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) const ( diff --git a/genesyscloud/task_management_worktype/data_source_genesyscloud_task_management_unit_test.go b/genesyscloud/task_management_worktype/data_source_genesyscloud_task_management_unit_test.go index 40114afbc..6cfd137aa 100644 --- a/genesyscloud/task_management_worktype/data_source_genesyscloud_task_management_unit_test.go +++ b/genesyscloud/task_management_worktype/data_source_genesyscloud_task_management_unit_test.go @@ -4,7 +4,7 @@ import ( "context" "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/stretchr/testify/assert" "terraform-provider-genesyscloud/genesyscloud/provider" "testing" diff --git a/genesyscloud/task_management_worktype/genesyscloud_task_management_worktype_proxy.go b/genesyscloud/task_management_worktype/genesyscloud_task_management_worktype_proxy.go index 94775d19a..5f5417369 100644 --- a/genesyscloud/task_management_worktype/genesyscloud_task_management_worktype_proxy.go +++ b/genesyscloud/task_management_worktype/genesyscloud_task_management_worktype_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype.go b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype.go index 4797b1148..df9a05aa0 100644 --- a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype.go +++ b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_schema.go b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_schema.go index c1b190920..35ea54fce 100644 --- a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_schema.go +++ b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_schema.go @@ -5,7 +5,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) @@ -77,7 +77,7 @@ func ResourceTaskManagementWorktype() *schema.Resource { Optional: true, Computed: true, Type: schema.TypeString, - ValidateDiagFunc: gcloud.ValidateTime, + ValidateDiagFunc: validators.ValidateTime, }, }, } diff --git a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_test.go b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_test.go index 6354c352b..f796b484d 100644 --- a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_test.go +++ b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_test.go @@ -18,7 +18,7 @@ import ( workitemSchema "terraform-provider-genesyscloud/genesyscloud/task_management_workitem_schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_unit_test.go b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_unit_test.go index fd10b5a50..aefbe1a22 100644 --- a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_unit_test.go +++ b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_unit_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/stretchr/testify/assert" ) diff --git a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go index 3dff7cf51..79284a9b9 100644 --- a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go +++ b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go @@ -7,7 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* @@ -82,7 +82,7 @@ func getWorktypeupdateFromResourceData(d *schema.ResourceData, statuses *[]platf worktype := platformclientv2.Worktypeupdate{} worktype.SetField("Name", platformclientv2.String(d.Get("name").(string))) - if d.HasChange("Description") { + if d.HasChange("description") { worktype.SetField("Description", platformclientv2.String(d.Get("description").(string))) } if d.HasChange("default_workbin_id") { diff --git a/genesyscloud/team/genesyscloud_team_proxy.go b/genesyscloud/team/genesyscloud_team_proxy.go index b22b302eb..2880ca8c0 100644 --- a/genesyscloud/team/genesyscloud_team_proxy.go +++ b/genesyscloud/team/genesyscloud_team_proxy.go @@ -6,7 +6,7 @@ import ( "log" "terraform-provider-genesyscloud/genesyscloud/util" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/team/resource_genesyscloud_team.go b/genesyscloud/team/resource_genesyscloud_team.go index f6c10156b..2c6d8414e 100644 --- a/genesyscloud/team/resource_genesyscloud_team.go +++ b/genesyscloud/team/resource_genesyscloud_team.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" diff --git a/genesyscloud/team/resource_genesyscloud_team_test.go b/genesyscloud/team/resource_genesyscloud_team_test.go index 978b50b0f..03bede55f 100644 --- a/genesyscloud/team/resource_genesyscloud_team_test.go +++ b/genesyscloud/team/resource_genesyscloud_team_test.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "math/rand" "strings" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/team/resource_genesyscloud_team_unit_test.go b/genesyscloud/team/resource_genesyscloud_team_unit_test.go index 85b77b13d..3b3e670cb 100644 --- a/genesyscloud/team/resource_genesyscloud_team_unit_test.go +++ b/genesyscloud/team/resource_genesyscloud_team_unit_test.go @@ -11,7 +11,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/stretchr/testify/assert" ) diff --git a/genesyscloud/team/resource_genesyscloud_team_utils.go b/genesyscloud/team/resource_genesyscloud_team_utils.go index 8feb15f32..8c926b239 100644 --- a/genesyscloud/team/resource_genesyscloud_team_utils.go +++ b/genesyscloud/team/resource_genesyscloud_team_utils.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "strings" "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/chunks" diff --git a/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings.go b/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings.go index 8e7d312bd..e81844e03 100644 --- a/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings.go +++ b/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings.go @@ -22,7 +22,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) const ( @@ -402,8 +402,10 @@ func ValidateInboundSiteSettings(inboundSiteString string, trunkBaseMetaId strin func TrunkBaseSettingsExporter() *resourceExporter.ResourceExporter { return &resourceExporter.ResourceExporter{ - GetResourcesFunc: provider.GetAllWithPooledClient(getAllTrunkBaseSettings), - RefAttrs: map[string]*resourceExporter.RefAttrSettings{}, + GetResourcesFunc: provider.GetAllWithPooledClient(getAllTrunkBaseSettings), + RefAttrs: map[string]*resourceExporter.RefAttrSettings{ + //"inbound_site_id": {RefType: "genesyscloud_telephony_providers_edges_site"}, TODO: decide how/if this will be included after DEVTOOLING-676 is resolved + }, JsonEncodeAttributes: []string{"properties"}, } } diff --git a/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings_test.go b/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings_test.go index 200b798c3..d0a1ecab1 100644 --- a/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings_test.go +++ b/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceTrunkBaseSettings(t *testing.T) { diff --git a/genesyscloud/telephony_providers_edges_did/genesyscloud_telephony_providers_edges_did_proxy.go b/genesyscloud/telephony_providers_edges_did/genesyscloud_telephony_providers_edges_did_proxy.go index 9e43bbe64..553f33454 100644 --- a/genesyscloud/telephony_providers_edges_did/genesyscloud_telephony_providers_edges_did_proxy.go +++ b/genesyscloud/telephony_providers_edges_did/genesyscloud_telephony_providers_edges_did_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/telephony_providers_edges_did/genesyscloud_telephony_providers_edges_did_schema.go b/genesyscloud/telephony_providers_edges_did/genesyscloud_telephony_providers_edges_did_schema.go index 7646d8028..10ff98a5e 100644 --- a/genesyscloud/telephony_providers_edges_did/genesyscloud_telephony_providers_edges_did_schema.go +++ b/genesyscloud/telephony_providers_edges_did/genesyscloud_telephony_providers_edges_did_schema.go @@ -4,7 +4,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "terraform-provider-genesyscloud/genesyscloud/provider" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" ) const resourceName = "genesyscloud_telephony_providers_edges_did" @@ -24,7 +24,7 @@ func DataSourceDid() *schema.Resource { Description: "Phone number for the DID.", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidatePhoneNumber, + ValidateDiagFunc: validators.ValidatePhoneNumber, }, }, } diff --git a/genesyscloud/telephony_providers_edges_did_pool/genesyscloud_telephony_providers_edges_did_pool_proxy.go b/genesyscloud/telephony_providers_edges_did_pool/genesyscloud_telephony_providers_edges_did_pool_proxy.go index e34798b05..65d2cdb54 100644 --- a/genesyscloud/telephony_providers_edges_did_pool/genesyscloud_telephony_providers_edges_did_pool_proxy.go +++ b/genesyscloud/telephony_providers_edges_did_pool/genesyscloud_telephony_providers_edges_did_pool_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool.go b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool.go index 5e97624a4..a0a870405 100644 --- a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool.go +++ b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) // getAllDidPools retrieves all DID pools and is used for the exporter diff --git a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_schema.go b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_schema.go index 097a32310..1f88fdc4b 100644 --- a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_schema.go +++ b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_schema.go @@ -6,7 +6,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" ) const resourceName = "genesyscloud_telephony_providers_edges_did_pool" @@ -44,13 +44,13 @@ func ResourceTelephonyDidPool() *schema.Resource { Description: "Starting phone number of the DID Pool range. Phone number must be in a E.164 number format. Changing the start_phone_number attribute will cause the did_pool object to be dropped and recreated with a new ID.", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidatePhoneNumber, + ValidateDiagFunc: validators.ValidatePhoneNumber, }, "end_phone_number": { Description: "Ending phone number of the DID Pool range. Phone number must be in an E.164 number format. Changing the end_phone_number attribute will cause the did_pool object to be dropped and recreated with a new ID.", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidatePhoneNumber, + ValidateDiagFunc: validators.ValidatePhoneNumber, }, "description": { Description: "DID Pool description.", @@ -83,13 +83,13 @@ func DataSourceDidPool() *schema.Resource { Description: "Starting phone number of the DID Pool range. Must be in an E.164 number format.", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidatePhoneNumber, + ValidateDiagFunc: validators.ValidatePhoneNumber, }, "end_phone_number": { Description: "Ending phone number of the DID Pool range.", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidatePhoneNumber, + ValidateDiagFunc: validators.ValidatePhoneNumber, }, }, } diff --git a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_test.go b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_test.go index 25e5b05c6..184070128 100644 --- a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_test.go +++ b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceDidPoolBasic(t *testing.T) { diff --git a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_utils.go b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_utils.go index ecc8d1f93..2f7ffa5c9 100644 --- a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_utils.go +++ b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_utils.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type DidPoolStruct struct { diff --git a/genesyscloud/telephony_providers_edges_edge_group/genesyscloud_telephony_providers_edges_edge_group_proxy.go b/genesyscloud/telephony_providers_edges_edge_group/genesyscloud_telephony_providers_edges_edge_group_proxy.go index 9da50ec91..6db0ceb02 100644 --- a/genesyscloud/telephony_providers_edges_edge_group/genesyscloud_telephony_providers_edges_edge_group_proxy.go +++ b/genesyscloud/telephony_providers_edges_edge_group/genesyscloud_telephony_providers_edges_edge_group_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var internalProxy *edgeGroupProxy diff --git a/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group.go b/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group.go index fd3498481..45882bed4 100644 --- a/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group.go +++ b/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func createEdgeGroup(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { diff --git a/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_test.go b/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_test.go index 02733951a..6c0968e95 100644 --- a/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_test.go +++ b/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceEdgeGroup(t *testing.T) { diff --git a/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_utils.go b/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_utils.go index e6f109eeb..6089618c0 100644 --- a/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_utils.go +++ b/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_utils.go @@ -6,7 +6,7 @@ import ( lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func buildSdkTrunkBases(d *schema.ResourceData) *[]platformclientv2.Trunkbase { diff --git a/genesyscloud/telephony_providers_edges_extension_pool/genesyscloud_telephony_providers_edges_extension_pool_proxy.go b/genesyscloud/telephony_providers_edges_extension_pool/genesyscloud_telephony_providers_edges_extension_pool_proxy.go index ebbe202d2..21de47b35 100644 --- a/genesyscloud/telephony_providers_edges_extension_pool/genesyscloud_telephony_providers_edges_extension_pool_proxy.go +++ b/genesyscloud/telephony_providers_edges_extension_pool/genesyscloud_telephony_providers_edges_extension_pool_proxy.go @@ -3,7 +3,7 @@ package telephony_providers_edges_extension_pool import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var internalProxy *extensionPoolProxy diff --git a/genesyscloud/telephony_providers_edges_extension_pool/genesyscloud_telephony_providers_edges_extension_pool_schema.go b/genesyscloud/telephony_providers_edges_extension_pool/genesyscloud_telephony_providers_edges_extension_pool_schema.go index 0b8eb37df..929e78bed 100644 --- a/genesyscloud/telephony_providers_edges_extension_pool/genesyscloud_telephony_providers_edges_extension_pool_schema.go +++ b/genesyscloud/telephony_providers_edges_extension_pool/genesyscloud_telephony_providers_edges_extension_pool_schema.go @@ -5,7 +5,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" ) const ( @@ -29,14 +29,14 @@ func ResourceTelephonyExtensionPool() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateDiagFunc: gcloud.ValidateExtensionPool, + ValidateDiagFunc: validators.ValidateExtensionPool, }, "end_number": { Description: "Ending phone number of the Extension Pool range. Changing the end_number attribute will cause the extension object to be dropped and recreated with a new ID.", Type: schema.TypeString, Required: true, ForceNew: true, - ValidateDiagFunc: gcloud.ValidateExtensionPool, + ValidateDiagFunc: validators.ValidateExtensionPool, }, "description": { Description: "Extension Pool description.", @@ -56,13 +56,13 @@ func DataSourceExtensionPool() *schema.Resource { Description: "Starting number of the Extension Pool range.", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidateExtensionPool, + ValidateDiagFunc: validators.ValidateExtensionPool, }, "end_number": { Description: "Ending number of the Extension Pool range.", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidateExtensionPool, + ValidateDiagFunc: validators.ValidateExtensionPool, }, }, } @@ -76,7 +76,7 @@ func TelephonyExtensionPoolExporter() *resourceExporter.ResourceExporter { } func SetRegistrar(l registrar.Registrar) { - l.RegisterDataSource("genesyscloud_telephony_providers_edges_extension_pool", DataSourceExtensionPool()) - l.RegisterResource("genesyscloud_telephony_providers_edges_extension_pool", ResourceTelephonyExtensionPool()) - l.RegisterExporter("genesyscloud_telephony_providers_edges_extension_pool", TelephonyExtensionPoolExporter()) + l.RegisterDataSource(resourceName, DataSourceExtensionPool()) + l.RegisterResource(resourceName, ResourceTelephonyExtensionPool()) + l.RegisterExporter(resourceName, TelephonyExtensionPoolExporter()) } diff --git a/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool.go b/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool.go index b87e18f1a..4cbe729b1 100644 --- a/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool.go +++ b/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllExtensionPools(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool_test.go b/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool_test.go index 0d1d75364..84a0d93a0 100644 --- a/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool_test.go +++ b/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type extensionPoolStruct struct { diff --git a/genesyscloud/telephony_providers_edges_linebasesettings/data_source_genesyscloud_telephony_providers_edges_linebasesettings.go b/genesyscloud/telephony_providers_edges_linebasesettings/data_source_genesyscloud_telephony_providers_edges_linebasesettings.go index f4926b3e0..912f7a8b7 100644 --- a/genesyscloud/telephony_providers_edges_linebasesettings/data_source_genesyscloud_telephony_providers_edges_linebasesettings.go +++ b/genesyscloud/telephony_providers_edges_linebasesettings/data_source_genesyscloud_telephony_providers_edges_linebasesettings.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceLineBaseSettingsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { diff --git a/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_init_test.go b/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_init_test.go index 3f58aa899..ddfe3a1b9 100644 --- a/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_init_test.go +++ b/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_init_test.go @@ -10,7 +10,7 @@ import ( edgeSite "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site" "testing" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_proxy.go b/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_proxy.go index 5fa8a8271..648447fb6 100644 --- a/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_proxy.go +++ b/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_proxy.go @@ -6,7 +6,9 @@ import ( "log" "net/http" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" + + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* @@ -53,6 +55,7 @@ type phoneProxy struct { edgesApi *platformclientv2.TelephonyProvidersEdgeApi stationsApi *platformclientv2.StationsApi usersApi *platformclientv2.UsersApi + phoneCache rc.CacheInterface[platformclientv2.Phone] getAllPhonesAttr getAllPhonesFunc createPhoneAttr createPhoneFunc @@ -73,12 +76,14 @@ func newPhoneProxy(clientConfig *platformclientv2.Configuration) *phoneProxy { edgesApi := platformclientv2.NewTelephonyProvidersEdgeApiWithConfig(clientConfig) stationsApi := platformclientv2.NewStationsApiWithConfig(clientConfig) usersApi := platformclientv2.NewUsersApiWithConfig(clientConfig) + phoneCache := rc.NewResourceCache[platformclientv2.Phone]() return &phoneProxy{ clientConfig: clientConfig, edgesApi: edgesApi, stationsApi: stationsApi, usersApi: usersApi, + phoneCache: phoneCache, getAllPhonesAttr: getAllPhonesFn, createPhoneAttr: createPhoneFn, @@ -116,6 +121,9 @@ func (p *phoneProxy) createPhone(ctx context.Context, phoneConfig *platformclien // getPhoneById retrieves a Genesys Cloud Phone by id func (p *phoneProxy) getPhoneById(ctx context.Context, phoneId string) (*platformclientv2.Phone, *platformclientv2.APIResponse, error) { + if phone := rc.GetCacheItem(p.phoneCache, phoneId); phone != nil { + return phone, nil, nil + } return p.getPhoneByIdAttr(ctx, p, phoneId) } @@ -205,6 +213,9 @@ func getAllPhonesFn(ctx context.Context, p *phoneProxy) (*[]platformclientv2.Pho log.Printf("getAllPhonesFn:: Listing all of the non-deleted phone ids and names that we actually retrieved") for _, phone := range allPhones { log.Printf("getAllPhonesFn:: Retrieved phone id %s with phone name: %s\n", *phone.Id, *phone.Name) + + // Cache the phone resource into the p.phoneCache for later use + rc.SetCache(p.phoneCache, *phone.Id, phone) } return &allPhones, response, nil diff --git a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go index f35777cd5..64cee7cfa 100644 --- a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go +++ b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllPhones(ctx context.Context, sdkConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { @@ -90,10 +90,16 @@ func readPhone(ctx context.Context, d *schema.ResourceData, meta interface{}) di } _ = d.Set("name", *currentPhone.Name) - _ = d.Set("state", *currentPhone.State) _ = d.Set("site_id", *currentPhone.Site.Id) _ = d.Set("phone_base_settings_id", *currentPhone.PhoneBaseSettings.Id) - _ = d.Set("line_base_settings_id", *currentPhone.LineBaseSettings.Id) + + if currentPhone.State != nil { + _ = d.Set("state", *currentPhone.State) + } + + if currentPhone.LineBaseSettings != nil { + _ = d.Set("line_base_settings_id", *currentPhone.LineBaseSettings.Id) + } if currentPhone.PhoneMetaBase != nil { _ = d.Set("phone_meta_base_id", *currentPhone.PhoneMetaBase.Id) diff --git a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_schema.go b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_schema.go index 2e1315b58..489a269b7 100644 --- a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_schema.go +++ b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_schema.go @@ -5,7 +5,7 @@ import ( resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" "terraform-provider-genesyscloud/genesyscloud/util" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" @@ -140,7 +140,7 @@ func ResourcePhone() *schema.Resource { Type: schema.TypeList, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateDiagFunc: gcloud.ValidatePhoneNumber}, + Elem: &schema.Schema{Type: schema.TypeString, ValidateDiagFunc: validators.ValidatePhoneNumber}, }, "properties": { Description: "phone properties", diff --git a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go index eca79cff8..c01d7e3ed 100644 --- a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go +++ b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go @@ -17,7 +17,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourcePhoneBasic(t *testing.T) { @@ -188,6 +188,7 @@ func TestAccResourcePhoneBasic(t *testing.T) { func TestAccResourcePhoneStandalone(t *testing.T) { number := "+12005538112" + deleteDidPoolWithNumber(number) didPoolResource1 := "test-didpool1" lineAddresses := []string{number} phoneRes := "phone_standalone1234" @@ -245,29 +246,6 @@ func TestAccResourcePhoneStandalone(t *testing.T) { "mac", []string{}, ) - config := didPool.GenerateDidPoolResource(&didPool.DidPoolStruct{ - ResourceID: didPoolResource1, - StartPhoneNumber: lineAddresses[0], - EndPhoneNumber: lineAddresses[0], - Description: util.NullValue, // No description - Comments: util.NullValue, // No comments - PoolProvider: util.NullValue, // No provider - }) - config += phoneBaseSettings.GeneratePhoneBaseSettingsResourceWithCustomAttrs( - phoneBaseSettingsRes, - phoneBaseSettingsName, - "phoneBaseSettings description", - "generic_sip.json", - ) + GeneratePhoneResourceWithCustomAttrs(&PhoneConfig{ - phoneRes, - name1, - stateActive, - "genesyscloud_telephony_providers_edges_site." + siteRes + ".id", - "genesyscloud_telephony_providers_edges_phonebasesettings." + phoneBaseSettingsRes + ".id", - lineAddresses, - "", // no web rtc user - "genesyscloud_telephony_providers_edges_did_pool." + didPoolResource1, - }, capabilities, generatePhoneProperties(uuid.NewString())) resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) }, @@ -277,7 +255,28 @@ func TestAccResourcePhoneStandalone(t *testing.T) { PreConfig: func() { time.Sleep(30 * time.Second) }, - Config: locationConfig + siteConfig + config, + Config: didPool.GenerateDidPoolResource(&didPool.DidPoolStruct{ + ResourceID: didPoolResource1, + StartPhoneNumber: lineAddresses[0], + EndPhoneNumber: lineAddresses[0], + Description: util.NullValue, // No description + Comments: util.NullValue, // No comments + PoolProvider: util.NullValue, // No provider + }) + locationConfig + siteConfig + phoneBaseSettings.GeneratePhoneBaseSettingsResourceWithCustomAttrs( + phoneBaseSettingsRes, + phoneBaseSettingsName, + "phoneBaseSettings description", + "generic_sip.json", + ) + GeneratePhoneResourceWithCustomAttrs(&PhoneConfig{ + phoneRes, + name1, + stateActive, + "genesyscloud_telephony_providers_edges_site." + siteRes + ".id", + "genesyscloud_telephony_providers_edges_phonebasesettings." + phoneBaseSettingsRes + ".id", + lineAddresses, + "", // no web rtc user + "genesyscloud_telephony_providers_edges_did_pool." + didPoolResource1, + }, capabilities, generatePhoneProperties(uuid.NewString())), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "name", name1), resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "state", stateActive), @@ -445,7 +444,6 @@ func TestAccResourceHardPhoneStandalone(t *testing.T) { CheckDestroy: TestVerifyWebRtcPhoneDestroyed, }) } - func generatePhoneCapabilities( provisions, registers, @@ -532,3 +530,32 @@ func deleteDidPool(config *platformclientv2.Configuration, id string) error { } return nil } + +func deleteDidPoolWithNumber(number string) { + edgesAPI := platformclientv2.NewTelephonyProvidersEdgeApiWithConfig(sdkConfig) + var didPoolsToDelete []string + + for pageNum := 1; ; pageNum++ { + const pageSize = 100 + didPools, _, getErr := edgesAPI.GetTelephonyProvidersEdgesDidpools(pageSize, pageNum, "", nil) + if getErr != nil { + return + } + + if didPools.Entities == nil || len(*didPools.Entities) == 0 { + break + } + + for _, didPool := range *didPools.Entities { + if (didPool.StartPhoneNumber != nil && *didPool.StartPhoneNumber == number) || + (didPool.EndPhoneNumber != nil && *didPool.EndPhoneNumber == number) { + didPoolsToDelete = append(didPoolsToDelete, *didPool.Id) + } + } + } + + for _, didPoolId := range didPoolsToDelete { + edgesAPI.DeleteTelephonyProvidersEdgesDidpool(didPoolId) + time.Sleep(5 * time.Second) + } +} diff --git a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go index 791aed325..7545851fe 100644 --- a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go +++ b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type PhoneConfig struct { @@ -174,6 +174,9 @@ func flattenPhoneLines(lines *[]platformclientv2.Line) []string { for i := 0; i < len(*lines); i++ { line := (*lines)[i] did := "" + if line.Properties == nil { + continue + } if k := (*line.Properties)["station_identity_address"]; k != nil { didI := k.(map[string]interface{})["value"].(map[string]interface{})["instance"] if didI != nil { diff --git a/genesyscloud/telephony_providers_edges_phonebasesettings/data_source_genesyscloud_telephony_providers_edges_phonebasesettings.go b/genesyscloud/telephony_providers_edges_phonebasesettings/data_source_genesyscloud_telephony_providers_edges_phonebasesettings.go index e0f6d3235..ddbafa09b 100644 --- a/genesyscloud/telephony_providers_edges_phonebasesettings/data_source_genesyscloud_telephony_providers_edges_phonebasesettings.go +++ b/genesyscloud/telephony_providers_edges_phonebasesettings/data_source_genesyscloud_telephony_providers_edges_phonebasesettings.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourcePhoneBaseSettingsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { diff --git a/genesyscloud/telephony_providers_edges_phonebasesettings/genesyscloud_telephony_providers_edges_phonebasesettings_proxy.go b/genesyscloud/telephony_providers_edges_phonebasesettings/genesyscloud_telephony_providers_edges_phonebasesettings_proxy.go index 047852220..47093078c 100644 --- a/genesyscloud/telephony_providers_edges_phonebasesettings/genesyscloud_telephony_providers_edges_phonebasesettings_proxy.go +++ b/genesyscloud/telephony_providers_edges_phonebasesettings/genesyscloud_telephony_providers_edges_phonebasesettings_proxy.go @@ -3,7 +3,7 @@ package telephony_providers_edges_phonebasesettings import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var internalProxy *phoneBaseProxy diff --git a/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings.go b/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings.go index 99fb59df0..3ac3ed4dd 100644 --- a/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings.go +++ b/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func createPhoneBaseSettings(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { diff --git a/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_test.go b/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_test.go index 1fc69d1ac..864dc06f4 100644 --- a/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_test.go +++ b/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_test.go @@ -11,7 +11,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourcePhoneBaseSettings(t *testing.T) { diff --git a/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_utils.go b/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_utils.go index c2ad0afb9..9cd0bc6be 100644 --- a/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_utils.go +++ b/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_utils.go @@ -7,7 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func generatePhoneBaseSettingsDataSource( diff --git a/genesyscloud/telephony_providers_edges_site/data_source_genesyscloud_telephony_providers_edges_site_test.go b/genesyscloud/telephony_providers_edges_site/data_source_genesyscloud_telephony_providers_edges_site_test.go index fd5744d2d..1ca6a3319 100644 --- a/genesyscloud/telephony_providers_edges_site/data_source_genesyscloud_telephony_providers_edges_site_test.go +++ b/genesyscloud/telephony_providers_edges_site/data_source_genesyscloud_telephony_providers_edges_site_test.go @@ -7,7 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "testing" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" gcloud "terraform-provider-genesyscloud/genesyscloud" diff --git a/genesyscloud/telephony_providers_edges_site/genesyscloud_telephony_providers_edges_site_proxy.go b/genesyscloud/telephony_providers_edges_site/genesyscloud_telephony_providers_edges_site_proxy.go index a6f87a171..bd7b487ee 100644 --- a/genesyscloud/telephony_providers_edges_site/genesyscloud_telephony_providers_edges_site_proxy.go +++ b/genesyscloud/telephony_providers_edges_site/genesyscloud_telephony_providers_edges_site_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* diff --git a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site.go b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site.go index dffc909f0..5297248fe 100644 --- a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site.go +++ b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllSites(ctx context.Context, sdkConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { @@ -306,14 +306,23 @@ func deleteSite(ctx context.Context, d *schema.ResourceData, meta interface{}) d sdkConfig := meta.(*provider.ProviderMeta).ClientConfig sp := GetSiteProxy(sdkConfig) - log.Printf("Deleting site") - resp, err := sp.deleteSite(ctx, d.Id()) - if err != nil { - if util.IsStatus404(resp) { - log.Printf("Site already deleted %s", d.Id()) - return nil + // A site linked to a trunk will not be able to be deleted until that trunk is deleted. Retrying here to make sure it is cleared properly. + log.Printf("Deleting site %s", d.Id()) + diagErr := util.RetryWhen(util.IsStatus409, func() (*platformclientv2.APIResponse, diag.Diagnostics) { + log.Printf("Deleting site %s", d.Id()) + resp, err := sp.deleteSite(ctx, d.Id()) + if err != nil { + if util.IsStatus404(resp) { + log.Printf("Site already deleted %s", d.Id()) + return resp, nil + } + return resp, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to delete site %s error: %s", d.Id(), err), resp) } - return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to delete site %s error: %s", d.Id(), err), resp) + return resp, nil + }) + + if diagErr != nil { + return diagErr } return util.WithRetries(ctx, 30*time.Second, func() *retry.RetryError { diff --git a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_schema.go b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_schema.go index 5a952fc84..db12e288d 100644 --- a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_schema.go +++ b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_schema.go @@ -4,11 +4,11 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" ) /* @@ -90,7 +90,7 @@ func ResourceSite() *schema.Resource { Description: "A reoccurring rule for updating the Edges assigned to the site. The only supported frequencies are daily and weekly. Weekly frequencies require a day list with at least oneday specified. All other configurations are not supported.", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidateRrule, + ValidateDiagFunc: validators.ValidateRrule, }, "start": { Description: "Date time is represented as an ISO-8601 string without a timezone. For example: yyyy-MM-ddTHH:mm:ss.SSS", @@ -221,7 +221,7 @@ func ResourceSite() *schema.Resource { Description: "The caller ID value for the site. The callerID must be a valid E.164 formatted phone number", Type: schema.TypeString, Optional: true, - ValidateDiagFunc: gcloud.ValidatePhoneNumber, + ValidateDiagFunc: validators.ValidatePhoneNumber, }, "caller_name": { Description: "The caller name for the site", diff --git a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_test.go b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_test.go index aa1a90ca5..d601105cc 100644 --- a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_test.go +++ b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_test.go @@ -18,7 +18,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceSite(t *testing.T) { diff --git a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_utils.go b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_utils.go index 6c90c19a2..4cfd92d46 100644 --- a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_utils.go +++ b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_utils.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/leekchan/timeutil" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var ( diff --git a/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_init_test.go b/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_init_test.go index e8ace3917..dfa9e4042 100644 --- a/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_init_test.go +++ b/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_init_test.go @@ -2,7 +2,7 @@ package telephony_providers_edges_site_outbound_route import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "sync" gcloud "terraform-provider-genesyscloud/genesyscloud" diff --git a/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_proxy.go b/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_proxy.go index a45e1c589..d9ff5d76c 100644 --- a/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_proxy.go +++ b/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_proxy.go @@ -2,7 +2,7 @@ package telephony_providers_edges_site_outbound_route import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" telephonyProvidersEdgesSite "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site" ) diff --git a/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route.go b/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route.go index 91d094ef3..bcbab805e 100644 --- a/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route.go +++ b/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_schema.go b/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_schema.go index 0e424c08c..a16fefc0b 100644 --- a/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_schema.go +++ b/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_schema.go @@ -1,11 +1,12 @@ package telephony_providers_edges_site_outbound_route import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) /* @@ -93,7 +94,6 @@ func ResourceSiteOutboundRoute() *schema.Resource { Required: true, ConfigMode: schema.SchemaConfigModeAttr, Elem: outboundRouteSchema, - MinItems: 1, }, }, } diff --git a/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_utils.go b/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_utils.go index ff069de53..ababd9fe0 100644 --- a/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_utils.go +++ b/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_utils.go @@ -2,7 +2,7 @@ package telephony_providers_edges_site_outbound_route import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" ) diff --git a/genesyscloud/telephony_providers_edges_trunk/data_source_genesyscloud_telephony_providers_edges_trunk.go b/genesyscloud/telephony_providers_edges_trunk/data_source_genesyscloud_telephony_providers_edges_trunk.go index c6d9bbfc9..de61a6741 100644 --- a/genesyscloud/telephony_providers_edges_trunk/data_source_genesyscloud_telephony_providers_edges_trunk.go +++ b/genesyscloud/telephony_providers_edges_trunk/data_source_genesyscloud_telephony_providers_edges_trunk.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func dataSourceTrunkRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { diff --git a/genesyscloud/telephony_providers_edges_trunk/genesyscloud_telephony_providers_edges_trunk_proxy.go b/genesyscloud/telephony_providers_edges_trunk/genesyscloud_telephony_providers_edges_trunk_proxy.go index 1cefe3a53..4f2138191 100644 --- a/genesyscloud/telephony_providers_edges_trunk/genesyscloud_telephony_providers_edges_trunk_proxy.go +++ b/genesyscloud/telephony_providers_edges_trunk/genesyscloud_telephony_providers_edges_trunk_proxy.go @@ -3,7 +3,7 @@ package telephony_providers_edges_trunk import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) //generate a proxy for telephony_providers_edges_trunk diff --git a/genesyscloud/telephony_providers_edges_trunk/resource_genesyscloud_telephony_providers_edges_trunk.go b/genesyscloud/telephony_providers_edges_trunk/resource_genesyscloud_telephony_providers_edges_trunk.go index c303bc43f..af15ea366 100644 --- a/genesyscloud/telephony_providers_edges_trunk/resource_genesyscloud_telephony_providers_edges_trunk.go +++ b/genesyscloud/telephony_providers_edges_trunk/resource_genesyscloud_telephony_providers_edges_trunk.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func createTrunk(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { diff --git a/genesyscloud/tfexporter/export_common.go b/genesyscloud/tfexporter/export_common.go index 91fffdc7e..3743ab1a5 100644 --- a/genesyscloud/tfexporter/export_common.go +++ b/genesyscloud/tfexporter/export_common.go @@ -129,13 +129,22 @@ func IncludeFilterResourceByRegex(result resourceExporter.ResourceIDMetaMap, nam return result } + sanitizer := resourceExporter.NewSanitizerProvider() + for _, pattern := range newFilters { for k := range result { match, _ := regexp.MatchString(pattern, result[k].Name) + // If name matches original name if match { newResourceMap[k] = result[k] } + + // If name matches sanitized name + sanitizedMatch, _ := regexp.MatchString(pattern, sanitizer.S.SanitizeResourceName(result[k].Name)) + if sanitizedMatch { + newResourceMap[k] = result[k] + } } } @@ -157,10 +166,12 @@ func ExcludeFilterResourceByRegex(result resourceExporter.ResourceIDMetaMap, nam } newResourceMap := make(resourceExporter.ResourceIDMetaMap) + sanitizer := resourceExporter.NewSanitizerProvider() for k := range result { for _, pattern := range newFilters { + // If name matches original name match, _ := regexp.MatchString(pattern, result[k].Name) if !match { newResourceMap[k] = result[k] @@ -168,8 +179,16 @@ func ExcludeFilterResourceByRegex(result resourceExporter.ResourceIDMetaMap, nam delete(newResourceMap, k) break } - } + // If name matches sanitized name + sanitizedMatch, _ := regexp.MatchString(pattern, sanitizer.S.SanitizeResourceName(result[k].Name)) + if !sanitizedMatch { + newResourceMap[k] = result[k] + } else { + delete(newResourceMap, k) + break + } + } } return newResourceMap } diff --git a/genesyscloud/tfexporter/genesyscloud_resource_exporter.go b/genesyscloud/tfexporter/genesyscloud_resource_exporter.go index 35e878b48..abf75169a 100644 --- a/genesyscloud/tfexporter/genesyscloud_resource_exporter.go +++ b/genesyscloud/tfexporter/genesyscloud_resource_exporter.go @@ -1,10 +1,14 @@ package tfexporter import ( + "archive/zip" "context" "fmt" "hash/fnv" + "io" "log" + "os" + "path" "path/filepath" "reflect" "regexp" @@ -29,11 +33,11 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/mohae/deepcopy" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) /* - This file contains all of the logic associated wite the process of exporting a file. + This file contains all logic associated with the process of exporting a file. */ // Used to store the TF config block as a string so that it can be ignored when testing the exported HCL config file. @@ -178,7 +182,7 @@ func (g *GenesysCloudResourceExporter) Export() (diagErr diag.Diagnostics) { if diagErr != nil { return diagErr } - // Step #2 Retrieve all of the individual resources we are going to export + // Step #2 Retrieve all the individual resources we are going to export diagErr = g.retrieveSanitizedResourceMaps() if diagErr != nil { return diagErr @@ -327,6 +331,7 @@ func (g *GenesysCloudResourceExporter) retrieveGenesysCloudObjectInstances() dia go func(resType string, exporter *resourceExporter.ResourceExporter) { defer wg.Done() + log.Printf("Getting exported resources for [%s]", resType) typeResources, err := g.getResourcesForType(resType, g.provider, exporter, g.meta) if err != nil { @@ -479,6 +484,57 @@ func (g *GenesysCloudResourceExporter) generateOutputFiles() diag.Diagnostics { } } + err = g.generateZipForExporter() + if err != nil { + return err + } + + return nil +} + +func (g *GenesysCloudResourceExporter) generateZipForExporter() diag.Diagnostics { + zipFileName := "../archive_genesyscloud_tf_export" + uuid.NewString() + ".zip" + if compress := g.d.Get("compress").(bool); compress { //if true, compress directory name of where the export is going to occur + // read all the files + var files []fileMeta + ferr := filepath.Walk(g.exportDirPath, func(path string, info os.FileInfo, ferr error) error { + files = append(files, fileMeta{Path: path, IsDir: info.IsDir()}) + return nil + }) + if ferr != nil { + return diag.Errorf("Failed to fetch file path %s", ferr) + } + // create a zip + archive, ferr := os.Create(zipFileName) + if ferr != nil { + return diag.Errorf("Failed to create zip %s", ferr) + } + defer archive.Close() + zipWriter := zip.NewWriter(archive) + + for _, f := range files { + if !f.IsDir { + fPath := f.Path + + w, ferr := zipWriter.Create(path.Base(fPath)) + if ferr != nil { + return diag.Errorf("Failed to create base path for zip %s", ferr) + } + + file, ferr := os.Open(f.Path) + if ferr != nil { + return diag.Errorf("Failed to open the original file %s", ferr) + } + defer file.Close() + + if _, ferr = io.Copy(w, file); ferr != nil { + return diag.Errorf("Failed to copy the file to zip %s", ferr) + } + } + } + zipWriter.Close() + } + return nil } @@ -834,7 +890,7 @@ func (g *GenesysCloudResourceExporter) buildSanitizedResourceMaps(exporters map[ } if containsPermissionsErrorOnly(err) && logErrors { log.Printf("%v", err[0].Summary) - log.Print("log_permission_errors = true. Resuming export...") + log.Printf("Logging permission error for %s. Resuming export...", name) return } if err != nil { @@ -854,6 +910,7 @@ func (g *GenesysCloudResourceExporter) buildSanitizedResourceMaps(exporters map[ go func() { wg.Wait() + log.Print(`Finished building sanitized resource maps`) close(wgDone) }() @@ -1138,7 +1195,7 @@ func (g *GenesysCloudResourceExporter) sanitizeConfigMap( resourceName string, configMap map[string]interface{}, prevAttr string, - exporters map[string]*resourceExporter.ResourceExporter, //Map of all of the exporters + exporters map[string]*resourceExporter.ResourceExporter, //Map of all exporters exportingState bool, exportingAsHCL bool, parentKey bool) ([]unresolvableAttributeInfo, bool) { @@ -1258,7 +1315,7 @@ func (g *GenesysCloudResourceExporter) sanitizeConfigMap( // This can cause invalid config files due to including attributes with limits that don't allow for zero values, so we remove // those attributes from the config by default. Attributes can opt-out of this behavior by being added to a ResourceExporter's // AllowZeroValues list. - if !exporter.AllowForZeroValues(currAttr) { + if !exporter.AllowForZeroValues(currAttr) && !exporter.AllowForZeroValuesInMap(prevAttr) { removeZeroValues(key, configMap[key], configMap) } diff --git a/genesyscloud/tfexporter/genesyscloud_resource_exporter_test.go b/genesyscloud/tfexporter/genesyscloud_resource_exporter_test.go index e1b4a0619..1f85ff1ff 100644 --- a/genesyscloud/tfexporter/genesyscloud_resource_exporter_test.go +++ b/genesyscloud/tfexporter/genesyscloud_resource_exporter_test.go @@ -4,7 +4,7 @@ import ( "context" "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "reflect" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" diff --git a/genesyscloud/tfexporter/resource_genesyscloud_tf_export.go b/genesyscloud/tfexporter/resource_genesyscloud_tf_export.go index ff21b8582..44b727ab7 100644 --- a/genesyscloud/tfexporter/resource_genesyscloud_tf_export.go +++ b/genesyscloud/tfexporter/resource_genesyscloud_tf_export.go @@ -5,17 +5,23 @@ import ( "fmt" "os" "path/filepath" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" + "terraform-provider-genesyscloud/genesyscloud/tfexporter_state" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "terraform-provider-genesyscloud/genesyscloud/tfexporter_state" ) +type fileMeta struct { + Path string + IsDir bool +} + func SetRegistrar(l registrar.Registrar) { l.RegisterResource("genesyscloud_tf_export", ResourceTfExport()) @@ -48,7 +54,7 @@ func ResourceTfExport() *schema.Resource { Optional: true, Elem: &schema.Schema{ Type: schema.TypeString, - ValidateFunc: gcloud.ValidateSubStringInSlice(resourceExporter.GetAvailableExporterTypes()), + ValidateFunc: validators.ValidateSubStringInSlice(resourceExporter.GetAvailableExporterTypes()), }, ForceNew: true, Deprecated: "Use include_filter_resources attribute instead", @@ -60,7 +66,7 @@ func ResourceTfExport() *schema.Resource { Optional: true, Elem: &schema.Schema{ Type: schema.TypeString, - ValidateFunc: gcloud.ValidateSubStringInSlice(resourceExporter.GetAvailableExporterTypes()), + ValidateFunc: validators.ValidateSubStringInSlice(resourceExporter.GetAvailableExporterTypes()), }, ForceNew: true, ConflictsWith: []string{"resource_types", "exclude_filter_resources"}, @@ -80,7 +86,7 @@ func ResourceTfExport() *schema.Resource { Optional: true, Elem: &schema.Schema{ Type: schema.TypeString, - ValidateFunc: gcloud.ValidateSubStringInSlice(resourceExporter.GetAvailableExporterTypes()), + ValidateFunc: validators.ValidateSubStringInSlice(resourceExporter.GetAvailableExporterTypes()), }, ForceNew: true, ConflictsWith: []string{"resource_types", "include_filter_resources"}, @@ -134,6 +140,13 @@ func ResourceTfExport() *schema.Resource { Default: true, ForceNew: true, }, + "compress": { + Description: "Compress exported results using zip format", + Type: schema.TypeBool, + Optional: true, + Default: false, + ForceNew: true, + }, }, } } diff --git a/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go b/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go index d225adea1..4b91ebe6d 100644 --- a/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go +++ b/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go @@ -1,6 +1,8 @@ package tfexporter import ( + "archive/zip" + "bytes" "encoding/json" "fmt" "io" @@ -23,7 +25,7 @@ import ( "testing" "time" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/testrunner" @@ -124,6 +126,62 @@ func TestAccResourceTfExportIncludeFilterResourcesByRegEx(t *testing.T) { }) } +// TestAccResourceTfExportIncludeFilterResourcesByRegExAndSanitizedNames will create 3 queues (two with foo bar, one to be excluded). +// The test ensures that resources can be exported directly by their actual name or their sanitized names. +func TestAccResourceTfExportIncludeFilterResourcesByRegExAndSanitizedNames(t *testing.T) { + var ( + exportTestDir = "../.terraformregex" + uuid.NewString() + exportResource = "test-export3_1" + + queueResources = []QueueExport{ + {ResourceName: "test-queue-test-1", Name: "include filter test - exclude me", Description: "This is an excluded bar test resource", AcwTimeoutMs: 200000}, + {ResourceName: "test-queue-test-2", Name: "include filter test - foo - bar me", Description: "This is a foo bar test resource", AcwTimeoutMs: 200000}, + {ResourceName: "test-queue-test-3", Name: "include filter test - fu - barre you", Description: "This is a foo bar test resource", AcwTimeoutMs: 200000}, + } + ) + defer os.RemoveAll(exportTestDir) + + queueResourceDef := buildQueueResources(queueResources) + + config := queueResourceDef + + generateTfExportByIncludeFilterResources( + exportResource, + exportTestDir, + util.TrueValue, + []string{ + strconv.Quote("genesyscloud_routing_queue::include filter test - foo - bar me"), // Unsanitized Named Resource + strconv.Quote("genesyscloud_routing_queue::include_filter_test_-_fu_-_barre_you"), // Sanitized Named Resource + }, + util.FalseValue, + util.FalseValue, + []string{ + strconv.Quote("genesyscloud_routing_queue." + queueResources[0].ResourceName), + strconv.Quote("genesyscloud_routing_queue." + queueResources[1].ResourceName), + strconv.Quote("genesyscloud_routing_queue." + queueResources[2].ResourceName), + }, + ) + + sanitizer := resourceExporter.NewSanitizerProvider() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { util.TestAccPreCheck(t) }, + ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + Steps: []resource.TestStep{ + { + // Generate a queue as well and export it + Config: config, + // Wait for a specified duration to avoid runtime error + Check: resource.ComposeTestCheckFunc( + testQueueExportEqual(exportTestDir+"/"+defaultTfJSONFile, "genesyscloud_routing_queue", sanitizer.S.SanitizeResourceName(queueResources[1].Name), queueResources[1]), + testQueueExportEqual(exportTestDir+"/"+defaultTfJSONFile, "genesyscloud_routing_queue", sanitizer.S.SanitizeResourceName(queueResources[2].Name), queueResources[2]), + testQueueExportExcludesRegEx(exportTestDir+"/"+defaultTfJSONFile, "genesyscloud_routing_queue", ".*exclude me.*"), //We should not find any "test" queues here because we only wanted to include queues that ended with a -prod + ), + }, + }, + CheckDestroy: testVerifyExportsDestroyedFunc(exportTestDir), + }) +} + // TestAccResourceTfExportIncludeFilterResourcesByRegExExclusiveToResource // will create two queues (one with a -prod suffix and one with a -test suffix) // and two wrap up codes (one with a -prod suffix and one with a -test suffix) @@ -260,6 +318,78 @@ func TestAccResourceTfExportExcludeFilterResourcesByRegExExclusiveToResource(t * }) } +// TestAccResourceTfExportExcludeFilterResourcesByRegExExclusiveToResourceAndSanitizedNames will exclude any test resources that match a +// regular expression provided for the resource. In this test we check against both sanitized and unsanitized names. +func TestAccResourceTfExportExcludeFilterResourcesByRegExExclusiveToResourceAndSanitizedNames(t *testing.T) { + var ( + exportTestDir = "../.terraformExclude" + uuid.NewString() + exportResource = "test-export6_1" + + queueResources = []QueueExport{ + {ResourceName: "test-queue-test-1", Name: "exclude filter - exclude me", Description: "This is an excluded bar test resource", AcwTimeoutMs: 200000}, + {ResourceName: "test-queue-test-2", Name: "exclude filter - foo - bar me", Description: "This is a foo bar test resource", AcwTimeoutMs: 200000}, + {ResourceName: "test-queue-test-3", Name: "exclude filter - fu - barre you", Description: "This is a foo bar test resource", AcwTimeoutMs: 200000}, + } + + wrapupCodeResources = []WrapupcodeExport{ + {ResourceName: "test-wrapupcode-prod", Name: "exclude me"}, + {ResourceName: "test-wrapupcode-test", Name: "foo + bar me"}, + {ResourceName: "test-wrapupcode-dev", Name: "fu - barre you"}, + } + ) + defer os.RemoveAll(exportTestDir) + + queueResourceDef := buildQueueResources(queueResources) + wrapupcodeResourceDef := buildWrapupcodeResources(wrapupCodeResources) + config := queueResourceDef + wrapupcodeResourceDef + + generateTfExportByExcludeFilterResources( + exportResource, + exportTestDir, + util.TrueValue, + []string{ + strconv.Quote("genesyscloud_routing_queue::exclude filter - foo - bar me"), + strconv.Quote("genesyscloud_routing_queue::exclude_filter_-_fu_-_barre_you"), + strconv.Quote("genesyscloud_outbound_ruleset"), + strconv.Quote("genesyscloud_user"), + strconv.Quote("genesyscloud_user_roles"), + strconv.Quote("genesyscloud_flow"), + }, + util.FalseValue, + util.FalseValue, + []string{ + strconv.Quote("genesyscloud_routing_queue." + queueResources[0].ResourceName), + strconv.Quote("genesyscloud_routing_queue." + queueResources[1].ResourceName), + strconv.Quote("genesyscloud_routing_queue." + queueResources[2].ResourceName), + strconv.Quote("genesyscloud_routing_wrapupcode." + wrapupCodeResources[0].ResourceName), + strconv.Quote("genesyscloud_routing_wrapupcode." + wrapupCodeResources[1].ResourceName), + strconv.Quote("genesyscloud_routing_wrapupcode." + wrapupCodeResources[2].ResourceName), + }, + ) + + sanitizer := resourceExporter.NewSanitizerProvider() + resource.Test(t, resource.TestCase{ + PreCheck: func() { util.TestAccPreCheck(t) }, + ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + Steps: []resource.TestStep{ + { + PreConfig: func() { + time.Sleep(30 * time.Second) + }, + // Generate a queue as well and export it + Config: config, + Check: resource.ComposeTestCheckFunc( + testQueueExportEqual(exportTestDir+"/"+defaultTfJSONFile, "genesyscloud_routing_queue", sanitizer.S.SanitizeResourceName(queueResources[0].Name), queueResources[0]), + testWrapupcodeExportEqual(exportTestDir+"/"+defaultTfJSONFile, "genesyscloud_routing_wrapupcode", sanitizer.S.SanitizeResourceName(wrapupCodeResources[0].Name), wrapupCodeResources[0]), + testWrapupcodeExportEqual(exportTestDir+"/"+defaultTfJSONFile, "genesyscloud_routing_wrapupcode", sanitizer.S.SanitizeResourceName(wrapupCodeResources[1].Name), wrapupCodeResources[1]), + testWrapupcodeExportEqual(exportTestDir+"/"+defaultTfJSONFile, "genesyscloud_routing_wrapupcode", sanitizer.S.SanitizeResourceName(wrapupCodeResources[2].Name), wrapupCodeResources[2]), + testQueueExportExcludesRegEx(exportTestDir+"/"+defaultTfJSONFile, "genesyscloud_routing_queue", "(foo|fu)"), + ), + }, + }, + CheckDestroy: testVerifyExportsDestroyedFunc(exportTestDir), + }) +} + // TestAccResourceTfExportSplitFilesAsJSON will create 2 queues, 2 wrap up codes, and 2 users. // The exporter will be run in split mode so 3 resource tf.jsons should be created as well as a provider.tf.json func TestAccResourceTfExportSplitFilesAsJSON(t *testing.T) { @@ -334,6 +464,39 @@ func TestAccResourceTfExportSplitFilesAsJSON(t *testing.T) { }) } +// TestAccResourceTfExportForCompress does a basic test check to make sure the compressed file is created. +func TestAccResourceTfExportForCompress(t *testing.T) { + var ( + exportTestDir = "../../.terraform" + uuid.NewString() + exportResource1 = "test-export1" + zipFileName = "../archive_genesyscloud_tf_export*" + ) + + defer os.RemoveAll(exportTestDir) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { util.TestAccPreCheck(t) }, + ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + Steps: []resource.TestStep{ + { + // Run export without state file + Config: generateTfExportResourceForCompress( + exportResource1, + exportTestDir, + util.TrueValue, + util.TrueValue, + "", + ), + Check: resource.ComposeTestCheckFunc( + validateCompressedCreated(zipFileName), + validateCompressedFile(zipFileName), + ), + }, + }, + CheckDestroy: deleteTestCompressedZip(exportTestDir, zipFileName), + }) +} + // TestAccResourceTfExport does a basic test check to make sure the export file is created. func TestAccResourceTfExport(t *testing.T) { var ( @@ -1367,7 +1530,7 @@ resource "genesyscloud_outbound_campaign" "%s" { resource "genesyscloud_script" "script" { script_name = "%s" filepath = "%s" - file_content_hash = filesha256("%s") + file_content_hash = filesha256("%s") } data "genesyscloud_auth_division_home" "home" {} @@ -2129,8 +2292,8 @@ func generateTfExportResource( "genesyscloud_architect_datatable", "genesyscloud_architect_datatable_row", //"genesyscloud_flow", - "genesyscloud_flow_milestone", - //"genesyscloud_flow_outcome", + "genesyscloud_flow_milestone", + //"genesyscloud_flow_outcome", "genesyscloud_architect_ivr", "genesyscloud_architect_schedules", "genesyscloud_architect_schedulegroups", @@ -2179,6 +2342,25 @@ func generateTfExportResource( `, resourceID, directory, includeState, excludedAttributes) } +// generateTfExportResourceForCompress creates a resource to test compressed exported results +func generateTfExportResourceForCompress( + resourceID string, + directory string, + includeState string, + compressFlag string, + excludedAttributes string) string { + return fmt.Sprintf(`resource "genesyscloud_tf_export" "%s" { + directory = "%s" + include_state_file = %s + compress=%s + resource_types = [ + "genesyscloud_architect_datatable", + ] + exclude_attributes = [%s] + } + `, resourceID, directory, includeState, compressFlag, excludedAttributes) +} + func generateTfExportResourceMin( resourceID string, directory string, @@ -2303,6 +2485,40 @@ func validateFileCreated(filename string) resource.TestCheckFunc { } } +func validateCompressedCreated(filename string) resource.TestCheckFunc { + return func(state *terraform.State) error { + _, err := filepath.Glob(filename) + if err != nil { + return fmt.Errorf("Failed to find file") + } + return nil + } +} + +func deleteTestCompressedZip(exportPath string, zipFileName string) resource.TestCheckFunc { + return func(state *terraform.State) error { + dir, err := os.ReadDir(exportPath) + if err != nil { + return fmt.Errorf("Failed to read compressed zip %s", exportPath) + } + for _, d := range dir { + os.RemoveAll(filepath.Join(exportPath, d.Name())) + } + files, err := filepath.Glob(zipFileName) + + if err != nil { + return fmt.Errorf("Failed to get zip: %s", err) + } + for _, f := range files { + if err := os.Remove(f); err != nil { + return fmt.Errorf("Failed to delete: %s", err) + } + } + + return nil + } +} + func testVerifyExportsDestroyedFunc(exportTestDir string) resource.TestCheckFunc { return func(state *terraform.State) error { // Check config file deleted @@ -2337,6 +2553,56 @@ func validateEvaluationFormAttributes(resourceName string, form gcloud.Evaluatio ) } +// validateCompressedFile unzips and validates the exported resulted in the compressed folder +func validateCompressedFile(path string) resource.TestCheckFunc { + return func(state *terraform.State) error { + files, err := filepath.Glob(path) + if err != nil { + return err + } + for _, f := range files { + reader, err := zip.OpenReader(f) + if err != nil { + return err + } + for _, file := range reader.File { + err = validateCompressedConfigFiles(f, file) + if err != nil { + return err + } + } + } + return nil + } +} + +// validateCompressedConfigFiles validates the data inside the compressed json file +func validateCompressedConfigFiles(dirName string, file *zip.File) error { + + if file.FileInfo().Name() == defaultTfJSONFile { + rc, _ := file.Open() + + buf := new(bytes.Buffer) + buf.ReadFrom(rc) + var data map[string]interface{} + + if err := json.Unmarshal(buf.Bytes(), &data); err != nil { + return fmt.Errorf("failed to unmarshal json exportData to map variable: %v", err) + } + + if _, ok := data["resource"]; !ok { + return fmt.Errorf("config file missing resource attribute") + } + + if _, ok := data["terraform"]; !ok { + return fmt.Errorf("config file missing terraform attribute") + } + rc.Close() + return nil + } + return nil +} + func validateConfigFile(path string) resource.TestCheckFunc { return func(state *terraform.State) error { result, err := loadJsonFileToMap(path) diff --git a/genesyscloud/tfexporter/tf_exporter_resource_test.go b/genesyscloud/tfexporter/tf_exporter_resource_test.go index 3ea8cfa57..e2bb97141 100644 --- a/genesyscloud/tfexporter/tf_exporter_resource_test.go +++ b/genesyscloud/tfexporter/tf_exporter_resource_test.go @@ -7,8 +7,11 @@ import ( emergencyGroup "terraform-provider-genesyscloud/genesyscloud/architect_emergencygroup" flow "terraform-provider-genesyscloud/genesyscloud/architect_flow" flowLogLevel "terraform-provider-genesyscloud/genesyscloud/flow_loglevel" + outboundContactListContact "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list_contact" + routingSettings "terraform-provider-genesyscloud/genesyscloud/routing_settings" + routingUtilization "terraform-provider-genesyscloud/genesyscloud/routing_utilization" + routingUtilizationLabel "terraform-provider-genesyscloud/genesyscloud/routing_utilization_label" outboundRoute "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site_outbound_route" - grammar "terraform-provider-genesyscloud/genesyscloud/architect_grammar" grammarLanguage "terraform-provider-genesyscloud/genesyscloud/architect_grammar_language" archIvr "terraform-provider-genesyscloud/genesyscloud/architect_ivr" @@ -151,9 +154,9 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_routing_queue_conditional_group_routing"] = routingQueueConditionalGroupRouting.ResourceRoutingQueueConditionalGroupRouting() providerResources["genesyscloud_routing_queue_outbound_email_address"] = routingQueueOutboundEmailAddress.ResourceRoutingQueueOutboundEmailAddress() providerResources["genesyscloud_routing_skill"] = gcloud.ResourceRoutingSkill() - providerResources["genesyscloud_routing_settings"] = gcloud.ResourceRoutingSettings() - providerResources["genesyscloud_routing_utilization"] = gcloud.ResourceRoutingUtilization() - + providerResources["genesyscloud_routing_settings"] = routingSettings.ResourceRoutingSettings() + providerResources["genesyscloud_routing_utilization"] = routingUtilization.ResourceRoutingUtilization() + providerResources["genesyscloud_routing_utilization_label"] = routingUtilizationLabel.ResourceRoutingUtilizationLabel() providerResources["genesyscloud_routing_wrapupcode"] = gcloud.ResourceRoutingWrapupCode() providerResources["genesyscloud_telephony_providers_edges_extension_pool"] = edgeExtension.ResourceTelephonyExtensionPool() providerResources["genesyscloud_telephony_providers_edges_phone"] = edgePhone.ResourcePhone() @@ -175,6 +178,7 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_outbound_callabletimeset"] = obCallableTimeset.ResourceOutboundCallabletimeset() providerResources["genesyscloud_outbound_campaign"] = obCampaign.ResourceOutboundCampaign() providerResources["genesyscloud_outbound_contact_list"] = outboundContactList.ResourceOutboundContactList() + providerResources["genesyscloud_outbound_contact_list_contact"] = outboundContactListContact.ResourceOutboundContactListContact() providerResources["genesyscloud_outbound_contactlistfilter"] = obContactListFilter.ResourceOutboundContactlistfilter() providerResources["genesyscloud_outbound_messagingcampaign"] = ob.ResourceOutboundMessagingCampaign() providerResources["genesyscloud_outbound_sequence"] = obSequence.ResourceOutboundSequence() @@ -240,6 +244,7 @@ func (r *registerTestInstance) registerTestExporters() { RegisterExporter("genesyscloud_outbound_callabletimeset", obCallableTimeset.OutboundCallableTimesetExporter()) RegisterExporter("genesyscloud_outbound_campaign", obCampaign.OutboundCampaignExporter()) RegisterExporter("genesyscloud_outbound_contact_list", outboundContactList.OutboundContactListExporter()) + RegisterExporter("genesyscloud_outbound_contact_list_contact", outboundContactListContact.ContactExporter()) RegisterExporter("genesyscloud_outbound_contactlistfilter", obContactListFilter.OutboundContactlistfilterExporter()) RegisterExporter("genesyscloud_outbound_messagingcampaign", ob.OutboundMessagingcampaignExporter()) RegisterExporter("genesyscloud_outbound_sequence", obSequence.OutboundSequenceExporter()) @@ -260,11 +265,12 @@ func (r *registerTestInstance) registerTestExporters() { RegisterExporter("genesyscloud_routing_queue", routingQueue.RoutingQueueExporter()) RegisterExporter("genesyscloud_routing_queue_conditional_group_routing", routingQueueConditionalGroupRouting.RoutingQueueConditionalGroupRoutingExporter()) RegisterExporter("genesyscloud_routing_queue_outbound_email_address", routingQueueOutboundEmailAddress.OutboundRoutingQueueOutboundEmailAddressExporter()) - RegisterExporter("genesyscloud_routing_settings", gcloud.RoutingSettingsExporter()) + RegisterExporter("genesyscloud_routing_settings", routingSettings.RoutingSettingsExporter()) RegisterExporter("genesyscloud_routing_skill", gcloud.RoutingSkillExporter()) RegisterExporter("genesyscloud_routing_skill_group", gcloud.ResourceSkillGroupExporter()) RegisterExporter("genesyscloud_routing_sms_address", routingSmsAddress.RoutingSmsAddressExporter()) - RegisterExporter("genesyscloud_routing_utilization", gcloud.RoutingUtilizationExporter()) + RegisterExporter("genesyscloud_routing_utilization", routingUtilization.RoutingUtilizationExporter()) + RegisterExporter("genesyscloud_routing_utilization_label", routingUtilizationLabel.RoutingUtilizationLabelExporter()) RegisterExporter("genesyscloud_routing_wrapupcode", gcloud.RoutingWrapupCodeExporter()) RegisterExporter("genesyscloud_telephony_providers_edges_edge_group", edgeGroup.EdgeGroupExporter()) RegisterExporter("genesyscloud_telephony_providers_edges_extension_pool", edgeExtension.TelephonyExtensionPoolExporter()) diff --git a/genesyscloud/user_roles/genesyscloud_user_roles_proxy.go b/genesyscloud/user_roles/genesyscloud_user_roles_proxy.go index c82c59768..348ca624b 100644 --- a/genesyscloud/user_roles/genesyscloud_user_roles_proxy.go +++ b/genesyscloud/user_roles/genesyscloud_user_roles_proxy.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var internalProxy *userRolesProxy diff --git a/genesyscloud/user_roles/resource_genesyscloud_user_roles_utils.go b/genesyscloud/user_roles/resource_genesyscloud_user_roles_utils.go index 629bc643c..9f58a8e8a 100644 --- a/genesyscloud/user_roles/resource_genesyscloud_user_roles_utils.go +++ b/genesyscloud/user_roles/resource_genesyscloud_user_roles_utils.go @@ -7,7 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func flattenSubjectRoles(d *schema.ResourceData, p *userRolesProxy) (*schema.Set, *platformclientv2.APIResponse, error) { diff --git a/genesyscloud/util/feature_toggles/outbound_routes.go b/genesyscloud/util/feature_toggles/outbound_routes.go index d3bf3d035..b2f143601 100644 --- a/genesyscloud/util/feature_toggles/outbound_routes.go +++ b/genesyscloud/util/feature_toggles/outbound_routes.go @@ -2,14 +2,14 @@ package feature_toggles import "os" -const outboundRotesEnvToggle = "ENABLE_STANDALONE_OUTBOUND_ROUTES" +const outboundRoutesEnvToggle = "ENABLE_STANDALONE_OUTBOUND_ROUTES" func OutboundRoutesToggleName() string { - return outboundRotesEnvToggle + return outboundRoutesEnvToggle } func OutboundRoutesToggleExists() bool { var exists bool - _, exists = os.LookupEnv(outboundRotesEnvToggle) + _, exists = os.LookupEnv(outboundRoutesEnvToggle) return exists } diff --git a/genesyscloud/util/lists/util_lists.go b/genesyscloud/util/lists/util_lists.go index 58c13fdce..916c9b0fe 100644 --- a/genesyscloud/util/lists/util_lists.go +++ b/genesyscloud/util/lists/util_lists.go @@ -171,3 +171,15 @@ func Remove[T comparable](s []T, r T) []T { } return s } + +// ConvertMapStringAnyToMapStringString converts a map of type map[string]any to type map[string]string +func ConvertMapStringAnyToMapStringString(m map[string]any) map[string]string { + if m == nil { + return nil + } + sm := make(map[string]string) + for k, v := range m { + sm[k] = v.(string) + } + return sm +} diff --git a/genesyscloud/util/resourcedata/resourcedata.go b/genesyscloud/util/resourcedata/resourcedata.go index 89bb58ff2..066abcfc9 100644 --- a/genesyscloud/util/resourcedata/resourcedata.go +++ b/genesyscloud/util/resourcedata/resourcedata.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/leekchan/timeutil" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) const ( @@ -141,27 +141,27 @@ func SetNillableReferenceDivision(d *schema.ResourceData, key string, value *pla // SetNillableValue will read a basic type and set it on the schema func SetNillableValue[T any](d *schema.ResourceData, key string, value *T) { if value != nil { - d.Set(key, *value) + _ = d.Set(key, *value) } else { - d.Set(key, nil) + _ = d.Set(key, nil) } } -// SetNillableValueWithInterfaceArrayWithFunc will read the values in a nested resource using the provided function and set it on the schema +// SetNillableValueWithInterfaceArrayWithFunc will set the value of {key} to an interface array using func {f} if {value} is not nil func SetNillableValueWithInterfaceArrayWithFunc[T any](d *schema.ResourceData, key string, value *T, f func(*T) []interface{}) { if value != nil { - d.Set(key, f(value)) + _ = d.Set(key, f(value)) } else { - d.Set(key, nil) + _ = d.Set(key, nil) } } -// SetNillableValueWithInterfaceArrayWithFunc will read the values in a nested resource using the provided function and set it on the schema +// SetNillableValueWithSchemaSetWithFunc will set the value of {key} to a *schema.Set using func {f} if {value} is not nil func SetNillableValueWithSchemaSetWithFunc[T any](d *schema.ResourceData, key string, value *T, f func(*T) *schema.Set) { if value != nil { - d.Set(key, f(value)) + _ = d.Set(key, f(value)) } else { - d.Set(key, nil) + _ = d.Set(key, nil) } } diff --git a/genesyscloud/util/test_utils.go b/genesyscloud/util/test_utils.go index ff2e31a2c..a232e5ce0 100644 --- a/genesyscloud/util/test_utils.go +++ b/genesyscloud/util/test_utils.go @@ -308,8 +308,7 @@ func GenerateMapProperty(propName string, propValue string) string { func GenerateMapAttr(name string, properties ...string) string { return fmt.Sprintf(`%s = { %s - } - `, name, strings.Join(properties, "\n")) + }`, name, strings.Join(properties, "\n")) } func GenerateMapAttrWithMapProperties(name string, properties map[string]string) string { diff --git a/genesyscloud/util/util_basesetting_properties.go b/genesyscloud/util/util_basesetting_properties.go index c442d7681..44c0ea6de 100644 --- a/genesyscloud/util/util_basesetting_properties.go +++ b/genesyscloud/util/util_basesetting_properties.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func BuildTelephonyProperties(d *schema.ResourceData) *map[string]interface{} { diff --git a/genesyscloud/util/util_diagnostic_unit_test.go b/genesyscloud/util/util_diagnostic_unit_test.go index f6dd193fb..ec9fb4b9f 100644 --- a/genesyscloud/util/util_diagnostic_unit_test.go +++ b/genesyscloud/util/util_diagnostic_unit_test.go @@ -2,7 +2,7 @@ package util import ( "encoding/json" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "github.com/stretchr/testify/assert" "net/http" "net/url" diff --git a/genesyscloud/util/util_diagnostics.go b/genesyscloud/util/util_diagnostics.go index 8095bf9c7..7a707a3f0 100644 --- a/genesyscloud/util/util_diagnostics.go +++ b/genesyscloud/util/util_diagnostics.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type detailedDiagnosticInfo struct { diff --git a/genesyscloud/util/util_divisions.go b/genesyscloud/util/util_divisions.go index ff49af4c9..91f269645 100644 --- a/genesyscloud/util/util_divisions.go +++ b/genesyscloud/util/util_divisions.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type JsonMap map[string]interface{} diff --git a/genesyscloud/util/util_domainentities.go b/genesyscloud/util/util_domainentities.go index c06bb345b..a72921b5b 100644 --- a/genesyscloud/util/util_domainentities.go +++ b/genesyscloud/util/util_domainentities.go @@ -4,7 +4,7 @@ import ( lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func BuildSdkDomainEntityRef(d *schema.ResourceData, idAttr string) *platformclientv2.Domainentityref { diff --git a/genesyscloud/util/util_retries.go b/genesyscloud/util/util_retries.go index a20568128..8c819c434 100644 --- a/genesyscloud/util/util_retries.go +++ b/genesyscloud/util/util_retries.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func WithRetries(ctx context.Context, timeout time.Duration, method func() *retry.RetryError) diag.Diagnostics { diff --git a/genesyscloud/validators/validators.go b/genesyscloud/validators/validators.go index 4c4a78a9d..a375e6bd6 100644 --- a/genesyscloud/validators/validators.go +++ b/genesyscloud/validators/validators.go @@ -94,7 +94,7 @@ func ValidateRrule(rrule interface{}, _ cty.Path) diag.Diagnostics { return diag.Errorf("Provided rrule %v is not in string format", rrule) } -// Validates a phone extension pool +// ValidateExtensionPool validates a phone extension pool func ValidateExtensionPool(number interface{}, _ cty.Path) diag.Diagnostics { if numberStr, ok := number.(string); ok { @@ -109,7 +109,7 @@ func ValidateExtensionPool(number interface{}, _ cty.Path) diag.Diagnostics { return diag.Errorf("Extension provided %v is not a string", number) } -// Validates a date string is in the format yyyy-MM-dd +// ValidateDate validates a date string is in the format yyyy-MM-dd func ValidateDate(date interface{}, _ cty.Path) diag.Diagnostics { if dateStr, ok := date.(string); ok { _, err := time.Parse(resourcedata.DateParseFormat, dateStr) @@ -121,7 +121,7 @@ func ValidateDate(date interface{}, _ cty.Path) diag.Diagnostics { return diag.Errorf("Date %v is not a string", date) } -// Validates a date string is in the format 2006-01-02T15:04Z +// ValidateDateTime validates a date string is in the format 2006-01-02T15:04Z func ValidateDateTime(date interface{}, _ cty.Path) diag.Diagnostics { if dateStr, ok := date.(string); ok { _, err := time.Parse("2006-01-02T15:04Z", dateStr) @@ -133,7 +133,7 @@ func ValidateDateTime(date interface{}, _ cty.Path) diag.Diagnostics { return diag.Errorf("Date %v is not a string", date) } -// Validates a country code is in format ISO 3166-1 alpha-2 +// ValidateCountryCode validates a country code is in format ISO 3166-1 alpha-2 func ValidateCountryCode(code interface{}, _ cty.Path) diag.Diagnostics { countryCode := code.(string) if len(countryCode) == 2 { @@ -144,7 +144,7 @@ func ValidateCountryCode(code interface{}, _ cty.Path) diag.Diagnostics { return diag.Errorf("Country code %v is not of format ISO 3166-1 alpha-2", code) } -// Validates a date string is in format hh:mm:ss +// ValidateTime validates a date string is in format hh:mm:ss func ValidateTime(time interface{}, _ cty.Path) diag.Diagnostics { timeStr := time.(string) if len(timeStr) > 9 { @@ -157,7 +157,7 @@ func ValidateTime(time interface{}, _ cty.Path) diag.Diagnostics { return diag.Errorf("Time %v is not a valid time", time) } -// Validates a date string is in format hh:mm +// ValidateTimeHHMM validates a date string is in format hh:mm func ValidateTimeHHMM(time interface{}, _ cty.Path) diag.Diagnostics { timeStr := time.(string) if timeStr == "" { @@ -171,7 +171,7 @@ func ValidateTimeHHMM(time interface{}, _ cty.Path) diag.Diagnostics { return diag.Errorf("Time %v is not a valid time, must use format HH:mm", time) } -// Validates a date string is in the format 2006-01-02T15:04:05.000000 +// ValidateLocalDateTimes validates a date string is in the format 2006-01-02T15:04:05.000000 func ValidateLocalDateTimes(date interface{}, _ cty.Path) diag.Diagnostics { if dateStr, ok := date.(string); ok { _, err := time.Parse(resourcedata.TimeParseFormat, dateStr) @@ -183,7 +183,7 @@ func ValidateLocalDateTimes(date interface{}, _ cty.Path) diag.Diagnostics { return diag.Errorf("Date %v is not a string", date) } -// Validates a file path or URL +// ValidatePath validates a file path or URL func ValidatePath(i interface{}, k string) (warnings []string, errors []error) { v, ok := i.(string) if !ok { @@ -207,7 +207,7 @@ func ValidatePath(i interface{}, k string) (warnings []string, errors []error) { return warnings, errors } -// Validate a response asset filename matches the criteria outlined in the description +// ValidateResponseAssetName validate a response asset filename matches the criteria outlined in the description func ValidateResponseAssetName(name interface{}, _ cty.Path) diag.Diagnostics { if nameStr, ok := name.(string); ok { matched, err := regexp.MatchString("^[^\\.][^\\`\\\\{\\^\\}\\% \"\\>\\<\\[\\]\\#\\~|]+[^/]$", nameStr) @@ -250,7 +250,7 @@ func ValidateSubStringInSlice(valid []string) schema.SchemaValidateFunc { } } -// Validate if a string matches '#FFFFFF' RGB color representation. +// ValidateHexColor validates if a string matches '#FFFFFF' RGB color representation. func ValidateHexColor(color interface{}, _ cty.Path) diag.Diagnostics { if colorStr, ok := color.(string); ok { matched, err := regexp.MatchString("^#([A-Fa-f0-9]{6})$", colorStr) diff --git a/genesyscloud/webdeployments_configuration/genesyscloud_webdeployments_configuration_proxy.go b/genesyscloud/webdeployments_configuration/genesyscloud_webdeployments_configuration_proxy.go index e4609b7d9..ea0671576 100644 --- a/genesyscloud/webdeployments_configuration/genesyscloud_webdeployments_configuration_proxy.go +++ b/genesyscloud/webdeployments_configuration/genesyscloud_webdeployments_configuration_proxy.go @@ -9,7 +9,7 @@ import ( "time" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var internalProxy *webDeploymentsConfigurationProxy diff --git a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration.go b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration.go index 60d879d96..ea88bc60a 100644 --- a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration.go +++ b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllWebDeploymentConfigurations(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_schema.go b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_schema.go index ba5c38bea..8cb13177c 100644 --- a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_schema.go +++ b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_schema.go @@ -4,7 +4,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" - gcloud "terraform-provider-genesyscloud/genesyscloud/validators" + "terraform-provider-genesyscloud/genesyscloud/validators" wdcUtils "terraform-provider-genesyscloud/genesyscloud/webdeployments_configuration/utils" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -518,13 +518,13 @@ var ( Description: "Background color for hero section, in hexadecimal format, eg #ffffff", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidateHexColor, + ValidateDiagFunc: validators.ValidateHexColor, }, "text_color": { Description: "Text color for hero section, in hexadecimal format, eg #ffffff", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidateHexColor, + ValidateDiagFunc: validators.ValidateHexColor, }, "image_uri": { Description: "Background image for hero section", @@ -546,31 +546,31 @@ var ( Description: "Global background color, in hexadecimal format, eg #ffffff", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidateHexColor, + ValidateDiagFunc: validators.ValidateHexColor, }, "primary_color": { Description: "Global primary color, in hexadecimal format, eg #ffffff", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidateHexColor, + ValidateDiagFunc: validators.ValidateHexColor, }, "primary_color_dark": { Description: "Global dark primary color, in hexadecimal format, eg #ffffff", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidateHexColor, + ValidateDiagFunc: validators.ValidateHexColor, }, "primary_color_light": { Description: "Global light primary color, in hexadecimal format, eg #ffffff", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidateHexColor, + ValidateDiagFunc: validators.ValidateHexColor, }, "text_color": { Description: "Global text color, in hexadecimal format, eg #ffffff", Type: schema.TypeString, Required: true, - ValidateDiagFunc: gcloud.ValidateHexColor, + ValidateDiagFunc: validators.ValidateHexColor, }, "font_family": { Description: "Global font family", diff --git a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_test.go b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_test.go index d83cb8f42..59984641e 100644 --- a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_test.go +++ b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) type scCustomMessageConfig struct { diff --git a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_journey.go b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_journey.go index 9d073a5c1..09edc3979 100644 --- a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_journey.go +++ b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_journey.go @@ -4,7 +4,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func buildSelectorEventTriggers(triggers []interface{}) *[]platformclientv2.Selectoreventtrigger { diff --git a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_messenger.go b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_messenger.go index b5deb12fe..e12d1ae40 100644 --- a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_messenger.go +++ b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_messenger.go @@ -2,7 +2,7 @@ package webdeployments_configuration_utils import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/lists" ) diff --git a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_support_center.go b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_support_center.go index 83e53bfcd..f29d7605d 100644 --- a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_support_center.go +++ b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_support_center.go @@ -4,7 +4,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func buildSupportCenterHeroStyle(styles []interface{}) *platformclientv2.Supportcenterherostyle { diff --git a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_utils.go b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_utils.go index 4a61793cd..b12770c46 100644 --- a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_utils.go +++ b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_utils.go @@ -7,7 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func buildCobrowseSettings(d *schema.ResourceData) *platformclientv2.Cobrowsesettings { @@ -160,7 +160,7 @@ func FlattenCobrowseSettings(cobrowseSettings *platformclientv2.Cobrowsesettings return []interface{}{map[string]interface{}{ "enabled": cobrowseSettings.Enabled, "allow_agent_control": cobrowseSettings.AllowAgentControl, - "allow_agent_navigation": cobrowseSettings.AllowAgentNavigation, + "allow_agent_navigation": cobrowseSettings.AllowAgentNavigation, "channels": cobrowseSettings.Channels, "mask_selectors": cobrowseSettings.MaskSelectors, "readonly_selectors": cobrowseSettings.ReadonlySelectors, diff --git a/genesyscloud/webdeployments_deployment/genesyscloud_webdeployments_deployment_proxy.go b/genesyscloud/webdeployments_deployment/genesyscloud_webdeployments_deployment_proxy.go index 1fa51d7e1..5dfb49182 100644 --- a/genesyscloud/webdeployments_deployment/genesyscloud_webdeployments_deployment_proxy.go +++ b/genesyscloud/webdeployments_deployment/genesyscloud_webdeployments_deployment_proxy.go @@ -10,7 +10,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "time" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) var internalProxy *webDeploymentsProxy diff --git a/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment.go b/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment.go index 2e0012aa1..d8ce2bff2 100644 --- a/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment.go +++ b/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func getAllWebDeployments(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_test.go b/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_test.go index 320c085de..0f223d80d 100644 --- a/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_test.go +++ b/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func TestAccResourceWebDeploymentsDeployment(t *testing.T) { diff --git a/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_utils.go b/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_utils.go index d0f318b06..358560e1e 100644 --- a/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_utils.go +++ b/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_utils.go @@ -4,7 +4,7 @@ import ( "errors" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v130/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) func alwaysDifferent(k, old, new string, d *schema.ResourceData) bool { diff --git a/go.mod b/go.mod index 97d022f1b..641f4f37c 100644 --- a/go.mod +++ b/go.mod @@ -6,12 +6,12 @@ require ( github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.6.0 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 - github.com/hashicorp/hcl/v2 v2.20.1 + github.com/hashicorp/hcl/v2 v2.21.0 github.com/hashicorp/terraform-plugin-docs v0.19.4 github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 github.com/leekchan/timeutil v0.0.0-20150802142658-28917288c48d github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 - github.com/mypurecloud/platform-client-sdk-go/v130 v130.0.0 + github.com/mypurecloud/platform-client-sdk-go/v131 v131.0.0 github.com/nyaruka/phonenumbers v1.3.6 github.com/rjNemo/underscore v0.6.1 github.com/zclconf/go-cty v1.14.4 diff --git a/go.sum b/go.sum index fc5087feb..ed2d47cac 100644 --- a/go.sum +++ b/go.sum @@ -166,8 +166,8 @@ github.com/hashicorp/hc-install v0.7.0 h1:Uu9edVqjKQxxuD28mR5TikkKDd/p55S8vzPC16 github.com/hashicorp/hc-install v0.7.0/go.mod h1:ELmmzZlGnEcqoUMKUuykHaPCIR1sYLYX+KSggWSKZuA= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/hcl/v2 v2.20.1 h1:M6hgdyz7HYt1UN9e61j+qKJBqR3orTWbI1HKBJEdxtc= -github.com/hashicorp/hcl/v2 v2.20.1/go.mod h1:TZDqQ4kNKCbh1iJp99FdPiUaVDDUPivbqxZulxDYqL4= +github.com/hashicorp/hcl/v2 v2.21.0 h1:lve4q/o/2rqwYOgUg3y3V2YPyD1/zkCLGjIV74Jit14= +github.com/hashicorp/hcl/v2 v2.21.0/go.mod h1:62ZYHrXgPoX8xBnzl8QzbWq4dyDsDtfCRgIq1rbJEvA= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= @@ -257,8 +257,8 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mypurecloud/platform-client-sdk-go/v130 v130.0.0 h1:D6UheKy0j2dFMYMomhx/Qe7IMXeu6fkrUCKUBX11acw= -github.com/mypurecloud/platform-client-sdk-go/v130 v130.0.0/go.mod h1:iDiiCTL8WLcSaLb1W3Qpmj4fGU0kCATO7nvg7098veQ= +github.com/mypurecloud/platform-client-sdk-go/v131 v131.0.0 h1:2YkBK/2pSoaehuSTqhFDXb806nxmHIrz7RxKsQSqM/0= +github.com/mypurecloud/platform-client-sdk-go/v131 v131.0.0/go.mod h1:pWn1ub6TxkdOiI1mgZED+fICo/JiqujY4h+wfgYbOi4= github.com/nyaruka/phonenumbers v1.3.6 h1:33owXWp4d1U+Tyaj9fpci6PbvaQZcXBUO2FybeKeLwQ= github.com/nyaruka/phonenumbers v1.3.6/go.mod h1:Ut+eFwikULbmCenH6InMKL9csUNLyxHuBLyfkpum11s= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= @@ -346,7 +346,7 @@ github.com/yuin/goldmark-meta v1.1.0 h1:pWw+JLHGZe8Rk0EGsMVssiNb/AaPMHfSRszZeUei github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBvXi1lBb2VP0= github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8= github.com/zclconf/go-cty v1.14.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= -github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b h1:FosyBZYxY34Wul7O/MSKey3txpPYyCqVO5ZyceuQJEI= +github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6ZMSMNJFMOjqrGHynW3DIBuR2H9j0ug+Mo= go.abhg.dev/goldmark/frontmatter v0.2.0 h1:P8kPG0YkL12+aYk2yU3xHv4tcXzeVnN+gU0tJ5JnxRw= go.abhg.dev/goldmark/frontmatter v0.2.0/go.mod h1:XqrEkZuM57djk7zrlRUB02x8I5J0px76YjkOzhB4YlU= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= diff --git a/jenkins/tests/Jenkinsfile b/jenkins/tests/Jenkinsfile index 7fd3f102b..3884e0d17 100644 --- a/jenkins/tests/Jenkinsfile +++ b/jenkins/tests/Jenkinsfile @@ -20,7 +20,7 @@ pipeline { GOPATH = "$HOME/go" TF_LOG = "DEBUG" TF_LOG_PATH = "../test.log" - GENESYSCLOUD_REGION = "${region}" + GENESYSCLOUD_REGION = "${region}" GENESYSCLOUD_SDK_DEBUG = "true" GENESYSCLOUD_TOKEN_POOL_SIZE = 20 PATH = "${env.PATH}:${HOME}/go/bin:/home/jenkins/.local/bin" @@ -49,7 +49,7 @@ pipeline { sh 'go install github.com/nezorflame/junit-merger@latest' sh 'pip install xmltodict --user' } - } + } stage('Terraform Check') { steps { @@ -59,6 +59,27 @@ pipeline { } } + stage('Unit Tests') { + + environment { + TF_UNIT=1 + ENABLE_STANDALONE_EMAIL_ADDRESS=1 + ENABLE_STANDALONE_CGR=1 + } + + steps { + catchError(buildResult: 'FAILURE', stageResult:'FAILURE'){ + echo 'Attempting to Run Unit Tests' + withCredentials([usernamePassword(credentialsId: CREDENTIALS_ID, usernameVariable: 'GENESYSCLOUD_OAUTHCLIENT_ID',passwordVariable:'GENESYSCLOUD_OAUTHCLIENT_SECRET')]) + { + echo 'Loading Genesys OAuth Credentials' + sh "gotestsum --junitfile unit.xml --format standard-verbose ./genesyscloud/... -run 'Test|TestUnit' -skip 'TestAcc' -v -timeout 30m -count=1 -cover -coverprofile=coverageUnit.out" + + } + } + } + } + stage('Architect Tests') { environment { TF_ACC=1 @@ -330,16 +351,16 @@ pipeline { sh 'GOBIN=$HOME/bin go install github.com/wadey/gocovmerge@latest' // Generate merged coverage report - sh '$HOME/bin/gocovmerge coverageArchitect.out coverageIdp.out coverageAuth.out coverageIntegration.out coverageFlow.out coverageJourney.out coverageKnowledge.out coverageOutbound.out coverageResponseManagement.out coverageRouting.out coverageExport.out coverageLocation.out coverageWebDeployment.out coverageRemaining.out coverageSite.out coverageRoleTeam.out > merged_coverage.out' + sh '$HOME/bin/gocovmerge coverageArchitect.out coverageIdp.out coverageAuth.out coverageIntegration.out coverageFlow.out coverageJourney.out coverageKnowledge.out coverageOutbound.out coverageResponseManagement.out coverageRouting.out coverageExport.out coverageLocation.out coverageWebDeployment.out coverageRemaining.out coverageSite.out coverageRoleTeam.out coverageUnit.out > merged_coverage.out' // Convert merged coverage report to HTML - sh 'go tool cover -html merged_coverage.out -o coverageAcceptance.html' + sh 'go tool cover -html merged_coverage.out -o coverageReport.html' - sh 'junit-merger -o test-results.xml architect.xml idp.xml auth.xml integration.xml flow.xml journey.xml knowledge.xml outbound.xml response.xml routing.xml location.xml web.xml site.xml team.xml export.xml remaining.xml' + sh 'junit-merger -o test-results.xml unit.xml architect.xml idp.xml auth.xml integration.xml flow.xml journey.xml knowledge.xml outbound.xml response.xml routing.xml location.xml web.xml site.xml team.xml export.xml remaining.xml' script { // Read the generated HTML file - def htmlFile = readFile 'coverageAcceptance.html' + def htmlFile = readFile 'coverageReport.html' def selectStart = htmlFile.indexOf('', selectStart) def fileCoverageSection = htmlFile.substring(selectStart, selectEnd + 9) // +9 to include @@ -494,7 +515,7 @@ pipeline { updatedHtmlFile = updatedHtmlFile.replace('', "\n") updatedHtmlFile = updatedHtmlFile.replace('', tableHtml + '\n' + scriptHtml + '\n') - writeFile file: 'coverageAcceptance.html', text: updatedHtmlFile + writeFile file: 'coverageReport.html', text: updatedHtmlFile // Generate manual report def xmlContent = readFile 'test-results.xml' @@ -675,7 +696,7 @@ pipeline { // Optionally, print the location of the HTML report echo "HTML report generated: \${env.WORKSPACE}/test-report.html" } - archiveArtifacts artifacts: 'coverageAcceptance.html,test-report.html,test-results.xml', allowEmptyArchive: true + archiveArtifacts artifacts: 'coverageReport.html,test-report.html,test-results.xml', allowEmptyArchive: true } } } diff --git a/main.go b/main.go index 76ffaac7a..01df3ea64 100644 --- a/main.go +++ b/main.go @@ -42,6 +42,7 @@ import ( obCampaign "terraform-provider-genesyscloud/genesyscloud/outbound_campaign" obCampaignRule "terraform-provider-genesyscloud/genesyscloud/outbound_campaignrule" obContactList "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list" + outboundContactListContact "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list_contact" obContactListFilter "terraform-provider-genesyscloud/genesyscloud/outbound_contactlistfilter" obDncList "terraform-provider-genesyscloud/genesyscloud/outbound_dnclist" obfst "terraform-provider-genesyscloud/genesyscloud/outbound_filespecificationtemplate" @@ -59,12 +60,15 @@ import ( responsemanagementResponseasset "terraform-provider-genesyscloud/genesyscloud/responsemanagement_responseasset" routingEmailRoute "terraform-provider-genesyscloud/genesyscloud/routing_email_route" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" + routingUtilization "terraform-provider-genesyscloud/genesyscloud/routing_utilization" + routingUtilizationLabel "terraform-provider-genesyscloud/genesyscloud/routing_utilization_label" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/plugin" routingQueueConditionalGroupRouting "terraform-provider-genesyscloud/genesyscloud/routing_queue_conditional_group_routing" routingQueueOutboundEmailAddress "terraform-provider-genesyscloud/genesyscloud/routing_queue_outbound_email_address" + routingSettings "terraform-provider-genesyscloud/genesyscloud/routing_settings" smsAddresses "terraform-provider-genesyscloud/genesyscloud/routing_sms_addresses" "terraform-provider-genesyscloud/genesyscloud/scripts" "terraform-provider-genesyscloud/genesyscloud/station" @@ -222,6 +226,10 @@ func registerResources() { routingQueue.SetRegistrar(regInstance) //Registering routing queue routingQueueConditionalGroupRouting.SetRegistrar(regInstance) //Registering routing queue conditional group routing routingQueueOutboundEmailAddress.SetRegistrar(regInstance) //Registering routing queue outbound email address + outboundContactListContact.SetRegistrar(regInstance) //Registering outbound contact list contact + routingSettings.SetRegistrar(regInstance) //Registering routing Settings + routingUtilization.SetRegistrar(regInstance) // Registering routing utilization + routingUtilizationLabel.SetRegistrar(regInstance) // Registering routing utilization label journeyViews.SetRegistrar(regInstance) //Registering journey views // setting resources for Use cases like TF export where provider is used in resource classes. diff --git a/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/05_update_remove_ignore_frequency_cap.tf b/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/05_update_remove_ignore_frequency_cap.tf index 1010bf0fb..a62c9d674 100644 --- a/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/05_update_remove_ignore_frequency_cap.tf +++ b/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/05_update_remove_ignore_frequency_cap.tf @@ -19,7 +19,7 @@ resource "genesyscloud_journey_segment" "terraform_test_-TEST-CASE-_action_map_d display_name = "terraform_test_-TEST-CASE-_action_map_dependency" color = "#008000" scope = "Session" - should_display_to_agent = false + should_display_to_agent = false journey { patterns { criteria { diff --git a/test/data/resource/genesyscloud_journey_segment/basic_session_attributes/01_create_session_scope.tf b/test/data/resource/genesyscloud_journey_segment/basic_attributes/01_basic_resource.tf similarity index 100% rename from test/data/resource/genesyscloud_journey_segment/basic_session_attributes/01_create_session_scope.tf rename to test/data/resource/genesyscloud_journey_segment/basic_attributes/01_basic_resource.tf diff --git a/test/data/resource/genesyscloud_journey_segment/basic_session_attributes/02_update_attributes.tf b/test/data/resource/genesyscloud_journey_segment/basic_attributes/02_update_attributes.tf similarity index 100% rename from test/data/resource/genesyscloud_journey_segment/basic_session_attributes/02_update_attributes.tf rename to test/data/resource/genesyscloud_journey_segment/basic_attributes/02_update_attributes.tf diff --git a/test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/01_create_customer_scope.tf b/test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/01_create_customer_scope.tf deleted file mode 100644 index 13cc0599f..000000000 --- a/test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/01_create_customer_scope.tf +++ /dev/null @@ -1,19 +0,0 @@ -resource "genesyscloud_journey_segment" "terraform_test_-TEST-CASE-" { - display_name = "terraform_test_-TEST-CASE-" - color = "#008000" - should_display_to_agent = false - scope = "Session" - journey { - patterns { - criteria { - key = "page.title" - values = ["Title"] - operator = "notEqual" - should_ignore_case = true - } - count = 1 - stream_type = "Web" - session_type = "web" - } - } -} diff --git a/test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/02_recreate_external_segment_update_name.tf b/test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/02_recreate_external_segment_update_name.tf deleted file mode 100644 index 37c77bc7a..000000000 --- a/test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/02_recreate_external_segment_update_name.tf +++ /dev/null @@ -1,19 +0,0 @@ -resource "genesyscloud_journey_segment" "terraform_test_-TEST-CASE-" { - display_name = "terraform_test_-TEST-CASE-_recreated" - color = "#308000" - should_display_to_agent = false -scope = "Session" - journey { - patterns { - criteria { - key = "page.title" - values = ["Title"] - operator = "notEqual" - should_ignore_case = true - } - count = 1 - stream_type = "Web" - session_type = "web" - } - } -} diff --git a/test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/03_recreate_external_segment_id_force_new.tf b/test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/03_recreate_external_segment_id_force_new.tf deleted file mode 100644 index 4b224baf3..000000000 --- a/test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/03_recreate_external_segment_id_force_new.tf +++ /dev/null @@ -1,20 +0,0 @@ -resource "genesyscloud_journey_segment" "terraform_test_-TEST-CASE-" { - display_name = "terraform_test_-TEST-CASE-_recreated" - color = "#308000" - should_display_to_agent = false - scope = "Session" - - journey { - patterns { - criteria { - key = "page.title" - values = ["Title"] - operator = "notEqual" - should_ignore_case = true - } - count = 1 - stream_type = "Web" - session_type = "web" - } - } -} diff --git a/test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/04_update_color_change.tf b/test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/04_update_color_change.tf deleted file mode 100644 index e163793a6..000000000 --- a/test/data/resource/genesyscloud_journey_segment/basic_customer_attributes/04_update_color_change.tf +++ /dev/null @@ -1,20 +0,0 @@ -resource "genesyscloud_journey_segment" "terraform_test_-TEST-CASE-" { - display_name = "terraform_test_-TEST-CASE-_updated" - color = "#318234" - should_display_to_agent = false - scope = "Session" - - journey { - patterns { - criteria { - key = "page.title" - values = ["Title"] - operator = "notEqual" - should_ignore_case = true - } - count = 1 - stream_type = "Web" - session_type = "web" - } - } -} diff --git a/test/data/resource/genesyscloud_journey_segment/basic_session_attributes/03_recreate_scope_change_force_new.tf b/test/data/resource/genesyscloud_journey_segment/basic_session_attributes/03_recreate_scope_change_force_new.tf deleted file mode 100644 index 4b224baf3..000000000 --- a/test/data/resource/genesyscloud_journey_segment/basic_session_attributes/03_recreate_scope_change_force_new.tf +++ /dev/null @@ -1,20 +0,0 @@ -resource "genesyscloud_journey_segment" "terraform_test_-TEST-CASE-" { - display_name = "terraform_test_-TEST-CASE-_recreated" - color = "#308000" - should_display_to_agent = false - scope = "Session" - - journey { - patterns { - criteria { - key = "page.title" - values = ["Title"] - operator = "notEqual" - should_ignore_case = true - } - count = 1 - stream_type = "Web" - session_type = "web" - } - } -} diff --git a/test/data/resource/genesyscloud_journey_segment/optional_attributes/04_update_remove_assignment_expirition_days.tf b/test/data/resource/genesyscloud_journey_segment/optional_attributes/04_update_remove_assignment_expirition_days.tf deleted file mode 100644 index 255113a57..000000000 --- a/test/data/resource/genesyscloud_journey_segment/optional_attributes/04_update_remove_assignment_expirition_days.tf +++ /dev/null @@ -1,20 +0,0 @@ -resource "genesyscloud_journey_segment" "terraform_test_-TEST-CASE-" { - # required - display_name = "terraform_test_-TEST-CASE-_updated" - color = "#008000" - scope = "Session" - should_display_to_agent = false - journey { - patterns { - criteria { - key = "page.title" - values = ["Title"] - operator = "notEqual" - should_ignore_case = true - } - count = 1 - stream_type = "Web" - session_type = "web" - } - } -} From 6531e137b0aeb7b0c959c214b6301b4bcaaa7df5 Mon Sep 17 00:00:00 2001 From: shrutisuryawanshigenesys Date: Tue, 25 Jun 2024 05:30:05 -0400 Subject: [PATCH 27/62] refactor/DEVTOOLING-158 idp_gsuite (#1099) * refactored idp_gsuite * removed references of data source * deleted unrefactored files * changed references * resolved comments * added name, slo_uri, slo_binding to idp_gsuite --- docs/resources/idp_gsuite.md | 3 + .../genesyscloud_idp_gsuite_proxy.go | 88 ++++++++ .../resource_genesyscloud_idp_gsuite.go | 156 +++++++++++++ ...ource_genesyscloud_idp_gsuite_init_test.go | 46 ++++ ...resource_genesyscloud_idp_gsuite_schema.go | 103 +++++++++ .../resource_genesyscloud_idp_gsuite_test.go | 49 +++- .../resource_genesyscloud_idp_gsuite.go | 212 ------------------ genesyscloud/resource_genesyscloud_init.go | 2 - .../resource_genesyscloud_init_test.go | 1 - .../tfexporter/tf_exporter_resource_test.go | 5 +- main.go | 2 + 11 files changed, 446 insertions(+), 221 deletions(-) create mode 100644 genesyscloud/idp_gsuite/genesyscloud_idp_gsuite_proxy.go create mode 100644 genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite.go create mode 100644 genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_init_test.go create mode 100644 genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_schema.go rename genesyscloud/{ => idp_gsuite}/resource_genesyscloud_idp_gsuite_test.go (75%) delete mode 100644 genesyscloud/resource_genesyscloud_idp_gsuite.go diff --git a/docs/resources/idp_gsuite.md b/docs/resources/idp_gsuite.md index 0098d55c4..a8881b908 100644 --- a/docs/resources/idp_gsuite.md +++ b/docs/resources/idp_gsuite.md @@ -37,7 +37,10 @@ resource "genesyscloud_idp_gsuite" "gsuite" { ### Optional - `disabled` (Boolean) True if GSuite is disabled. Defaults to `false`. +- `name` (String) Name of the provider. - `relying_party_identifier` (String) String used to identify Genesys Cloud to GSuite. +- `slo_binding` (String) Valid values: HTTP Redirect, HTTP Post +- `slo_uri` (String) Provided by Okta on app creation. - `target_uri` (String) Target URI provided by GSuite. - `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) diff --git a/genesyscloud/idp_gsuite/genesyscloud_idp_gsuite_proxy.go b/genesyscloud/idp_gsuite/genesyscloud_idp_gsuite_proxy.go new file mode 100644 index 000000000..c7c804470 --- /dev/null +++ b/genesyscloud/idp_gsuite/genesyscloud_idp_gsuite_proxy.go @@ -0,0 +1,88 @@ +package idp_gsuite + +import ( + "context" + "fmt" + + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" +) + +/* +The genesyscloud_idp_gsuite_proxy.go file contains the proxy structures and methods that interact +with the Genesys Cloud SDK. We use composition here for each function on the proxy so individual functions can be stubbed +out during testing. +*/ + +// internalProxy holds a proxy instance that can be used throughout the package +var internalProxy *idpGsuiteProxy + +// Type definitions for each func on our proxy so we can easily mock them out later +type getIdpGsuiteFunc func(ctx context.Context, p *idpGsuiteProxy) (*platformclientv2.Gsuite, *platformclientv2.APIResponse, error) +type updateIdpGsuiteFunc func(ctx context.Context, p *idpGsuiteProxy, id string, gSuite *platformclientv2.Gsuite) (*platformclientv2.Identityprovider, *platformclientv2.APIResponse, error) +type deleteIdpGsuiteFunc func(ctx context.Context, p *idpGsuiteProxy, id string) (response *platformclientv2.APIResponse, err error) + +// idpGsuiteProxy contains all of the methods that call genesys cloud APIs. +type idpGsuiteProxy struct { + clientConfig *platformclientv2.Configuration + identityProviderApi *platformclientv2.IdentityProviderApi + getIdpGsuiteAttr getIdpGsuiteFunc + updateIdpGsuiteAttr updateIdpGsuiteFunc + deleteIdpGsuiteAttr deleteIdpGsuiteFunc +} + +// newIdpGsuiteProxy initializes the idp gsuite proxy with all of the data needed to communicate with Genesys Cloud +func newIdpGsuiteProxy(clientConfig *platformclientv2.Configuration) *idpGsuiteProxy { + api := platformclientv2.NewIdentityProviderApiWithConfig(clientConfig) + return &idpGsuiteProxy{ + clientConfig: clientConfig, + identityProviderApi: api, + getIdpGsuiteAttr: getIdpGsuiteFn, + updateIdpGsuiteAttr: updateIdpGsuiteFn, + deleteIdpGsuiteAttr: deleteIdpGsuiteFn, + } +} + +// getIdpGsuiteProxy acts as a singleton to for the internalProxy. It also ensures +// that we can still proxy our tests by directly setting internalProxy package variable +func getIdpGsuiteProxy(clientConfig *platformclientv2.Configuration) *idpGsuiteProxy { + if internalProxy == nil { + internalProxy = newIdpGsuiteProxy(clientConfig) + } + + return internalProxy +} + +// getIdpGsuite retrieves all Genesys Cloud idp gsuite +func (p *idpGsuiteProxy) getIdpGsuite(ctx context.Context) (*platformclientv2.Gsuite, *platformclientv2.APIResponse, error) { + return p.getIdpGsuiteAttr(ctx, p) +} + +// updateIdpGsuite updates a Genesys Cloud idp gsuite +func (p *idpGsuiteProxy) updateIdpGsuite(ctx context.Context, id string, idpGsuite *platformclientv2.Gsuite) (*platformclientv2.Identityprovider, *platformclientv2.APIResponse, error) { + return p.updateIdpGsuiteAttr(ctx, p, id, idpGsuite) +} + +// deleteIdpGsuite deletes a Genesys Cloud idp gsuite by Id +func (p *idpGsuiteProxy) deleteIdpGsuite(ctx context.Context, id string) (response *platformclientv2.APIResponse, err error) { + return p.deleteIdpGsuiteAttr(ctx, p, id) +} + +// getIdpGsuiteFn is the implementation for retrieving all idp gsuite in Genesys Cloud +func getIdpGsuiteFn(ctx context.Context, p *idpGsuiteProxy) (*platformclientv2.Gsuite, *platformclientv2.APIResponse, error) { + return p.identityProviderApi.GetIdentityprovidersGsuite() +} + +// updateIdpGsuiteFn is an implementation of the function to update a Genesys Cloud idp gsuite +func updateIdpGsuiteFn(ctx context.Context, p *idpGsuiteProxy, id string, idpGsuite *platformclientv2.Gsuite) (*platformclientv2.Identityprovider, *platformclientv2.APIResponse, error) { + return p.identityProviderApi.PutIdentityprovidersGsuite(*idpGsuite) +} + +// deleteIdpGsuiteFn is an implementation function for deleting a Genesys Cloud idp gsuite +func deleteIdpGsuiteFn(ctx context.Context, p *idpGsuiteProxy, id string) (response *platformclientv2.APIResponse, err error) { + _, resp, err := p.identityProviderApi.DeleteIdentityprovidersGsuite() + if err != nil { + return resp, fmt.Errorf("Failed to delete idp gsuite: %s", err) + } + + return resp, err +} diff --git a/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite.go b/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite.go new file mode 100644 index 000000000..1b4128fbf --- /dev/null +++ b/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite.go @@ -0,0 +1,156 @@ +package idp_gsuite + +import ( + "context" + "fmt" + "log" + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + "terraform-provider-genesyscloud/genesyscloud/util" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + + "terraform-provider-genesyscloud/genesyscloud/consistency_checker" + + "terraform-provider-genesyscloud/genesyscloud/util/constants" + "terraform-provider-genesyscloud/genesyscloud/util/lists" + "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" +) + +/* +The resource_genesyscloud_idp_gsuite.go contains all of the methods that perform the core logic for a resource. +*/ + +// getAllAuthIdpGsuite retrieves all of the idp gsuite via Terraform in the Genesys Cloud and is used for the exporter +func getAllAuthIdpGsuites(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { + proxy := getIdpGsuiteProxy(clientConfig) + resources := make(resourceExporter.ResourceIDMetaMap) + + _, resp, err := proxy.getIdpGsuite(ctx) + if err != nil { + if util.IsStatus404(resp) { + // Don't export if config doesn't exist + return resources, nil + } + return nil, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to get IDP GSuite error: %s", err), resp) + } + + resources["0"] = &resourceExporter.ResourceMeta{Name: "gsuite"} + return resources, nil +} + +// createIdpGsuite is used by the idp_gsuite resource to create Genesys cloud idp gsuite +func createIdpGsuite(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + log.Printf("Creating IDP GSuite") + d.SetId("gsuite") + return updateIdpGsuite(ctx, d, meta) +} + +// readIdpGsuite is used by the idp_gsuite resource to read an idp gsuite from genesys cloud +func readIdpGsuite(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getIdpGsuiteProxy(sdkConfig) + + log.Printf("Reading idp gsuite") + + cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceIdpGsuite(), constants.DefaultConsistencyChecks, resourceName) + + return util.WithRetriesForReadCustomTimeout(ctx, d.Timeout(schema.TimeoutRead), d, func() *retry.RetryError { + gSuite, resp, getErr := proxy.getIdpGsuite(ctx) + if getErr != nil { + if util.IsStatus404(resp) { + createIdpGsuite(ctx, d, meta) + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read IDP GSuite: %s", getErr), resp)) + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read IDP GSuite: %s", getErr), resp)) + } + + resourcedata.SetNillableValue(d, "name", gSuite.Name) + resourcedata.SetNillableValue(d, "disabled", gSuite.Disabled) + resourcedata.SetNillableValue(d, "issuer_uri", gSuite.IssuerURI) + resourcedata.SetNillableValue(d, "target_uri", gSuite.SsoTargetURI) + resourcedata.SetNillableValue(d, "relying_party_identifier", gSuite.RelyingPartyIdentifier) + resourcedata.SetNillableValue(d, "slo_uri", gSuite.SloURI) + resourcedata.SetNillableValue(d, "slo_binding", gSuite.SloBinding) + + if gSuite.Certificate != nil { + d.Set("certificates", lists.StringListToInterfaceList([]string{*gSuite.Certificate})) + } else if gSuite.Certificates != nil { + d.Set("certificates", lists.StringListToInterfaceList(*gSuite.Certificates)) + } else { + d.Set("certificates", nil) + } + + log.Printf("Read idp gsuite") + return cc.CheckState(d) + }) +} + +// updateIdpGsuite is used by the idp_gsuite resource to update an idp gsuite in Genesys Cloud +func updateIdpGsuite(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getIdpGsuiteProxy(sdkConfig) + + idpGsuite := getIdpGsuiteFromResourceData(d) + + log.Printf("Updating idp gsuite") + + certificates := lists.BuildSdkStringListFromInterfaceArray(d, "certificates") + if certificates != nil { + if len(*certificates) == 1 { + idpGsuite.Certificate = &(*certificates)[0] + } + idpGsuite.Certificates = certificates + } + + _, resp, err := proxy.updateIdpGsuite(ctx, d.Id(), &idpGsuite) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to update IDP GSuite %s error: %s", d.Id(), err), resp) + } + + log.Printf("Updated idp gsuite") + return readIdpGsuite(ctx, d, meta) +} + +// deleteIdpGsuite is used by the idp_gsuite resource to delete an idp gsuite from Genesys cloud +func deleteIdpGsuite(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getIdpGsuiteProxy(sdkConfig) + + resp, err := proxy.deleteIdpGsuite(ctx, d.Id()) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to delete IDP GSuite %s error: %s", d.Id(), err), resp) + } + + return util.WithRetries(ctx, 60*time.Second, func() *retry.RetryError { + _, resp, err := proxy.getIdpGsuite(ctx) + + if err != nil { + if util.IsStatus404(resp) { + // IDP GSuite deleted + log.Printf("Deleted IDP GSuite") + return nil + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Error deleting IDP GSuite: %s", err), resp)) + } + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("IDP GSuite still exists"), resp)) + }) +} + +// getIdpGsuiteFromResourceData maps data from schema ResourceData object to a platformclientv2.Gsuite +func getIdpGsuiteFromResourceData(d *schema.ResourceData) platformclientv2.Gsuite { + return platformclientv2.Gsuite{ + Name: platformclientv2.String(d.Get("name").(string)), + Disabled: platformclientv2.Bool(d.Get("disabled").(bool)), + IssuerURI: platformclientv2.String(d.Get("issuer_uri").(string)), + SsoTargetURI: platformclientv2.String(d.Get("target_uri").(string)), + RelyingPartyIdentifier: platformclientv2.String(d.Get("relying_party_identifier").(string)), + SloURI: platformclientv2.String(d.Get("slo_uri").(string)), + SloBinding: platformclientv2.String(d.Get("slo_binding").(string)), + } +} diff --git a/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_init_test.go b/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_init_test.go new file mode 100644 index 000000000..bde036306 --- /dev/null +++ b/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_init_test.go @@ -0,0 +1,46 @@ +package idp_gsuite + +import ( + "sync" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +/* + The genesyscloud_idp_gsuite_init_test.go file is used to initialize the resources + used in testing the idp_gsuite resource. +*/ + +// providerResources holds a map of all registered resources +var providerResources map[string]*schema.Resource + +type registerTestInstance struct { + resourceMapMutex sync.RWMutex +} + +// registerTestResources registers all resources used in the tests +func (r *registerTestInstance) registerTestResources() { + r.resourceMapMutex.Lock() + defer r.resourceMapMutex.Unlock() + + providerResources[resourceName] = ResourceIdpGsuite() +} + +// initTestResources initializes all test_data resources. +func initTestResources() { + providerResources = make(map[string]*schema.Resource) + + regInstance := ®isterTestInstance{} + + regInstance.registerTestResources() +} + +// TestMain is a "setup" function called by the testing framework when run the test_data +func TestMain(m *testing.M) { + // Run setup function before starting the test_data suite for the idp_gsuite package + initTestResources() + + // Run the test_data suite for the idp_gsuite package + m.Run() +} diff --git a/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_schema.go b/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_schema.go new file mode 100644 index 000000000..ee79a6385 --- /dev/null +++ b/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_schema.go @@ -0,0 +1,103 @@ +package idp_gsuite + +import ( + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" +) + +/* +resource_genesycloud_idp_gsuite_schema.go holds four functions within it: + +1. The registration code that registers the Datasource, Resource and Exporter for the package. +2. The resource schema definitions for the idp_gsuite resource. +3. The datasource schema definitions for the idp_gsuite datasource. +4. The resource exporter configuration for the idp_gsuite exporter. +*/ +const resourceName = "genesyscloud_idp_gsuite" + +// SetRegistrar registers all of the resources, datasources and exporters in the package +func SetRegistrar(regInstance registrar.Registrar) { + regInstance.RegisterResource(resourceName, ResourceIdpGsuite()) + regInstance.RegisterExporter(resourceName, IdpGsuiteExporter()) +} + +// ResourceIdpGsuite registers the genesyscloud_idp_gsuite resource with Terraform +func ResourceIdpGsuite() *schema.Resource { + return &schema.Resource{ + Description: `Genesys Cloud Single Sign-on GSuite Identity Provider. See this page for detailed configuration instructions: https://help.mypurecloud.com/articles/add-google-g-suite-single-sign-provider/`, + + CreateContext: provider.CreateWithPooledClient(createIdpGsuite), + ReadContext: provider.ReadWithPooledClient(readIdpGsuite), + UpdateContext: provider.UpdateWithPooledClient(updateIdpGsuite), + DeleteContext: provider.DeleteWithPooledClient(deleteIdpGsuite), + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + SchemaVersion: 1, + Timeouts: &schema.ResourceTimeout{ + Update: schema.DefaultTimeout(8 * time.Minute), + Read: schema.DefaultTimeout(8 * time.Minute), + }, + Schema: map[string]*schema.Schema{ + `name`: { + Description: `Name of the provider.`, + Optional: true, + Type: schema.TypeString, + }, + `disabled`: { + Description: `True if GSuite is disabled.`, + Optional: true, + Type: schema.TypeBool, + Default: false, + }, + `issuer_uri`: { + Description: `Issuer URI provided by GSuite.`, + Required: true, + Type: schema.TypeString, + }, + `target_uri`: { + Description: `Target URI provided by GSuite.`, + Optional: true, + Type: schema.TypeString, + }, + `slo_uri`: { + Description: `Provided by Okta on app creation.`, + Optional: true, + Type: schema.TypeString, + }, + `slo_binding`: { + Description: `Valid values: HTTP Redirect, HTTP Post`, + Optional: true, + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice([]string{`HTTP Redirect`, `HTTP Post`}, false), + }, + `relying_party_identifier`: { + Description: `String used to identify Genesys Cloud to GSuite.`, + Optional: true, + Type: schema.TypeString, + }, + `certificates`: { + Description: `PEM or DER encoded public X.509 certificates for SAML signature validation.`, + Required: true, + Type: schema.TypeList, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + }, + } +} + +// IdpGsuiteExporter returns the resourceExporter object used to hold the genesyscloud_idp_gsuite exporter's config +func IdpGsuiteExporter() *resourceExporter.ResourceExporter { + return &resourceExporter.ResourceExporter{ + GetResourcesFunc: provider.GetAllWithPooledClient(getAllAuthIdpGsuites), + RefAttrs: map[string]*resourceExporter.RefAttrSettings{ + // TODO: Add any reference attributes here + }, + } +} diff --git a/genesyscloud/resource_genesyscloud_idp_gsuite_test.go b/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_test.go similarity index 75% rename from genesyscloud/resource_genesyscloud_idp_gsuite_test.go rename to genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_test.go index 38e02fab6..d62c45dbf 100644 --- a/genesyscloud/resource_genesyscloud_idp_gsuite_test.go +++ b/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_test.go @@ -1,4 +1,4 @@ -package genesyscloud +package idp_gsuite import ( "fmt" @@ -7,6 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "testing" + "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" @@ -14,96 +15,128 @@ import ( func TestAccResourceIdpGsuite(t *testing.T) { var ( + name1 = "Test gsuite " + uuid.NewString() uri1 = "https://test.com/1" uri2 = "https://test.com/2" relyingPartyID1 = "test-id1" relyingPartyID2 = "test-id2" + uri3 = "https://example.com" + slo_binding1 = "HTTP Redirect" + slo_binding2 = "HTTP Post" ) resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) }, - ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + ProviderFactories: provider.GetProviderFactories(providerResources, nil), Steps: []resource.TestStep{ { // Create Config: generateIdpGsuiteResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1)), uri1, uri2, util.NullValue, // No relying party ID util.NullValue, // Not disabled + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "name", name1), util.ValidateStringInArray("genesyscloud_idp_gsuite.gsuite", "certificates", util.TestCert1), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "issuer_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "target_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "relying_party_identifier", ""), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "slo_binding", slo_binding1), ), }, { // Update with new values Config: generateIdpGsuiteResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert2)), uri2, uri1, strconv.Quote(relyingPartyID1), util.TrueValue, // disabled + uri3, + slo_binding2, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "name", name1), util.ValidateStringInArray("genesyscloud_idp_gsuite.gsuite", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "relying_party_identifier", relyingPartyID1), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "disabled", util.TrueValue), + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "slo_binding", slo_binding2), ), }, { // Update with multiple certs Config: generateIdpGsuiteResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1), strconv.Quote(util.TestCert2)), uri2, uri1, strconv.Quote(relyingPartyID2), util.FalseValue, // disabled + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "name", name1), util.ValidateStringInArray("genesyscloud_idp_gsuite.gsuite", "certificates", util.TestCert1), util.ValidateStringInArray("genesyscloud_idp_gsuite.gsuite", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "relying_party_identifier", relyingPartyID2), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "slo_binding", slo_binding1), ), }, { // Update to one cert in array Config: generateIdpGsuiteResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1)), uri2, uri1, strconv.Quote(relyingPartyID2), util.FalseValue, // disabled + uri3, + slo_binding2, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "name", name1), util.ValidateStringInArray("genesyscloud_idp_gsuite.gsuite", "certificates", util.TestCert1), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "certificates.#", "1"), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "relying_party_identifier", relyingPartyID2), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "slo_binding", slo_binding2), ), }, { // Update back to two certs in array Config: generateIdpGsuiteResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1), strconv.Quote(util.TestCert2)), uri2, uri1, strconv.Quote(relyingPartyID2), util.FalseValue, // disabled + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "name", name1), util.ValidateStringInArray("genesyscloud_idp_gsuite.gsuite", "certificates", util.TestCert1), util.ValidateStringInArray("genesyscloud_idp_gsuite.gsuite", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "certificates.#", "2"), @@ -111,6 +144,8 @@ func TestAccResourceIdpGsuite(t *testing.T) { resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "relying_party_identifier", relyingPartyID2), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "slo_binding", slo_binding1), ), }, { @@ -125,19 +160,25 @@ func TestAccResourceIdpGsuite(t *testing.T) { } func generateIdpGsuiteResource( + name string, certs string, issuerURI string, targetURI string, partyID string, - disabled string) string { + disabled string, + sloURI string, + sloBinding string) string { return fmt.Sprintf(`resource "genesyscloud_idp_gsuite" "gsuite" { + name = "%s" certificates = %s issuer_uri = "%s" target_uri = "%s" relying_party_identifier = %s disabled = %s + slo_uri = "%s" + slo_binding = "%s" } - `, certs, issuerURI, targetURI, partyID, disabled) + `, name, certs, issuerURI, targetURI, partyID, disabled, sloURI, sloBinding) } func testVerifyIdpGsuiteDestroyed(state *terraform.State) error { diff --git a/genesyscloud/resource_genesyscloud_idp_gsuite.go b/genesyscloud/resource_genesyscloud_idp_gsuite.go deleted file mode 100644 index 75a412cdc..000000000 --- a/genesyscloud/resource_genesyscloud_idp_gsuite.go +++ /dev/null @@ -1,212 +0,0 @@ -package genesyscloud - -import ( - "context" - "fmt" - "log" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" - "terraform-provider-genesyscloud/genesyscloud/util/constants" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - - "terraform-provider-genesyscloud/genesyscloud/consistency_checker" - - resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" - lists "terraform-provider-genesyscloud/genesyscloud/util/lists" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" -) - -func getAllIdpGsuite(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(clientConfig) - resources := make(resourceExporter.ResourceIDMetaMap) - - _, resp, getErr := idpAPI.GetIdentityprovidersGsuite() - if getErr != nil { - if util.IsStatus404(resp) { - // Don't export if config doesn't exist - return resources, nil - } - return nil, util.BuildAPIDiagnosticError("genesyscloud_idp_gsuite", fmt.Sprintf("Failed to get IDP GSuite error: %s", getErr), resp) - } - - resources["0"] = &resourceExporter.ResourceMeta{Name: "gsuite"} - return resources, nil -} - -func IdpGsuiteExporter() *resourceExporter.ResourceExporter { - return &resourceExporter.ResourceExporter{ - GetResourcesFunc: provider.GetAllWithPooledClient(getAllIdpGsuite), - RefAttrs: map[string]*resourceExporter.RefAttrSettings{}, // No references - } -} - -func ResourceIdpGsuite() *schema.Resource { - return &schema.Resource{ - Description: "Genesys Cloud Single Sign-on GSuite Identity Provider. See this page for detailed configuration instructions: https://help.mypurecloud.com/articles/add-google-g-suite-single-sign-provider/", - - CreateContext: provider.CreateWithPooledClient(createIdpGsuite), - ReadContext: provider.ReadWithPooledClient(readIdpGsuite), - UpdateContext: provider.UpdateWithPooledClient(updateIdpGsuite), - DeleteContext: provider.DeleteWithPooledClient(deleteIdpGsuite), - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - SchemaVersion: 1, - Timeouts: &schema.ResourceTimeout{ - Update: schema.DefaultTimeout(8 * time.Minute), - Read: schema.DefaultTimeout(8 * time.Minute), - }, - Schema: map[string]*schema.Schema{ - "certificates": { - Description: "PEM or DER encoded public X.509 certificates for SAML signature validation.", - Type: schema.TypeList, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "issuer_uri": { - Description: "Issuer URI provided by GSuite.", - Type: schema.TypeString, - Required: true, - }, - "target_uri": { - Description: "Target URI provided by GSuite.", - Type: schema.TypeString, - Optional: true, - }, - "relying_party_identifier": { - Description: "String used to identify Genesys Cloud to GSuite.", - Type: schema.TypeString, - Optional: true, - }, - "disabled": { - Description: "True if GSuite is disabled.", - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - }, - } -} - -func createIdpGsuite(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - log.Printf("Creating IDP GSuite") - d.SetId("gsuite") - return updateIdpGsuite(ctx, d, meta) -} - -func readIdpGsuite(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(sdkConfig) - cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceIdpGsuite(), constants.DefaultConsistencyChecks, "genesyscloud_idp_gsuite") - - log.Printf("Reading IDP GSuite") - - return util.WithRetriesForReadCustomTimeout(ctx, d.Timeout(schema.TimeoutRead), d, func() *retry.RetryError { - gsuite, resp, getErr := idpAPI.GetIdentityprovidersGsuite() - if getErr != nil { - if util.IsStatus404(resp) { - createIdpGsuite(ctx, d, meta) - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_gsuite", fmt.Sprintf("Failed to read IDP GSuite: %s", getErr), resp)) - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_gsuite", fmt.Sprintf("Failed to read IDP GSuite: %s", getErr), resp)) - } - - if gsuite.Certificate != nil { - d.Set("certificates", lists.StringListToInterfaceList([]string{*gsuite.Certificate})) - } else if gsuite.Certificates != nil { - d.Set("certificates", lists.StringListToInterfaceList(*gsuite.Certificates)) - } else { - d.Set("certificates", nil) - } - - if gsuite.IssuerURI != nil { - d.Set("issuer_uri", *gsuite.IssuerURI) - } else { - d.Set("issuer_uri", nil) - } - - if gsuite.SsoTargetURI != nil { - d.Set("target_uri", *gsuite.SsoTargetURI) - } else { - d.Set("target_uri", nil) - } - - if gsuite.RelyingPartyIdentifier != nil { - d.Set("relying_party_identifier", *gsuite.RelyingPartyIdentifier) - } else { - d.Set("relying_party_identifier", nil) - } - - if gsuite.Disabled != nil { - d.Set("disabled", *gsuite.Disabled) - } else { - d.Set("disabled", nil) - } - - log.Printf("Read IDP GSuite") - return cc.CheckState(d) - }) -} - -func updateIdpGsuite(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - issuerUri := d.Get("issuer_uri").(string) - targetUri := d.Get("target_uri").(string) - relyingPartyID := d.Get("relying_party_identifier").(string) - disabled := d.Get("disabled").(bool) - - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(sdkConfig) - - log.Printf("Updating IDP GSuite") - update := platformclientv2.Gsuite{ - IssuerURI: &issuerUri, - SsoTargetURI: &targetUri, - RelyingPartyIdentifier: &relyingPartyID, - Disabled: &disabled, - } - - certificates := lists.BuildSdkStringListFromInterfaceArray(d, "certificates") - if certificates != nil { - if len(*certificates) == 1 { - update.Certificate = &(*certificates)[0] - } - update.Certificates = certificates - } - - _, resp, err := idpAPI.PutIdentityprovidersGsuite(update) - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_idp_gsuite", fmt.Sprintf("Failed to update IDP GSuite %s error: %s", d.Id(), err), resp) - } - - log.Printf("Updated IDP GSuite") - return readIdpGsuite(ctx, d, meta) -} - -func deleteIdpGsuite(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(sdkConfig) - - log.Printf("Deleting IDP GSuite") - _, resp, err := idpAPI.DeleteIdentityprovidersGsuite() - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_idp_gsuite", fmt.Sprintf("Failed to delete IDP GSuite %s error: %s", d.Id(), err), resp) - } - - return util.WithRetries(ctx, 60*time.Second, func() *retry.RetryError { - _, resp, err := idpAPI.GetIdentityprovidersGsuite() - if err != nil { - if util.IsStatus404(resp) { - // IDP GSuite deleted - log.Printf("Deleted IDP GSuite") - return nil - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_gsuite", fmt.Sprintf("Error deleting IDP GSuite: %s", err), resp)) - } - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_gsuite", fmt.Sprintf("IDP GSuite still exists"), resp)) - }) -} diff --git a/genesyscloud/resource_genesyscloud_init.go b/genesyscloud/resource_genesyscloud_init.go index d526a8439..feb4892f2 100644 --- a/genesyscloud/resource_genesyscloud_init.go +++ b/genesyscloud/resource_genesyscloud_init.go @@ -43,7 +43,6 @@ func registerResources(l registrar.Registrar) { l.RegisterResource("genesyscloud_location", ResourceLocation()) l.RegisterResource("genesyscloud_auth_division", ResourceAuthDivision()) l.RegisterResource("genesyscloud_idp_generic", ResourceIdpGeneric()) - l.RegisterResource("genesyscloud_idp_gsuite", ResourceIdpGsuite()) l.RegisterResource("genesyscloud_idp_onelogin", ResourceIdpOnelogin()) l.RegisterResource("genesyscloud_idp_ping", ResourceIdpPing()) l.RegisterResource("genesyscloud_journey_action_map", ResourceJourneyActionMap()) @@ -73,7 +72,6 @@ func registerResources(l registrar.Registrar) { func registerExporters(l registrar.Registrar) { l.RegisterExporter("genesyscloud_auth_division", AuthDivisionExporter()) l.RegisterExporter("genesyscloud_idp_generic", IdpGenericExporter()) - l.RegisterExporter("genesyscloud_idp_gsuite", IdpGsuiteExporter()) l.RegisterExporter("genesyscloud_idp_onelogin", IdpOneloginExporter()) l.RegisterExporter("genesyscloud_idp_ping", IdpPingExporter()) l.RegisterExporter("genesyscloud_journey_action_map", JourneyActionMapExporter()) diff --git a/genesyscloud/resource_genesyscloud_init_test.go b/genesyscloud/resource_genesyscloud_init_test.go index 79c141fed..993090991 100644 --- a/genesyscloud/resource_genesyscloud_init_test.go +++ b/genesyscloud/resource_genesyscloud_init_test.go @@ -42,7 +42,6 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_location"] = ResourceLocation() providerResources["genesyscloud_auth_division"] = ResourceAuthDivision() providerResources["genesyscloud_idp_generic"] = ResourceIdpGeneric() - providerResources["genesyscloud_idp_gsuite"] = ResourceIdpGsuite() providerResources["genesyscloud_idp_onelogin"] = ResourceIdpOnelogin() providerResources["genesyscloud_idp_ping"] = ResourceIdpPing() providerResources["genesyscloud_journey_action_map"] = ResourceJourneyActionMap() diff --git a/genesyscloud/tfexporter/tf_exporter_resource_test.go b/genesyscloud/tfexporter/tf_exporter_resource_test.go index e2bb97141..4cd5f1f68 100644 --- a/genesyscloud/tfexporter/tf_exporter_resource_test.go +++ b/genesyscloud/tfexporter/tf_exporter_resource_test.go @@ -24,6 +24,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/group" groupRoles "terraform-provider-genesyscloud/genesyscloud/group_roles" idpAdfs "terraform-provider-genesyscloud/genesyscloud/idp_adfs" + idpGsuite "terraform-provider-genesyscloud/genesyscloud/idp_gsuite" idpOkta "terraform-provider-genesyscloud/genesyscloud/idp_okta" idpSalesforce "terraform-provider-genesyscloud/genesyscloud/idp_salesforce" integration "terraform-provider-genesyscloud/genesyscloud/integration" @@ -122,7 +123,7 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_group_roles"] = groupRoles.ResourceGroupRoles() providerResources["genesyscloud_idp_adfs"] = idpAdfs.ResourceIdpAdfs() providerResources["genesyscloud_idp_generic"] = gcloud.ResourceIdpGeneric() - providerResources["genesyscloud_idp_gsuite"] = gcloud.ResourceIdpGsuite() + providerResources["genesyscloud_idp_gsuite"] = idpGsuite.ResourceIdpGsuite() providerResources["genesyscloud_idp_okta"] = idpOkta.ResourceIdpOkta() providerResources["genesyscloud_idp_onelogin"] = gcloud.ResourceIdpOnelogin() providerResources["genesyscloud_idp_ping"] = gcloud.ResourceIdpPing() @@ -222,7 +223,7 @@ func (r *registerTestInstance) registerTestExporters() { RegisterExporter("genesyscloud_group_roles", groupRoles.GroupRolesExporter()) RegisterExporter("genesyscloud_idp_adfs", idpAdfs.IdpAdfsExporter()) RegisterExporter("genesyscloud_idp_generic", gcloud.IdpGenericExporter()) - RegisterExporter("genesyscloud_idp_gsuite", gcloud.IdpGsuiteExporter()) + RegisterExporter("genesyscloud_idp_gsuite", idpGsuite.IdpGsuiteExporter()) RegisterExporter("genesyscloud_idp_okta", idpOkta.IdpOktaExporter()) RegisterExporter("genesyscloud_idp_onelogin", gcloud.IdpOneloginExporter()) RegisterExporter("genesyscloud_idp_ping", gcloud.IdpPingExporter()) diff --git a/main.go b/main.go index 01df3ea64..93008d596 100644 --- a/main.go +++ b/main.go @@ -24,6 +24,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/group" groupRoles "terraform-provider-genesyscloud/genesyscloud/group_roles" idpAdfs "terraform-provider-genesyscloud/genesyscloud/idp_adfs" + idpGsuite "terraform-provider-genesyscloud/genesyscloud/idp_gsuite" idpOkta "terraform-provider-genesyscloud/genesyscloud/idp_okta" idpSalesforce "terraform-provider-genesyscloud/genesyscloud/idp_salesforce" "terraform-provider-genesyscloud/genesyscloud/integration" @@ -191,6 +192,7 @@ func registerResources() { idpAdfs.SetRegistrar(regInstance) //Registering idp adfs idpSalesforce.SetRegistrar(regInstance) //Registering idp salesforce idpOkta.SetRegistrar(regInstance) //Registering idp okta + idpGsuite.SetRegistrar(regInstance) //Registering idp gsuite integration.SetRegistrar(regInstance) //Registering integrations integrationCustomAuth.SetRegistrar(regInstance) //Registering integrations custom auth actions integrationAction.SetRegistrar(regInstance) //Registering integrations actions From 525c6f8256a2ae54ce4503d94778fb161d5c9a50 Mon Sep 17 00:00:00 2001 From: shrutisuryawanshigenesys Date: Tue, 25 Jun 2024 09:48:05 -0400 Subject: [PATCH 28/62] Refactor/devtooling 160 idp_ping (#1102) * refactored idp_ping * updated docs * deleted unrefactored files * comments resolved * resolved conflicts * added name, slo_uri and slo_binding --- docs/resources/idp_ping.md | 3 + .../idp_ping/genesyscloud_idp_ping_proxy.go | 88 ++++++++ .../resource_genesyscloud_idp_ping.go | 155 +++++++++++++ ...esource_genesyscloud_idp_ping_init_test.go | 46 ++++ .../resource_genesyscloud_idp_ping_schema.go | 103 +++++++++ .../resource_genesyscloud_idp_ping_test.go | 49 +++- .../resource_genesyscloud_idp_ping.go | 212 ------------------ genesyscloud/resource_genesyscloud_init.go | 2 - .../resource_genesyscloud_init_test.go | 1 - .../tfexporter/tf_exporter_resource_test.go | 5 +- main.go | 2 + 11 files changed, 445 insertions(+), 221 deletions(-) create mode 100644 genesyscloud/idp_ping/genesyscloud_idp_ping_proxy.go create mode 100644 genesyscloud/idp_ping/resource_genesyscloud_idp_ping.go create mode 100644 genesyscloud/idp_ping/resource_genesyscloud_idp_ping_init_test.go create mode 100644 genesyscloud/idp_ping/resource_genesyscloud_idp_ping_schema.go rename genesyscloud/{ => idp_ping}/resource_genesyscloud_idp_ping_test.go (75%) delete mode 100644 genesyscloud/resource_genesyscloud_idp_ping.go diff --git a/docs/resources/idp_ping.md b/docs/resources/idp_ping.md index 61dc0d7f3..4fc5abe66 100644 --- a/docs/resources/idp_ping.md +++ b/docs/resources/idp_ping.md @@ -37,7 +37,10 @@ resource "genesyscloud_idp_ping" "ping" { ### Optional - `disabled` (Boolean) True if Ping is disabled. Defaults to `false`. +- `name` (String) Name of the provider - `relying_party_identifier` (String) String used to identify Genesys Cloud to Ping. +- `slo_binding` (String) Valid values: HTTP Redirect, HTTP Post +- `slo_uri` (String) Provided by Okta on app creation. - `target_uri` (String) Target URI provided by Ping. - `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) diff --git a/genesyscloud/idp_ping/genesyscloud_idp_ping_proxy.go b/genesyscloud/idp_ping/genesyscloud_idp_ping_proxy.go new file mode 100644 index 000000000..2fb2e6a55 --- /dev/null +++ b/genesyscloud/idp_ping/genesyscloud_idp_ping_proxy.go @@ -0,0 +1,88 @@ +package idp_ping + +import ( + "context" + "fmt" + + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" +) + +/* +The genesyscloud_idp_ping_proxy.go file contains the proxy structures and methods that interact +with the Genesys Cloud SDK. We use composition here for each function on the proxy so individual functions can be stubbed +out during testing. +*/ + +// internalProxy holds a proxy instance that can be used throughout the package +var internalProxy *idpPingProxy + +// Type definitions for each func on our proxy so we can easily mock them out later +type getIdpPingFunc func(ctx context.Context, p *idpPingProxy) (*platformclientv2.Pingidentity, *platformclientv2.APIResponse, error) +type updateIdpPingFunc func(ctx context.Context, p *idpPingProxy, id string, pingIdentity *platformclientv2.Pingidentity) (*platformclientv2.Identityprovider, *platformclientv2.APIResponse, error) +type deleteIdpPingFunc func(ctx context.Context, p *idpPingProxy, id string) (response *platformclientv2.APIResponse, err error) + +// idpPingProxy contains all of the methods that call genesys cloud APIs. +type idpPingProxy struct { + clientConfig *platformclientv2.Configuration + identityProviderApi *platformclientv2.IdentityProviderApi + getIdpPingAttr getIdpPingFunc + updateIdpPingAttr updateIdpPingFunc + deleteIdpPingAttr deleteIdpPingFunc +} + +// newIdpPingProxy initializes the idp ping proxy with all of the data needed to communicate with Genesys Cloud +func newIdpPingProxy(clientConfig *platformclientv2.Configuration) *idpPingProxy { + api := platformclientv2.NewIdentityProviderApiWithConfig(clientConfig) + return &idpPingProxy{ + clientConfig: clientConfig, + identityProviderApi: api, + getIdpPingAttr: getIdpPingFn, + updateIdpPingAttr: updateIdpPingFn, + deleteIdpPingAttr: deleteIdpPingFn, + } +} + +// getIdpPingProxy acts as a singleton to for the internalProxy. It also ensures +// that we can still proxy our tests by directly setting internalProxy package variable +func getIdpPingProxy(clientConfig *platformclientv2.Configuration) *idpPingProxy { + if internalProxy == nil { + internalProxy = newIdpPingProxy(clientConfig) + } + + return internalProxy +} + +// getIdpPing retrieves all Genesys Cloud idp ping +func (p *idpPingProxy) getIdpPing(ctx context.Context) (*platformclientv2.Pingidentity, *platformclientv2.APIResponse, error) { + return p.getIdpPingAttr(ctx, p) +} + +// updateIdpPing updates a Genesys Cloud idp ping +func (p *idpPingProxy) updateIdpPing(ctx context.Context, id string, idpPing *platformclientv2.Pingidentity) (*platformclientv2.Identityprovider, *platformclientv2.APIResponse, error) { + return p.updateIdpPingAttr(ctx, p, id, idpPing) +} + +// deleteIdpPing deletes a Genesys Cloud idp ping by Id +func (p *idpPingProxy) deleteIdpPing(ctx context.Context, id string) (response *platformclientv2.APIResponse, err error) { + return p.deleteIdpPingAttr(ctx, p, id) +} + +// getAllIdpPingFn is the implementation for retrieving all idp ping in Genesys Cloud +func getIdpPingFn(ctx context.Context, p *idpPingProxy) (*platformclientv2.Pingidentity, *platformclientv2.APIResponse, error) { + return p.identityProviderApi.GetIdentityprovidersPing() +} + +// updateIdpPingFn is an implementation of the function to update a Genesys Cloud idp ping +func updateIdpPingFn(ctx context.Context, p *idpPingProxy, id string, idpPing *platformclientv2.Pingidentity) (*platformclientv2.Identityprovider, *platformclientv2.APIResponse, error) { + return p.identityProviderApi.PutIdentityprovidersPing(*idpPing) +} + +// deleteIdpPingFn is an implementation function for deleting a Genesys Cloud idp ping +func deleteIdpPingFn(ctx context.Context, p *idpPingProxy, id string) (response *platformclientv2.APIResponse, err error) { + _, resp, err := p.identityProviderApi.DeleteIdentityprovidersPing() + if err != nil { + return resp, fmt.Errorf("Failed to delete idp ping: %s", err) + } + + return resp, err +} diff --git a/genesyscloud/idp_ping/resource_genesyscloud_idp_ping.go b/genesyscloud/idp_ping/resource_genesyscloud_idp_ping.go new file mode 100644 index 000000000..c6bc5cc6d --- /dev/null +++ b/genesyscloud/idp_ping/resource_genesyscloud_idp_ping.go @@ -0,0 +1,155 @@ +package idp_ping + +import ( + "context" + "fmt" + "log" + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + "terraform-provider-genesyscloud/genesyscloud/util" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + + "terraform-provider-genesyscloud/genesyscloud/consistency_checker" + + "terraform-provider-genesyscloud/genesyscloud/util/constants" + "terraform-provider-genesyscloud/genesyscloud/util/lists" + "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" +) + +/* +The resource_genesyscloud_idp_ping.go contains all of the methods that perform the core logic for a resource. +*/ + +// getAllAuthIdpPing retrieves all of the idp ping via Terraform in the Genesys Cloud and is used for the exporter +func getAllAuthIdpPings(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { + proxy := getIdpPingProxy(clientConfig) + resources := make(resourceExporter.ResourceIDMetaMap) + + _, resp, err := proxy.getIdpPing(ctx) + if err != nil { + if util.IsStatus404(resp) { + // Don't export if config doesn't exist + return resources, nil + } + return nil, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to get IDP Ping error: %s", err), resp) + } + + resources["0"] = &resourceExporter.ResourceMeta{Name: "ping"} + return resources, nil +} + +// createIdpPing is used by the idp_ping resource to create Genesys cloud idp ping +func createIdpPing(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + log.Printf("Creating IDP Ping") + d.SetId("ping") + return updateIdpPing(ctx, d, meta) +} + +// readIdpPing is used by the idp_ping resource to read an idp ping from genesys cloud +func readIdpPing(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getIdpPingProxy(sdkConfig) + + log.Printf("Reading idp ping") + + cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceIdpPing(), constants.DefaultConsistencyChecks, resourceName) + + return util.WithRetriesForReadCustomTimeout(ctx, d.Timeout(schema.TimeoutRead), d, func() *retry.RetryError { + pingIdentity, resp, getErr := proxy.getIdpPing(ctx) + if getErr != nil { + if util.IsStatus404(resp) { + createIdpPing(ctx, d, meta) + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read IDP Ping: %s", getErr), resp)) + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read IDP Ping: %s", getErr), resp)) + } + + resourcedata.SetNillableValue(d, "name", pingIdentity.Name) + resourcedata.SetNillableValue(d, "disabled", pingIdentity.Disabled) + resourcedata.SetNillableValue(d, "issuer_uri", pingIdentity.IssuerURI) + resourcedata.SetNillableValue(d, "target_uri", pingIdentity.SsoTargetURI) + resourcedata.SetNillableValue(d, "relying_party_identifier", pingIdentity.RelyingPartyIdentifier) + resourcedata.SetNillableValue(d, "slo_uri", pingIdentity.SloURI) + resourcedata.SetNillableValue(d, "slo_binding", pingIdentity.SloBinding) + + if pingIdentity.Certificate != nil { + d.Set("certificates", lists.StringListToInterfaceList([]string{*pingIdentity.Certificate})) + } else if pingIdentity.Certificates != nil { + d.Set("certificates", lists.StringListToInterfaceList(*pingIdentity.Certificates)) + } else { + d.Set("certificates", nil) + } + + log.Printf("Read idp ping") + return cc.CheckState(d) + }) +} + +// updateIdpPing is used by the idp_ping resource to update an idp ping in Genesys Cloud +func updateIdpPing(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getIdpPingProxy(sdkConfig) + + idpPing := getIdpPingFromResourceData(d) + + certificates := lists.BuildSdkStringListFromInterfaceArray(d, "certificates") + if certificates != nil { + if len(*certificates) == 1 { + idpPing.Certificate = &(*certificates)[0] + } + idpPing.Certificates = certificates + } + + log.Printf("Updating idp ping") + _, resp, err := proxy.updateIdpPing(ctx, d.Id(), &idpPing) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to update IDP Ping %s error: %s", d.Id(), err), resp) + } + + log.Printf("Updated idp ping") + return readIdpPing(ctx, d, meta) +} + +// deleteIdpPing is used by the idp_ping resource to delete an idp ping from Genesys cloud +func deleteIdpPing(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getIdpPingProxy(sdkConfig) + + resp, err := proxy.deleteIdpPing(ctx, d.Id()) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to delete IDP Ping %s error: %s", d.Id(), err), resp) + } + + return util.WithRetries(ctx, 60*time.Second, func() *retry.RetryError { + _, resp, err := proxy.getIdpPing(ctx) + + if err != nil { + if util.IsStatus404(resp) { + // IDP Ping deleted + log.Printf("Deleted IDP Ping") + return nil + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Error deleting IDP Ping: %s", err), resp)) + } + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("IDP Ping still exists"), resp)) + }) +} + +// getIdpPingFromResourceData maps data from schema ResourceData object to a platformclientv2.Pingidentity +func getIdpPingFromResourceData(d *schema.ResourceData) platformclientv2.Pingidentity { + return platformclientv2.Pingidentity{ + Name: platformclientv2.String(d.Get("name").(string)), + Disabled: platformclientv2.Bool(d.Get("disabled").(bool)), + IssuerURI: platformclientv2.String(d.Get("issuer_uri").(string)), + SsoTargetURI: platformclientv2.String(d.Get("target_uri").(string)), + RelyingPartyIdentifier: platformclientv2.String(d.Get("relying_party_identifier").(string)), + SloURI: platformclientv2.String(d.Get("slo_uri").(string)), + SloBinding: platformclientv2.String(d.Get("slo_binding").(string)), + } +} diff --git a/genesyscloud/idp_ping/resource_genesyscloud_idp_ping_init_test.go b/genesyscloud/idp_ping/resource_genesyscloud_idp_ping_init_test.go new file mode 100644 index 000000000..684a37221 --- /dev/null +++ b/genesyscloud/idp_ping/resource_genesyscloud_idp_ping_init_test.go @@ -0,0 +1,46 @@ +package idp_ping + +import ( + "sync" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +/* + The genesyscloud_idp_ping_init_test.go file is used to initialize the resources + used in testing the idp_ping resource. +*/ + +// providerResources holds a map of all registered resources +var providerResources map[string]*schema.Resource + +type registerTestInstance struct { + resourceMapMutex sync.RWMutex +} + +// registerTestResources registers all resources used in the tests +func (r *registerTestInstance) registerTestResources() { + r.resourceMapMutex.Lock() + defer r.resourceMapMutex.Unlock() + + providerResources[resourceName] = ResourceIdpPing() +} + +// initTestResources initializes all test_data resources. +func initTestResources() { + providerResources = make(map[string]*schema.Resource) + + regInstance := ®isterTestInstance{} + + regInstance.registerTestResources() +} + +// TestMain is a "setup" function called by the testing framework when run the test_data +func TestMain(m *testing.M) { + // Run setup function before starting the test_data suite for the idp_ping package + initTestResources() + + // Run the test_data suite for the idp_ping package + m.Run() +} diff --git a/genesyscloud/idp_ping/resource_genesyscloud_idp_ping_schema.go b/genesyscloud/idp_ping/resource_genesyscloud_idp_ping_schema.go new file mode 100644 index 000000000..fbf708089 --- /dev/null +++ b/genesyscloud/idp_ping/resource_genesyscloud_idp_ping_schema.go @@ -0,0 +1,103 @@ +package idp_ping + +import ( + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" +) + +/* +resource_genesycloud_idp_ping_schema.go holds four functions within it: + +1. The registration code that registers the Datasource, Resource and Exporter for the package. +2. The resource schema definitions for the idp_ping resource. +3. The datasource schema definitions for the idp_ping datasource. +4. The resource exporter configuration for the idp_ping exporter. +*/ +const resourceName = "genesyscloud_idp_ping" + +// SetRegistrar registers all of the resources, datasources and exporters in the package +func SetRegistrar(regInstance registrar.Registrar) { + regInstance.RegisterResource(resourceName, ResourceIdpPing()) + regInstance.RegisterExporter(resourceName, IdpPingExporter()) +} + +// ResourceIdpPing registers the genesyscloud_idp_ping resource with Terraform +func ResourceIdpPing() *schema.Resource { + return &schema.Resource{ + Description: `Genesys Cloud Single Sign-on Ping Identity Provider. See this page for detailed configuration instructions: https://help.mypurecloud.com/articles/add-ping-identity-single-sign-provider/`, + + CreateContext: provider.CreateWithPooledClient(createIdpPing), + ReadContext: provider.ReadWithPooledClient(readIdpPing), + UpdateContext: provider.UpdateWithPooledClient(updateIdpPing), + DeleteContext: provider.DeleteWithPooledClient(deleteIdpPing), + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + SchemaVersion: 1, + Timeouts: &schema.ResourceTimeout{ + Update: schema.DefaultTimeout(8 * time.Minute), + Read: schema.DefaultTimeout(8 * time.Minute), + }, + Schema: map[string]*schema.Schema{ + `name`: { + Description: `Name of the provider`, + Optional: true, + Type: schema.TypeString, + }, + `disabled`: { + Description: `True if Ping is disabled.`, + Optional: true, + Type: schema.TypeBool, + Default: false, + }, + `issuer_uri`: { + Description: `Issuer URI provided by Ping.`, + Required: true, + Type: schema.TypeString, + }, + `target_uri`: { + Description: `Target URI provided by Ping.`, + Optional: true, + Type: schema.TypeString, + }, + `slo_uri`: { + Description: `Provided by Okta on app creation.`, + Optional: true, + Type: schema.TypeString, + }, + `slo_binding`: { + Description: `Valid values: HTTP Redirect, HTTP Post`, + Optional: true, + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice([]string{`HTTP Redirect`, `HTTP Post`}, false), + }, + `relying_party_identifier`: { + Description: `String used to identify Genesys Cloud to Ping.`, + Optional: true, + Type: schema.TypeString, + }, + `certificates`: { + Description: `PEM or DER encoded public X.509 certificates for SAML signature validation.`, + Required: true, + Type: schema.TypeList, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + }, + } +} + +// IdpPingExporter returns the resourceExporter object used to hold the genesyscloud_idp_ping exporter's config +func IdpPingExporter() *resourceExporter.ResourceExporter { + return &resourceExporter.ResourceExporter{ + GetResourcesFunc: provider.GetAllWithPooledClient(getAllAuthIdpPings), + RefAttrs: map[string]*resourceExporter.RefAttrSettings{ + // TODO: Add any reference attributes here + }, + } +} diff --git a/genesyscloud/resource_genesyscloud_idp_ping_test.go b/genesyscloud/idp_ping/resource_genesyscloud_idp_ping_test.go similarity index 75% rename from genesyscloud/resource_genesyscloud_idp_ping_test.go rename to genesyscloud/idp_ping/resource_genesyscloud_idp_ping_test.go index 1211c8230..1a56474ca 100644 --- a/genesyscloud/resource_genesyscloud_idp_ping_test.go +++ b/genesyscloud/idp_ping/resource_genesyscloud_idp_ping_test.go @@ -1,4 +1,4 @@ -package genesyscloud +package idp_ping import ( "fmt" @@ -7,6 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "testing" + "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" @@ -14,96 +15,128 @@ import ( func TestAccResourceIdpPing(t *testing.T) { var ( + name1 = "Test ping " + uuid.NewString() uri1 = "https://test.com/1" uri2 = "https://test.com/2" relyingPartyID1 = "test-id1" relyingPartyID2 = "test-id2" + uri3 = "https://example.com" + slo_binding1 = "HTTP Redirect" + slo_binding2 = "HTTP Post" ) resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) }, - ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + ProviderFactories: provider.GetProviderFactories(providerResources, nil), Steps: []resource.TestStep{ { // Create Config: generateIdpPingResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1)), uri1, uri2, util.NullValue, // No relying party ID util.NullValue, // Not disabled + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "name", name1), util.ValidateStringInArray("genesyscloud_idp_ping.ping", "certificates", util.TestCert1), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "issuer_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "target_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "relying_party_identifier", ""), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "slo_binding", slo_binding1), ), }, { // Update with new values Config: generateIdpPingResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert2)), uri2, uri1, strconv.Quote(relyingPartyID1), util.TrueValue, // disabled + uri3, + slo_binding2, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "name", name1), util.ValidateStringInArray("genesyscloud_idp_ping.ping", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "relying_party_identifier", relyingPartyID1), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "disabled", util.TrueValue), + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "slo_binding", slo_binding2), ), }, { // Update with multiple certs Config: generateIdpPingResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1), strconv.Quote(util.TestCert2)), uri2, uri1, strconv.Quote(relyingPartyID2), util.FalseValue, // disabled + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "name", name1), util.ValidateStringInArray("genesyscloud_idp_ping.ping", "certificates", util.TestCert1), util.ValidateStringInArray("genesyscloud_idp_ping.ping", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "relying_party_identifier", relyingPartyID2), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "slo_binding", slo_binding1), ), }, { // Update to one cert in array Config: generateIdpPingResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1)), uri2, uri1, strconv.Quote(relyingPartyID2), util.FalseValue, // disabled + uri3, + slo_binding2, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "name", name1), util.ValidateStringInArray("genesyscloud_idp_ping.ping", "certificates", util.TestCert1), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "certificates.#", "1"), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "relying_party_identifier", relyingPartyID2), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "slo_binding", slo_binding2), ), }, { // Update back to two certs Config: generateIdpPingResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1), strconv.Quote(util.TestCert2)), uri2, uri1, strconv.Quote(relyingPartyID2), util.FalseValue, // disabled + uri3, + slo_binding2, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "name", name1), util.ValidateStringInArray("genesyscloud_idp_ping.ping", "certificates", util.TestCert1), util.ValidateStringInArray("genesyscloud_idp_ping.ping", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "certificates.#", "2"), @@ -111,6 +144,8 @@ func TestAccResourceIdpPing(t *testing.T) { resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "relying_party_identifier", relyingPartyID2), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "slo_binding", slo_binding2), ), }, { @@ -125,19 +160,25 @@ func TestAccResourceIdpPing(t *testing.T) { } func generateIdpPingResource( + name string, certs string, issuerURI string, targetURI string, partyID string, - disabled string) string { + disabled string, + sloURI string, + sloBinding string) string { return fmt.Sprintf(`resource "genesyscloud_idp_ping" "ping" { + name = "%s" certificates = %s issuer_uri = "%s" target_uri = "%s" relying_party_identifier = %s disabled = %s + slo_uri = "%s" + slo_binding = "%s" } - `, certs, issuerURI, targetURI, partyID, disabled) + `, name, certs, issuerURI, targetURI, partyID, disabled, sloURI, sloBinding) } func testVerifyIdpPingDestroyed(state *terraform.State) error { diff --git a/genesyscloud/resource_genesyscloud_idp_ping.go b/genesyscloud/resource_genesyscloud_idp_ping.go deleted file mode 100644 index 5be98daf0..000000000 --- a/genesyscloud/resource_genesyscloud_idp_ping.go +++ /dev/null @@ -1,212 +0,0 @@ -package genesyscloud - -import ( - "context" - "fmt" - "log" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" - "terraform-provider-genesyscloud/genesyscloud/util/constants" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - - "terraform-provider-genesyscloud/genesyscloud/consistency_checker" - - resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" - lists "terraform-provider-genesyscloud/genesyscloud/util/lists" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" -) - -func getAllIdpPing(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(clientConfig) - resources := make(resourceExporter.ResourceIDMetaMap) - - _, resp, getErr := idpAPI.GetIdentityprovidersPing() - if getErr != nil { - if util.IsStatus404(resp) { - // Don't export if config doesn't exist - return resources, nil - } - return nil, util.BuildAPIDiagnosticError("genesyscloud_idp_ping", fmt.Sprintf("Failed to get IDP Ping error: %s", getErr), resp) - } - - resources["0"] = &resourceExporter.ResourceMeta{Name: "ping"} - return resources, nil -} - -func IdpPingExporter() *resourceExporter.ResourceExporter { - return &resourceExporter.ResourceExporter{ - GetResourcesFunc: provider.GetAllWithPooledClient(getAllIdpPing), - RefAttrs: map[string]*resourceExporter.RefAttrSettings{}, // No references - } -} - -func ResourceIdpPing() *schema.Resource { - return &schema.Resource{ - Description: "Genesys Cloud Single Sign-on Ping Identity Provider. See this page for detailed configuration instructions: https://help.mypurecloud.com/articles/add-ping-identity-single-sign-provider/", - - CreateContext: provider.CreateWithPooledClient(createIdpPing), - ReadContext: provider.ReadWithPooledClient(readIdpPing), - UpdateContext: provider.UpdateWithPooledClient(updateIdpPing), - DeleteContext: provider.DeleteWithPooledClient(deleteIdpPing), - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - SchemaVersion: 1, - Timeouts: &schema.ResourceTimeout{ - Update: schema.DefaultTimeout(8 * time.Minute), - Read: schema.DefaultTimeout(8 * time.Minute), - }, - Schema: map[string]*schema.Schema{ - "certificates": { - Description: "PEM or DER encoded public X.509 certificates for SAML signature validation.", - Type: schema.TypeList, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "issuer_uri": { - Description: "Issuer URI provided by Ping.", - Type: schema.TypeString, - Required: true, - }, - "target_uri": { - Description: "Target URI provided by Ping.", - Type: schema.TypeString, - Optional: true, - }, - "relying_party_identifier": { - Description: "String used to identify Genesys Cloud to Ping.", - Type: schema.TypeString, - Optional: true, - }, - "disabled": { - Description: "True if Ping is disabled.", - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - }, - } -} - -func createIdpPing(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - log.Printf("Creating IDP Ping") - d.SetId("ping") - return updateIdpPing(ctx, d, meta) -} - -func readIdpPing(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(sdkConfig) - cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceIdpPing(), constants.DefaultConsistencyChecks, "genesyscloud_idp_ping") - - log.Printf("Reading IDP Ping") - - return util.WithRetriesForReadCustomTimeout(ctx, d.Timeout(schema.TimeoutRead), d, func() *retry.RetryError { - ping, resp, getErr := idpAPI.GetIdentityprovidersPing() - if getErr != nil { - if util.IsStatus404(resp) { - createIdpPing(ctx, d, meta) - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_ping", fmt.Sprintf("Failed to read IDP Ping: %s", getErr), resp)) - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_ping", fmt.Sprintf("Failed to read IDP Ping: %s", getErr), resp)) - } - - if ping.Certificate != nil { - d.Set("certificates", lists.StringListToInterfaceList([]string{*ping.Certificate})) - } else if ping.Certificates != nil { - d.Set("certificates", lists.StringListToInterfaceList(*ping.Certificates)) - } else { - d.Set("certificates", nil) - } - - if ping.IssuerURI != nil { - d.Set("issuer_uri", *ping.IssuerURI) - } else { - d.Set("issuer_uri", nil) - } - - if ping.SsoTargetURI != nil { - d.Set("target_uri", *ping.SsoTargetURI) - } else { - d.Set("target_uri", nil) - } - - if ping.RelyingPartyIdentifier != nil { - d.Set("relying_party_identifier", *ping.RelyingPartyIdentifier) - } else { - d.Set("relying_party_identifier", nil) - } - - if ping.Disabled != nil { - d.Set("disabled", *ping.Disabled) - } else { - d.Set("disabled", nil) - } - - log.Printf("Read IDP Ping") - return cc.CheckState(d) - }) -} - -func updateIdpPing(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - issuerUri := d.Get("issuer_uri").(string) - targetUri := d.Get("target_uri").(string) - relyingPartyID := d.Get("relying_party_identifier").(string) - disabled := d.Get("disabled").(bool) - - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(sdkConfig) - - log.Printf("Updating IDP Ping") - update := platformclientv2.Pingidentity{ - IssuerURI: &issuerUri, - SsoTargetURI: &targetUri, - RelyingPartyIdentifier: &relyingPartyID, - Disabled: &disabled, - } - - certificates := lists.BuildSdkStringListFromInterfaceArray(d, "certificates") - if certificates != nil { - if len(*certificates) == 1 { - update.Certificate = &(*certificates)[0] - } - update.Certificates = certificates - } - - _, resp, err := idpAPI.PutIdentityprovidersPing(update) - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_idp_ping", fmt.Sprintf("Failed to update IDP Ping %s error: %s", d.Id(), err), resp) - } - - log.Printf("Updated IDP Ping") - return readIdpPing(ctx, d, meta) -} - -func deleteIdpPing(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(sdkConfig) - - log.Printf("Deleting IDP Ping") - _, resp, err := idpAPI.DeleteIdentityprovidersPing() - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_idp_ping", fmt.Sprintf("Failed to delete IDP Ping %s error: %s", d.Id(), err), resp) - } - - return util.WithRetries(ctx, 60*time.Second, func() *retry.RetryError { - _, resp, err := idpAPI.GetIdentityprovidersPing() - if err != nil { - if util.IsStatus404(resp) { - // IDP Ping deleted - log.Printf("Deleted IDP Ping") - return nil - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_ping", fmt.Sprintf("Error deleting IDP Ping: %s", err), resp)) - } - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_ping", fmt.Sprintf("IDP Ping still exists"), resp)) - }) -} diff --git a/genesyscloud/resource_genesyscloud_init.go b/genesyscloud/resource_genesyscloud_init.go index feb4892f2..2a974c295 100644 --- a/genesyscloud/resource_genesyscloud_init.go +++ b/genesyscloud/resource_genesyscloud_init.go @@ -44,7 +44,6 @@ func registerResources(l registrar.Registrar) { l.RegisterResource("genesyscloud_auth_division", ResourceAuthDivision()) l.RegisterResource("genesyscloud_idp_generic", ResourceIdpGeneric()) l.RegisterResource("genesyscloud_idp_onelogin", ResourceIdpOnelogin()) - l.RegisterResource("genesyscloud_idp_ping", ResourceIdpPing()) l.RegisterResource("genesyscloud_journey_action_map", ResourceJourneyActionMap()) l.RegisterResource("genesyscloud_journey_action_template", ResourceJourneyActionTemplate()) l.RegisterResource("genesyscloud_journey_outcome", ResourceJourneyOutcome()) @@ -73,7 +72,6 @@ func registerExporters(l registrar.Registrar) { l.RegisterExporter("genesyscloud_auth_division", AuthDivisionExporter()) l.RegisterExporter("genesyscloud_idp_generic", IdpGenericExporter()) l.RegisterExporter("genesyscloud_idp_onelogin", IdpOneloginExporter()) - l.RegisterExporter("genesyscloud_idp_ping", IdpPingExporter()) l.RegisterExporter("genesyscloud_journey_action_map", JourneyActionMapExporter()) l.RegisterExporter("genesyscloud_journey_action_template", JourneyActionTemplateExporter()) l.RegisterExporter("genesyscloud_journey_outcome", JourneyOutcomeExporter()) diff --git a/genesyscloud/resource_genesyscloud_init_test.go b/genesyscloud/resource_genesyscloud_init_test.go index 993090991..8fa334519 100644 --- a/genesyscloud/resource_genesyscloud_init_test.go +++ b/genesyscloud/resource_genesyscloud_init_test.go @@ -43,7 +43,6 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_auth_division"] = ResourceAuthDivision() providerResources["genesyscloud_idp_generic"] = ResourceIdpGeneric() providerResources["genesyscloud_idp_onelogin"] = ResourceIdpOnelogin() - providerResources["genesyscloud_idp_ping"] = ResourceIdpPing() providerResources["genesyscloud_journey_action_map"] = ResourceJourneyActionMap() providerResources["genesyscloud_journey_action_template"] = ResourceJourneyActionTemplate() providerResources["genesyscloud_journey_outcome"] = ResourceJourneyOutcome() diff --git a/genesyscloud/tfexporter/tf_exporter_resource_test.go b/genesyscloud/tfexporter/tf_exporter_resource_test.go index 4cd5f1f68..82a6ef7de 100644 --- a/genesyscloud/tfexporter/tf_exporter_resource_test.go +++ b/genesyscloud/tfexporter/tf_exporter_resource_test.go @@ -26,6 +26,7 @@ import ( idpAdfs "terraform-provider-genesyscloud/genesyscloud/idp_adfs" idpGsuite "terraform-provider-genesyscloud/genesyscloud/idp_gsuite" idpOkta "terraform-provider-genesyscloud/genesyscloud/idp_okta" + idpPing "terraform-provider-genesyscloud/genesyscloud/idp_ping" idpSalesforce "terraform-provider-genesyscloud/genesyscloud/idp_salesforce" integration "terraform-provider-genesyscloud/genesyscloud/integration" integrationAction "terraform-provider-genesyscloud/genesyscloud/integration_action" @@ -126,7 +127,7 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_idp_gsuite"] = idpGsuite.ResourceIdpGsuite() providerResources["genesyscloud_idp_okta"] = idpOkta.ResourceIdpOkta() providerResources["genesyscloud_idp_onelogin"] = gcloud.ResourceIdpOnelogin() - providerResources["genesyscloud_idp_ping"] = gcloud.ResourceIdpPing() + providerResources["genesyscloud_idp_ping"] = idpPing.ResourceIdpPing() providerResources["genesyscloud_idp_salesforce"] = idpSalesforce.ResourceIdpSalesforce() providerResources["genesyscloud_integration"] = integration.ResourceIntegration() providerResources["genesyscloud_integration_action"] = integrationAction.ResourceIntegrationAction() @@ -226,7 +227,7 @@ func (r *registerTestInstance) registerTestExporters() { RegisterExporter("genesyscloud_idp_gsuite", idpGsuite.IdpGsuiteExporter()) RegisterExporter("genesyscloud_idp_okta", idpOkta.IdpOktaExporter()) RegisterExporter("genesyscloud_idp_onelogin", gcloud.IdpOneloginExporter()) - RegisterExporter("genesyscloud_idp_ping", gcloud.IdpPingExporter()) + RegisterExporter("genesyscloud_idp_ping", idpPing.IdpPingExporter()) RegisterExporter("genesyscloud_idp_salesforce", idpSalesforce.IdpSalesforceExporter()) RegisterExporter("genesyscloud_integration", integration.IntegrationExporter()) RegisterExporter("genesyscloud_integration_action", integrationAction.IntegrationActionExporter()) diff --git a/main.go b/main.go index 93008d596..da770b6fd 100644 --- a/main.go +++ b/main.go @@ -26,6 +26,7 @@ import ( idpAdfs "terraform-provider-genesyscloud/genesyscloud/idp_adfs" idpGsuite "terraform-provider-genesyscloud/genesyscloud/idp_gsuite" idpOkta "terraform-provider-genesyscloud/genesyscloud/idp_okta" + idpPing "terraform-provider-genesyscloud/genesyscloud/idp_ping" idpSalesforce "terraform-provider-genesyscloud/genesyscloud/idp_salesforce" "terraform-provider-genesyscloud/genesyscloud/integration" integrationAction "terraform-provider-genesyscloud/genesyscloud/integration_action" @@ -192,6 +193,7 @@ func registerResources() { idpAdfs.SetRegistrar(regInstance) //Registering idp adfs idpSalesforce.SetRegistrar(regInstance) //Registering idp salesforce idpOkta.SetRegistrar(regInstance) //Registering idp okta + idpPing.SetRegistrar(regInstance) //Registering idp ping idpGsuite.SetRegistrar(regInstance) //Registering idp gsuite integration.SetRegistrar(regInstance) //Registering integrations integrationCustomAuth.SetRegistrar(regInstance) //Registering integrations custom auth actions From 4b3575e2addaaf346e12b38c00c600996355500b Mon Sep 17 00:00:00 2001 From: shrutisuryawanshigenesys Date: Tue, 25 Jun 2024 09:51:16 -0400 Subject: [PATCH 29/62] Refactor/devtooling 157 - idp_generic (#1095) * refactoring of idp_generic * deleted original files * removed references of datasource * resolved comments * comments resolved * added slo_uri and slo_binding to idp_generic --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> --- docs/resources/idp_generic.md | 2 + .../genesyscloud_idp_generic_proxy.go | 87 ++++++ .../resource_genesyscloud_idp_generic.go | 162 ++++++++++ ...urce_genesyscloud_idp_generic_init_test.go | 46 +++ ...esource_genesyscloud_idp_generic_schema.go | 130 ++++++++ .../resource_genesyscloud_idp_generic_test.go | 35 ++- .../resource_genesyscloud_idp_generic.go | 277 ------------------ genesyscloud/resource_genesyscloud_init.go | 2 - .../resource_genesyscloud_init_test.go | 1 - .../tfexporter/tf_exporter_resource_test.go | 17 +- main.go | 2 + 11 files changed, 469 insertions(+), 292 deletions(-) create mode 100644 genesyscloud/idp_generic/genesyscloud_idp_generic_proxy.go create mode 100644 genesyscloud/idp_generic/resource_genesyscloud_idp_generic.go create mode 100644 genesyscloud/idp_generic/resource_genesyscloud_idp_generic_init_test.go create mode 100644 genesyscloud/idp_generic/resource_genesyscloud_idp_generic_schema.go rename genesyscloud/{ => idp_generic}/resource_genesyscloud_idp_generic_test.go (85%) delete mode 100644 genesyscloud/resource_genesyscloud_idp_generic.go diff --git a/docs/resources/idp_generic.md b/docs/resources/idp_generic.md index 95d69a46d..ccb733b61 100644 --- a/docs/resources/idp_generic.md +++ b/docs/resources/idp_generic.md @@ -46,6 +46,8 @@ resource "genesyscloud_idp_generic" "generic" { - `logo_image_data` (String) Base64 encoded SVG image. - `name_identifier_format` (String) SAML name identifier format. (urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified | urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress | urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName | urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName | urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos | urn:oasis:names:tc:SAML:2.0:nameid-format:entity | urn:oasis:names:tc:SAML:2.0:nameid-format:persistent | urn:oasis:names:tc:SAML:2.0:nameid-format:transient) Defaults to `urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified`. - `relying_party_identifier` (String) String used to identify Genesys Cloud to the identity provider. +- `slo_binding` (String) Valid values: HTTP Redirect, HTTP Post +- `slo_uri` (String) Provided by Okta on app creation. - `target_uri` (String) Target URI provided by the provider. - `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) diff --git a/genesyscloud/idp_generic/genesyscloud_idp_generic_proxy.go b/genesyscloud/idp_generic/genesyscloud_idp_generic_proxy.go new file mode 100644 index 000000000..a08d52f0c --- /dev/null +++ b/genesyscloud/idp_generic/genesyscloud_idp_generic_proxy.go @@ -0,0 +1,87 @@ +package idp_generic + +import ( + "context" + + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" +) + +/* +The genesyscloud_idp_generic_proxy.go file contains the proxy structures and methods that interact +with the Genesys Cloud SDK. We use composition here for each function on the proxy so individual functions can be stubbed +out during testing. +*/ + +// internalProxy holds a proxy instance that can be used throughout the package +var internalProxy *idpGenericProxy + +// Type definitions for each func on our proxy so we can easily mock them out later +type getIdpGenericFunc func(ctx context.Context, p *idpGenericProxy) (*platformclientv2.Genericsaml, *platformclientv2.APIResponse, error) +type updateIdpGenericFunc func(ctx context.Context, p *idpGenericProxy, id string, genericSAML *platformclientv2.Genericsaml) (*platformclientv2.Identityprovider, *platformclientv2.APIResponse, error) +type deleteIdpGenericFunc func(ctx context.Context, p *idpGenericProxy, id string) (response *platformclientv2.APIResponse, err error) + +// idpGenericProxy contains all of the methods that call genesys cloud APIs. +type idpGenericProxy struct { + clientConfig *platformclientv2.Configuration + identityProviderApi *platformclientv2.IdentityProviderApi + getIdpGenericAttr getIdpGenericFunc + updateIdpGenericAttr updateIdpGenericFunc + deleteIdpGenericAttr deleteIdpGenericFunc +} + +// newIdpGenericProxy initializes the idp generic proxy with all of the data needed to communicate with Genesys Cloud +func newIdpGenericProxy(clientConfig *platformclientv2.Configuration) *idpGenericProxy { + api := platformclientv2.NewIdentityProviderApiWithConfig(clientConfig) + return &idpGenericProxy{ + clientConfig: clientConfig, + identityProviderApi: api, + getIdpGenericAttr: getIdpGenericFn, + updateIdpGenericAttr: updateIdpGenericFn, + deleteIdpGenericAttr: deleteIdpGenericFn, + } +} + +// getIdpGenericProxy acts as a singleton to for the internalProxy. It also ensures +// that we can still proxy our tests by directly setting internalProxy package variable +func getIdpGenericProxy(clientConfig *platformclientv2.Configuration) *idpGenericProxy { + if internalProxy == nil { + internalProxy = newIdpGenericProxy(clientConfig) + } + + return internalProxy +} + +// getIdpGeneric retrieves all Genesys Cloud idp generic +func (p *idpGenericProxy) getIdpGeneric(ctx context.Context) (*platformclientv2.Genericsaml, *platformclientv2.APIResponse, error) { + return p.getIdpGenericAttr(ctx, p) +} + +// updateIdpGeneric updates a Genesys Cloud idp generic +func (p *idpGenericProxy) updateIdpGeneric(ctx context.Context, id string, idpGeneric *platformclientv2.Genericsaml) (*platformclientv2.Identityprovider, *platformclientv2.APIResponse, error) { + return p.updateIdpGenericAttr(ctx, p, id, idpGeneric) +} + +// deleteIdpGeneric deletes a Genesys Cloud idp generic by Id +func (p *idpGenericProxy) deleteIdpGeneric(ctx context.Context, id string) (resp *platformclientv2.APIResponse, err error) { + return p.deleteIdpGenericAttr(ctx, p, id) +} + +// getIdpGenericFn is the implementation for retrieving all idp generic in Genesys Cloud +func getIdpGenericFn(ctx context.Context, p *idpGenericProxy) (*platformclientv2.Genericsaml, *platformclientv2.APIResponse, error) { + return p.identityProviderApi.GetIdentityprovidersGeneric() +} + +// updateIdpGenericFn is an implementation of the function to update a Genesys Cloud idp generic +func updateIdpGenericFn(ctx context.Context, p *idpGenericProxy, id string, idpGeneric *platformclientv2.Genericsaml) (*platformclientv2.Identityprovider, *platformclientv2.APIResponse, error) { + return p.identityProviderApi.PutIdentityprovidersGeneric(*idpGeneric) +} + +// deleteIdpGenericFn is an implementation function for deleting a Genesys Cloud idp generic +func deleteIdpGenericFn(ctx context.Context, p *idpGenericProxy, id string) (response *platformclientv2.APIResponse, err error) { + _, resp, err := p.identityProviderApi.DeleteIdentityprovidersGeneric() + if err != nil { + return resp, err + } + + return resp, err +} diff --git a/genesyscloud/idp_generic/resource_genesyscloud_idp_generic.go b/genesyscloud/idp_generic/resource_genesyscloud_idp_generic.go new file mode 100644 index 000000000..83121add0 --- /dev/null +++ b/genesyscloud/idp_generic/resource_genesyscloud_idp_generic.go @@ -0,0 +1,162 @@ +package idp_generic + +import ( + "context" + "fmt" + "log" + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + "terraform-provider-genesyscloud/genesyscloud/util" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + + "terraform-provider-genesyscloud/genesyscloud/consistency_checker" + + "terraform-provider-genesyscloud/genesyscloud/util/constants" + "terraform-provider-genesyscloud/genesyscloud/util/lists" + "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" +) + +/* +The resource_genesyscloud_idp_generic.go contains all of the methods that perform the core logic for a resource. +*/ + +// getAllAuthIdpGeneric retrieves all of the idp generic via Terraform in the Genesys Cloud and is used for the exporter +func getAllAuthIdpGenerics(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { + proxy := getIdpGenericProxy(clientConfig) + resources := make(resourceExporter.ResourceIDMetaMap) + + _, resp, getErr := proxy.getIdpGeneric(ctx) + if getErr != nil { + if util.IsStatus404(resp) { + // Don't export if config doesn't exist + return resources, nil + } + return nil, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to get IDP Generic error: %s", getErr), resp) + } + + resources["0"] = &resourceExporter.ResourceMeta{Name: "generic"} + return resources, nil +} + +// createIdpGeneric is used by the idp_generic resource to create Genesys cloud idp generic +func createIdpGeneric(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + log.Printf("Creating IDP Generic") + d.SetId("generic") + return updateIdpGeneric(ctx, d, meta) +} + +// readIdpGeneric is used by the idp_generic resource to read an idp generic from genesys cloud +func readIdpGeneric(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getIdpGenericProxy(sdkConfig) + + log.Printf("Reading idp generic %s", d.Id()) + + cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceIdpGeneric(), constants.DefaultConsistencyChecks, resourceName) + + return util.WithRetriesForReadCustomTimeout(ctx, d.Timeout(schema.TimeoutRead), d, func() *retry.RetryError { + genericSAML, resp, getErr := proxy.getIdpGeneric(ctx) + if getErr != nil { + if util.IsStatus404(resp) { + createIdpGeneric(ctx, d, meta) + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read IDP Generic: %s", getErr), resp)) + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read IDP Generic: %s", getErr), resp)) + } + + resourcedata.SetNillableValue(d, "name", genericSAML.Name) + resourcedata.SetNillableValue(d, "disabled", genericSAML.Disabled) + resourcedata.SetNillableValue(d, "issuer_uri", genericSAML.IssuerURI) + resourcedata.SetNillableValue(d, "target_uri", genericSAML.SsoTargetURI) + resourcedata.SetNillableValue(d, "slo_uri", genericSAML.SloURI) + resourcedata.SetNillableValue(d, "slo_binding", genericSAML.SloBinding) + resourcedata.SetNillableValue(d, "relying_party_identifier", genericSAML.RelyingPartyIdentifier) + resourcedata.SetNillableValue(d, "logo_image_data", genericSAML.LogoImageData) + resourcedata.SetNillableValue(d, "endpoint_compression", genericSAML.EndpointCompression) + resourcedata.SetNillableValue(d, "name_identifier_format", genericSAML.NameIdentifierFormat) + + if genericSAML.Certificate != nil { + d.Set("certificates", lists.StringListToInterfaceList([]string{*genericSAML.Certificate})) + } else if genericSAML.Certificates != nil { + d.Set("certificates", lists.StringListToInterfaceList(*genericSAML.Certificates)) + } else { + d.Set("certificates", nil) + } + + log.Printf("Read idp generic %s %s", d.Id(), *genericSAML.Name) + return cc.CheckState(d) + }) +} + +// updateIdpGeneric is used by the idp_generic resource to update an idp generic in Genesys Cloud +func updateIdpGeneric(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getIdpGenericProxy(sdkConfig) + + idpGeneric := getIdpGenericFromResourceData(d) + + log.Printf("Updating idp generic %s", *idpGeneric.Name) + + certificates := lists.BuildSdkStringListFromInterfaceArray(d, "certificates") + if certificates != nil { + if len(*certificates) == 1 { + idpGeneric.Certificate = &(*certificates)[0] + } + idpGeneric.Certificates = certificates + } + + _, resp, err := proxy.updateIdpGeneric(ctx, d.Id(), &idpGeneric) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to update IDP Generic %s error: %s", d.Id(), err), resp) + } + + log.Printf("Updated idp generic") + return readIdpGeneric(ctx, d, meta) +} + +// deleteIdpGeneric is used by the idp_generic resource to delete an idp generic from Genesys cloud +func deleteIdpGeneric(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getIdpGenericProxy(sdkConfig) + + resp, err := proxy.deleteIdpGeneric(ctx, d.Id()) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to delete IDP Generic %s error: %s", d.Id(), err), resp) + } + + return util.WithRetries(ctx, 60*time.Second, func() *retry.RetryError { + _, resp, err := proxy.getIdpGeneric(ctx) + + if err != nil { + if util.IsStatus404(resp) { + // IDP Generic deleted + log.Printf("Deleted IDP Generic") + return nil + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Error deleting IDP Generic: %s", err), resp)) + } + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("IDP Generic still exists"), resp)) + }) +} + +// getIdpGenericFromResourceData maps data from schema ResourceData object to a platformclientv2.Genericsaml +func getIdpGenericFromResourceData(d *schema.ResourceData) platformclientv2.Genericsaml { + return platformclientv2.Genericsaml{ + Name: platformclientv2.String(d.Get("name").(string)), + Disabled: platformclientv2.Bool(d.Get("disabled").(bool)), + IssuerURI: platformclientv2.String(d.Get("issuer_uri").(string)), + SsoTargetURI: platformclientv2.String(d.Get("target_uri").(string)), + RelyingPartyIdentifier: platformclientv2.String(d.Get("relying_party_identifier").(string)), + LogoImageData: platformclientv2.String(d.Get("logo_image_data").(string)), + EndpointCompression: platformclientv2.Bool(d.Get("endpoint_compression").(bool)), + NameIdentifierFormat: platformclientv2.String(d.Get("name_identifier_format").(string)), + SloURI: platformclientv2.String(d.Get("slo_uri").(string)), + SloBinding: platformclientv2.String(d.Get("slo_binding").(string)), + } +} diff --git a/genesyscloud/idp_generic/resource_genesyscloud_idp_generic_init_test.go b/genesyscloud/idp_generic/resource_genesyscloud_idp_generic_init_test.go new file mode 100644 index 000000000..25e259220 --- /dev/null +++ b/genesyscloud/idp_generic/resource_genesyscloud_idp_generic_init_test.go @@ -0,0 +1,46 @@ +package idp_generic + +import ( + "sync" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +/* + The genesyscloud_idp_generic_init_test.go file is used to initialize the resources + used in testing the idp_generic resource. +*/ + +// providerResources holds a map of all registered resources +var providerResources map[string]*schema.Resource + +type registerTestInstance struct { + resourceMapMutex sync.RWMutex +} + +// registerTestResources registers all resources used in the tests +func (r *registerTestInstance) registerTestResources() { + r.resourceMapMutex.Lock() + defer r.resourceMapMutex.Unlock() + + providerResources[resourceName] = ResourceIdpGeneric() +} + +// initTestResources initializes all test_data resources. +func initTestResources() { + providerResources = make(map[string]*schema.Resource) + + regInstance := ®isterTestInstance{} + + regInstance.registerTestResources() +} + +// TestMain is a "setup" function called by the testing framework when run the test_data +func TestMain(m *testing.M) { + // Run setup function before starting the test_data suite for the idp_generic package + initTestResources() + + // Run the test_data suite for the idp_generic package + m.Run() +} diff --git a/genesyscloud/idp_generic/resource_genesyscloud_idp_generic_schema.go b/genesyscloud/idp_generic/resource_genesyscloud_idp_generic_schema.go new file mode 100644 index 000000000..66d014625 --- /dev/null +++ b/genesyscloud/idp_generic/resource_genesyscloud_idp_generic_schema.go @@ -0,0 +1,130 @@ +package idp_generic + +import ( + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" +) + +/* +resource_genesycloud_idp_generic_schema.go holds four functions within it: + +1. The registration code that registers the Datasource, Resource and Exporter for the package. +2. The resource schema definitions for the idp_generic resource. +3. The datasource schema definitions for the idp_generic datasource. +4. The resource exporter configuration for the idp_generic exporter. +*/ +const resourceName = "genesyscloud_idp_generic" + +// SetRegistrar registers all of the resources, datasources and exporters in the package +func SetRegistrar(regInstance registrar.Registrar) { + regInstance.RegisterResource(resourceName, ResourceIdpGeneric()) + regInstance.RegisterExporter(resourceName, IdpGenericExporter()) +} + +// ResourceIdpGeneric registers the genesyscloud_idp_generic resource with Terraform +func ResourceIdpGeneric() *schema.Resource { + return &schema.Resource{ + Description: `Genesys Cloud Single Sign-on Generic Identity Provider. See this page for detailed configuration instructions: https://help.mypurecloud.com/articles/add-a-generic-single-sign-on-provider/`, + + CreateContext: provider.CreateWithPooledClient(createIdpGeneric), + ReadContext: provider.ReadWithPooledClient(readIdpGeneric), + UpdateContext: provider.UpdateWithPooledClient(updateIdpGeneric), + DeleteContext: provider.DeleteWithPooledClient(deleteIdpGeneric), + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + SchemaVersion: 1, + Timeouts: &schema.ResourceTimeout{ + Update: schema.DefaultTimeout(8 * time.Minute), + Read: schema.DefaultTimeout(8 * time.Minute), + }, + Schema: map[string]*schema.Schema{ + `name`: { + Description: `Name of the provider.`, + Required: true, + Type: schema.TypeString, + }, + `disabled`: { + Description: `True if Generic provider is disabled.`, + Optional: true, + Default: false, + Type: schema.TypeBool, + }, + `issuer_uri`: { + Description: `Issuer URI provided by the provider.`, + Required: true, + Type: schema.TypeString, + }, + `target_uri`: { + Description: `Target URI provided by the provider.`, + Optional: true, + Type: schema.TypeString, + }, + `slo_uri`: { + Description: `Provided by Okta on app creation.`, + Optional: true, + Type: schema.TypeString, + }, + `slo_binding`: { + Description: `Valid values: HTTP Redirect, HTTP Post`, + Optional: true, + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice([]string{`HTTP Redirect`, `HTTP Post`}, false), + }, + `relying_party_identifier`: { + Description: `String used to identify Genesys Cloud to the identity provider.`, + Optional: true, + Type: schema.TypeString, + }, + `certificates`: { + Description: `PEM or DER encoded public X.509 certificates for SAML signature validation.`, + Required: true, + Type: schema.TypeList, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + `logo_image_data`: { + Description: `Base64 encoded SVG image.`, + Optional: true, + Type: schema.TypeString, + }, + `endpoint_compression`: { + Description: `True if the Genesys Cloud authentication request should be compressed.`, + Optional: true, + Type: schema.TypeBool, + Default: false, + }, + `name_identifier_format`: { + Description: `SAML name identifier format. (urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified | urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress | urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName | urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName | urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos | urn:oasis:names:tc:SAML:2.0:nameid-format:entity | urn:oasis:names:tc:SAML:2.0:nameid-format:persistent | urn:oasis:names:tc:SAML:2.0:nameid-format:transient)`, + Type: schema.TypeString, + Optional: true, + Default: `urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified`, + ValidateFunc: validation.StringInSlice([]string{ + `urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified`, + `urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress`, + `urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName`, + `urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName`, + `urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos`, + `urn:oasis:names:tc:SAML:2.0:nameid-format:entity`, + `urn:oasis:names:tc:SAML:2.0:nameid-format:persistent`, + `urn:oasis:names:tc:SAML:2.0:nameid-format:transient`, + }, false), + }, + }, + } +} + +// IdpGenericExporter returns the resourceExporter object used to hold the genesyscloud_idp_generic exporter's config +func IdpGenericExporter() *resourceExporter.ResourceExporter { + return &resourceExporter.ResourceExporter{ + GetResourcesFunc: provider.GetAllWithPooledClient(getAllAuthIdpGenerics), + RefAttrs: map[string]*resourceExporter.RefAttrSettings{ + // TODO: Add any reference attributes here + }, + } +} diff --git a/genesyscloud/resource_genesyscloud_idp_generic_test.go b/genesyscloud/idp_generic/resource_genesyscloud_idp_generic_test.go similarity index 85% rename from genesyscloud/resource_genesyscloud_idp_generic_test.go rename to genesyscloud/idp_generic/resource_genesyscloud_idp_generic_test.go index 6043d440d..1662fc6f8 100644 --- a/genesyscloud/resource_genesyscloud_idp_generic_test.go +++ b/genesyscloud/idp_generic/resource_genesyscloud_idp_generic_test.go @@ -1,4 +1,4 @@ -package genesyscloud +package idp_generic import ( "fmt" @@ -23,11 +23,14 @@ func TestAccResourceIdpGeneric(t *testing.T) { nameIDFormatDefault = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" nameIDFormatEmail = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" base64Img = "PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvM" + uri3 = "https://example.com" + slo_binding1 = "HTTP Redirect" + slo_binding2 = "HTTP Post" ) resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) }, - ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + ProviderFactories: provider.GetProviderFactories(providerResources, nil), Steps: []resource.TestStep{ { // Create @@ -41,6 +44,8 @@ func TestAccResourceIdpGeneric(t *testing.T) { util.NullValue, // no image util.NullValue, // No endpoint compression util.NullValue, // Default name ID format + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "name", name1), @@ -52,6 +57,8 @@ func TestAccResourceIdpGeneric(t *testing.T) { resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "logo_image_data", ""), resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "endpoint_compression", util.FalseValue), resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "name_identifier_format", nameIDFormatDefault), + resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "slo_binding", slo_binding1), ), }, { @@ -66,6 +73,8 @@ func TestAccResourceIdpGeneric(t *testing.T) { strconv.Quote(base64Img), util.TrueValue, // Endpoint compression strconv.Quote(nameIDFormatEmail), + uri3, + slo_binding2, ), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "name", name2), @@ -77,6 +86,8 @@ func TestAccResourceIdpGeneric(t *testing.T) { resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "logo_image_data", base64Img), resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "endpoint_compression", util.TrueValue), resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "name_identifier_format", nameIDFormatEmail), + resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "slo_binding", slo_binding2), ), }, { @@ -91,6 +102,8 @@ func TestAccResourceIdpGeneric(t *testing.T) { strconv.Quote(base64Img), util.TrueValue, // Endpoint compression strconv.Quote(nameIDFormatEmail), + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "name", name2), @@ -100,6 +113,8 @@ func TestAccResourceIdpGeneric(t *testing.T) { resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "relying_party_identifier", relyingPartyID2), resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "slo_binding", slo_binding1), ), }, { @@ -114,6 +129,8 @@ func TestAccResourceIdpGeneric(t *testing.T) { strconv.Quote(base64Img), util.TrueValue, // Endpoint compression strconv.Quote(nameIDFormatEmail), + uri3, + slo_binding2, ), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "name", name2), @@ -123,6 +140,8 @@ func TestAccResourceIdpGeneric(t *testing.T) { resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "relying_party_identifier", relyingPartyID2), resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "slo_binding", slo_binding2), ), }, { @@ -137,6 +156,8 @@ func TestAccResourceIdpGeneric(t *testing.T) { strconv.Quote(base64Img), util.TrueValue, // Endpoint compression strconv.Quote(nameIDFormatEmail), + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "name", name2), @@ -147,6 +168,8 @@ func TestAccResourceIdpGeneric(t *testing.T) { resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "relying_party_identifier", relyingPartyID2), resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "slo_binding", slo_binding1), ), }, { @@ -169,7 +192,9 @@ func generateIdpGenericResource( disabled string, logoImageData string, endpointCompression string, - nameIDFormat string) string { + nameIDFormat string, + sloURI string, + sloBinding string) string { return fmt.Sprintf(`resource "genesyscloud_idp_generic" "generic" { name = "%s" certificates = %s @@ -180,8 +205,10 @@ func generateIdpGenericResource( logo_image_data = %s endpoint_compression = %s name_identifier_format = %s + slo_uri = "%s" + slo_binding = "%s" } - `, name, certs, issuerURI, targetURI, partyID, disabled, logoImageData, endpointCompression, nameIDFormat) + `, name, certs, issuerURI, targetURI, partyID, disabled, logoImageData, endpointCompression, nameIDFormat, sloURI, sloBinding) } func testVerifyIdpGenericDestroyed(state *terraform.State) error { diff --git a/genesyscloud/resource_genesyscloud_idp_generic.go b/genesyscloud/resource_genesyscloud_idp_generic.go deleted file mode 100644 index 8db0dad77..000000000 --- a/genesyscloud/resource_genesyscloud_idp_generic.go +++ /dev/null @@ -1,277 +0,0 @@ -package genesyscloud - -import ( - "context" - "fmt" - "log" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" - "terraform-provider-genesyscloud/genesyscloud/util/constants" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - - "terraform-provider-genesyscloud/genesyscloud/consistency_checker" - - resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" - lists "terraform-provider-genesyscloud/genesyscloud/util/lists" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" -) - -func getAllIdpGeneric(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(clientConfig) - resources := make(resourceExporter.ResourceIDMetaMap) - - _, resp, getErr := idpAPI.GetIdentityprovidersGeneric() - if getErr != nil { - if util.IsStatus404(resp) { - // Don't export if config doesn't exist - return resources, nil - } - return nil, util.BuildAPIDiagnosticError("genesyscloud_idp_generic", fmt.Sprintf("Failed to get IDP Generic error: %s", getErr), resp) - } - - resources["0"] = &resourceExporter.ResourceMeta{Name: "generic"} - return resources, nil -} - -func IdpGenericExporter() *resourceExporter.ResourceExporter { - return &resourceExporter.ResourceExporter{ - GetResourcesFunc: provider.GetAllWithPooledClient(getAllIdpGeneric), - RefAttrs: map[string]*resourceExporter.RefAttrSettings{}, // No references - } -} - -func ResourceIdpGeneric() *schema.Resource { - return &schema.Resource{ - Description: "Genesys Cloud Single Sign-on Generic Identity Provider. See this page for detailed configuration instructions: https://help.mypurecloud.com/articles/add-a-generic-single-sign-on-provider/", - - CreateContext: provider.CreateWithPooledClient(createIdpGeneric), - ReadContext: provider.ReadWithPooledClient(readIdpGeneric), - UpdateContext: provider.UpdateWithPooledClient(updateIdpGeneric), - DeleteContext: provider.DeleteWithPooledClient(deleteIdpGeneric), - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - SchemaVersion: 1, - Timeouts: &schema.ResourceTimeout{ - Update: schema.DefaultTimeout(8 * time.Minute), - Read: schema.DefaultTimeout(8 * time.Minute), - }, - Schema: map[string]*schema.Schema{ - "name": { - Description: "Name of the provider.", - Type: schema.TypeString, - Required: true, - }, - "certificates": { - Description: "PEM or DER encoded public X.509 certificates for SAML signature validation.", - Type: schema.TypeList, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "issuer_uri": { - Description: "Issuer URI provided by the provider.", - Type: schema.TypeString, - Required: true, - }, - "target_uri": { - Description: "Target URI provided by the provider.", - Type: schema.TypeString, - Optional: true, - }, - "relying_party_identifier": { - Description: "String used to identify Genesys Cloud to the identity provider.", - Type: schema.TypeString, - Optional: true, - }, - "disabled": { - Description: "True if Generic provider is disabled.", - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "logo_image_data": { - Description: "Base64 encoded SVG image.", - Type: schema.TypeString, - Optional: true, - }, - "endpoint_compression": { - Description: "True if the Genesys Cloud authentication request should be compressed.", - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "name_identifier_format": { - Description: "SAML name identifier format. (urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified | urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress | urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName | urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName | urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos | urn:oasis:names:tc:SAML:2.0:nameid-format:entity | urn:oasis:names:tc:SAML:2.0:nameid-format:persistent | urn:oasis:names:tc:SAML:2.0:nameid-format:transient)", - Type: schema.TypeString, - Optional: true, - Default: "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", - ValidateFunc: validation.StringInSlice([]string{ - "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", - "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", - "urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName", - "urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName", - "urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos", - "urn:oasis:names:tc:SAML:2.0:nameid-format:entity", - "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent", - "urn:oasis:names:tc:SAML:2.0:nameid-format:transient", - }, false), - }, - }, - } -} - -func createIdpGeneric(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - log.Printf("Creating IDP Generic") - d.SetId("generic") - return updateIdpGeneric(ctx, d, meta) -} - -func readIdpGeneric(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(sdkConfig) - cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceIdpGeneric(), constants.DefaultConsistencyChecks, "genesyscloud_idp_generic") - - log.Printf("Reading IDP Generic") - - return util.WithRetriesForReadCustomTimeout(ctx, d.Timeout(schema.TimeoutRead), d, func() *retry.RetryError { - generic, resp, getErr := idpAPI.GetIdentityprovidersGeneric() - if getErr != nil { - if util.IsStatus404(resp) { - createIdpGeneric(ctx, d, meta) - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_generic", fmt.Sprintf("Failed to read IDP Generic: %s", getErr), resp)) - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_generic", fmt.Sprintf("Failed to read IDP Generic: %s", getErr), resp)) - } - - if generic.Name != nil { - d.Set("name", *generic.Name) - } else { - d.Set("name", nil) - } - - if generic.Certificate != nil { - d.Set("certificates", lists.StringListToInterfaceList([]string{*generic.Certificate})) - } else if generic.Certificates != nil { - d.Set("certificates", lists.StringListToInterfaceList(*generic.Certificates)) - } else { - d.Set("certificates", nil) - } - - if generic.IssuerURI != nil { - d.Set("issuer_uri", *generic.IssuerURI) - } else { - d.Set("issuer_uri", nil) - } - - if generic.SsoTargetURI != nil { - d.Set("target_uri", *generic.SsoTargetURI) - } else { - d.Set("target_uri", nil) - } - - if generic.RelyingPartyIdentifier != nil { - d.Set("relying_party_identifier", *generic.RelyingPartyIdentifier) - } else { - d.Set("relying_party_identifier", nil) - } - - if generic.Disabled != nil { - d.Set("disabled", *generic.Disabled) - } else { - d.Set("disabled", nil) - } - - if generic.LogoImageData != nil { - d.Set("logo_image_data", *generic.LogoImageData) - } else { - d.Set("logo_image_data", nil) - } - - if generic.EndpointCompression != nil { - d.Set("endpoint_compression", *generic.EndpointCompression) - } else { - d.Set("endpoint_compression", nil) - } - - if generic.NameIdentifierFormat != nil { - d.Set("name_identifier_format", *generic.NameIdentifierFormat) - } else { - d.Set("name_identifier_format", nil) - } - - log.Printf("Read IDP Generic") - return cc.CheckState(d) - }) -} - -func updateIdpGeneric(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - name := d.Get("name").(string) - issuerUri := d.Get("issuer_uri").(string) - targetUri := d.Get("target_uri").(string) - relyingPartyID := d.Get("relying_party_identifier").(string) - disabled := d.Get("disabled").(bool) - logoImageData := d.Get("logo_image_data").(string) - endpointCompression := d.Get("endpoint_compression").(bool) - nameIdentifierFormat := d.Get("name_identifier_format").(string) - - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(sdkConfig) - - log.Printf("Updating IDP Generic") - update := platformclientv2.Genericsaml{ - Name: &name, - IssuerURI: &issuerUri, - SsoTargetURI: &targetUri, - RelyingPartyIdentifier: &relyingPartyID, - Disabled: &disabled, - LogoImageData: &logoImageData, - EndpointCompression: &endpointCompression, - NameIdentifierFormat: &nameIdentifierFormat, - } - - certificates := lists.BuildSdkStringListFromInterfaceArray(d, "certificates") - if certificates != nil { - if len(*certificates) == 1 { - update.Certificate = &(*certificates)[0] - } - update.Certificates = certificates - } - - _, resp, err := idpAPI.PutIdentityprovidersGeneric(update) - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_idp_generic", fmt.Sprintf("Failed to update IDP Generic %s error: %s", d.Id(), err), resp) - } - - log.Printf("Updated IDP Generic") - return readIdpGeneric(ctx, d, meta) -} - -func deleteIdpGeneric(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(sdkConfig) - - log.Printf("Deleting IDP Generic") - _, resp, err := idpAPI.DeleteIdentityprovidersGeneric() - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_idp_generic", fmt.Sprintf("Failed to delete IDP Generic %s error: %s", d.Id(), err), resp) - } - - return util.WithRetries(ctx, 60*time.Second, func() *retry.RetryError { - _, resp, err := idpAPI.GetIdentityprovidersGeneric() - if err != nil { - if util.IsStatus404(resp) { - // IDP Generic deleted - log.Printf("Deleted IDP Generic") - return nil - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_generic", fmt.Sprintf("Error deleting IDP Generic: %s", err), resp)) - } - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_generic", fmt.Sprintf("IDP Generic still exists"), resp)) - }) -} diff --git a/genesyscloud/resource_genesyscloud_init.go b/genesyscloud/resource_genesyscloud_init.go index 2a974c295..747e3a5a2 100644 --- a/genesyscloud/resource_genesyscloud_init.go +++ b/genesyscloud/resource_genesyscloud_init.go @@ -42,7 +42,6 @@ func registerResources(l registrar.Registrar) { l.RegisterResource("genesyscloud_location", ResourceLocation()) l.RegisterResource("genesyscloud_auth_division", ResourceAuthDivision()) - l.RegisterResource("genesyscloud_idp_generic", ResourceIdpGeneric()) l.RegisterResource("genesyscloud_idp_onelogin", ResourceIdpOnelogin()) l.RegisterResource("genesyscloud_journey_action_map", ResourceJourneyActionMap()) l.RegisterResource("genesyscloud_journey_action_template", ResourceJourneyActionTemplate()) @@ -70,7 +69,6 @@ func registerResources(l registrar.Registrar) { func registerExporters(l registrar.Registrar) { l.RegisterExporter("genesyscloud_auth_division", AuthDivisionExporter()) - l.RegisterExporter("genesyscloud_idp_generic", IdpGenericExporter()) l.RegisterExporter("genesyscloud_idp_onelogin", IdpOneloginExporter()) l.RegisterExporter("genesyscloud_journey_action_map", JourneyActionMapExporter()) l.RegisterExporter("genesyscloud_journey_action_template", JourneyActionTemplateExporter()) diff --git a/genesyscloud/resource_genesyscloud_init_test.go b/genesyscloud/resource_genesyscloud_init_test.go index 8fa334519..9a90cd2a8 100644 --- a/genesyscloud/resource_genesyscloud_init_test.go +++ b/genesyscloud/resource_genesyscloud_init_test.go @@ -41,7 +41,6 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_routing_queue"] = routingQueue.ResourceRoutingQueue() providerResources["genesyscloud_location"] = ResourceLocation() providerResources["genesyscloud_auth_division"] = ResourceAuthDivision() - providerResources["genesyscloud_idp_generic"] = ResourceIdpGeneric() providerResources["genesyscloud_idp_onelogin"] = ResourceIdpOnelogin() providerResources["genesyscloud_journey_action_map"] = ResourceJourneyActionMap() providerResources["genesyscloud_journey_action_template"] = ResourceJourneyActionTemplate() diff --git a/genesyscloud/tfexporter/tf_exporter_resource_test.go b/genesyscloud/tfexporter/tf_exporter_resource_test.go index 82a6ef7de..5f3873c2e 100644 --- a/genesyscloud/tfexporter/tf_exporter_resource_test.go +++ b/genesyscloud/tfexporter/tf_exporter_resource_test.go @@ -6,12 +6,6 @@ import ( "terraform-provider-genesyscloud/genesyscloud/architect_datatable_row" emergencyGroup "terraform-provider-genesyscloud/genesyscloud/architect_emergencygroup" flow "terraform-provider-genesyscloud/genesyscloud/architect_flow" - flowLogLevel "terraform-provider-genesyscloud/genesyscloud/flow_loglevel" - outboundContactListContact "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list_contact" - routingSettings "terraform-provider-genesyscloud/genesyscloud/routing_settings" - routingUtilization "terraform-provider-genesyscloud/genesyscloud/routing_utilization" - routingUtilizationLabel "terraform-provider-genesyscloud/genesyscloud/routing_utilization_label" - outboundRoute "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site_outbound_route" grammar "terraform-provider-genesyscloud/genesyscloud/architect_grammar" grammarLanguage "terraform-provider-genesyscloud/genesyscloud/architect_grammar_language" archIvr "terraform-provider-genesyscloud/genesyscloud/architect_ivr" @@ -19,11 +13,13 @@ import ( architectSchedules "terraform-provider-genesyscloud/genesyscloud/architect_schedules" authRole "terraform-provider-genesyscloud/genesyscloud/auth_role" employeeperformanceExternalmetricsDefinition "terraform-provider-genesyscloud/genesyscloud/employeeperformance_externalmetrics_definitions" + flowLogLevel "terraform-provider-genesyscloud/genesyscloud/flow_loglevel" flowMilestone "terraform-provider-genesyscloud/genesyscloud/flow_milestone" flowOutcome "terraform-provider-genesyscloud/genesyscloud/flow_outcome" "terraform-provider-genesyscloud/genesyscloud/group" groupRoles "terraform-provider-genesyscloud/genesyscloud/group_roles" idpAdfs "terraform-provider-genesyscloud/genesyscloud/idp_adfs" + idpGeneric "terraform-provider-genesyscloud/genesyscloud/idp_generic" idpGsuite "terraform-provider-genesyscloud/genesyscloud/idp_gsuite" idpOkta "terraform-provider-genesyscloud/genesyscloud/idp_okta" idpPing "terraform-provider-genesyscloud/genesyscloud/idp_ping" @@ -41,6 +37,7 @@ import ( obCampaign "terraform-provider-genesyscloud/genesyscloud/outbound_campaign" obCampaignRule "terraform-provider-genesyscloud/genesyscloud/outbound_campaignrule" outboundContactList "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list" + outboundContactListContact "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list_contact" obContactListFilter "terraform-provider-genesyscloud/genesyscloud/outbound_contactlistfilter" obDncList "terraform-provider-genesyscloud/genesyscloud/outbound_dnclist" obfst "terraform-provider-genesyscloud/genesyscloud/outbound_filespecificationtemplate" @@ -58,7 +55,10 @@ import ( routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" routingQueueConditionalGroupRouting "terraform-provider-genesyscloud/genesyscloud/routing_queue_conditional_group_routing" routingQueueOutboundEmailAddress "terraform-provider-genesyscloud/genesyscloud/routing_queue_outbound_email_address" + routingSettings "terraform-provider-genesyscloud/genesyscloud/routing_settings" routingSmsAddress "terraform-provider-genesyscloud/genesyscloud/routing_sms_addresses" + routingUtilization "terraform-provider-genesyscloud/genesyscloud/routing_utilization" + routingUtilizationLabel "terraform-provider-genesyscloud/genesyscloud/routing_utilization_label" "terraform-provider-genesyscloud/genesyscloud/scripts" workbin "terraform-provider-genesyscloud/genesyscloud/task_management_workbin" workitemSchema "terraform-provider-genesyscloud/genesyscloud/task_management_workitem_schema" @@ -68,6 +68,7 @@ import ( edgeGroup "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_edge_group" edgeExtension "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_extension_pool" phonebaseSettings "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_phonebasesettings" + outboundRoute "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site_outbound_route" edgesTrunk "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_trunk" userRoles "terraform-provider-genesyscloud/genesyscloud/user_roles" webdeployConfig "terraform-provider-genesyscloud/genesyscloud/webdeployments_configuration" @@ -123,7 +124,7 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_group"] = group.ResourceGroup() providerResources["genesyscloud_group_roles"] = groupRoles.ResourceGroupRoles() providerResources["genesyscloud_idp_adfs"] = idpAdfs.ResourceIdpAdfs() - providerResources["genesyscloud_idp_generic"] = gcloud.ResourceIdpGeneric() + providerResources["genesyscloud_idp_generic"] = idpGeneric.ResourceIdpGeneric() providerResources["genesyscloud_idp_gsuite"] = idpGsuite.ResourceIdpGsuite() providerResources["genesyscloud_idp_okta"] = idpOkta.ResourceIdpOkta() providerResources["genesyscloud_idp_onelogin"] = gcloud.ResourceIdpOnelogin() @@ -223,7 +224,7 @@ func (r *registerTestInstance) registerTestExporters() { RegisterExporter("genesyscloud_group", group.GroupExporter()) RegisterExporter("genesyscloud_group_roles", groupRoles.GroupRolesExporter()) RegisterExporter("genesyscloud_idp_adfs", idpAdfs.IdpAdfsExporter()) - RegisterExporter("genesyscloud_idp_generic", gcloud.IdpGenericExporter()) + RegisterExporter("genesyscloud_idp_generic", idpGeneric.IdpGenericExporter()) RegisterExporter("genesyscloud_idp_gsuite", idpGsuite.IdpGsuiteExporter()) RegisterExporter("genesyscloud_idp_okta", idpOkta.IdpOktaExporter()) RegisterExporter("genesyscloud_idp_onelogin", gcloud.IdpOneloginExporter()) diff --git a/main.go b/main.go index da770b6fd..9c07f19fc 100644 --- a/main.go +++ b/main.go @@ -24,6 +24,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/group" groupRoles "terraform-provider-genesyscloud/genesyscloud/group_roles" idpAdfs "terraform-provider-genesyscloud/genesyscloud/idp_adfs" + idpGeneric "terraform-provider-genesyscloud/genesyscloud/idp_generic" idpGsuite "terraform-provider-genesyscloud/genesyscloud/idp_gsuite" idpOkta "terraform-provider-genesyscloud/genesyscloud/idp_okta" idpPing "terraform-provider-genesyscloud/genesyscloud/idp_ping" @@ -193,6 +194,7 @@ func registerResources() { idpAdfs.SetRegistrar(regInstance) //Registering idp adfs idpSalesforce.SetRegistrar(regInstance) //Registering idp salesforce idpOkta.SetRegistrar(regInstance) //Registering idp okta + idpGeneric.SetRegistrar(regInstance) //Registering idp generic idpPing.SetRegistrar(regInstance) //Registering idp ping idpGsuite.SetRegistrar(regInstance) //Registering idp gsuite integration.SetRegistrar(regInstance) //Registering integrations From 36b5b4ec7393ab94880cf493188e572379deb7ca Mon Sep 17 00:00:00 2001 From: tsantos-genesys <154342374+tsantos-genesys@users.noreply.github.com> Date: Tue, 25 Jun 2024 15:14:08 +0100 Subject: [PATCH 30/62] Cleanup/Remove utilization label availability check / mentions of feature not being available (#1117) --- docs/resources/routing_utilization.md | 2 +- docs/resources/routing_utilization_label.md | 4 ++-- genesyscloud/resource_genesyscloud_user.go | 2 +- genesyscloud/resource_genesyscloud_user_test.go | 7 +------ ...ce_genesyscloud_routing_utilization_schema.go | 7 ++++--- ...urce_genesyscloud_routing_utilization_test.go | 13 ++++--------- ...enesyscloud_routing_utilization_label_test.go | 7 +------ ...esyscloud_routing_utilization_label_schema.go | 7 ++++--- ...enesyscloud_routing_utilization_label_test.go | 7 +------ ...nesyscloud_routing_utilization_label_utils.go | 16 ---------------- 10 files changed, 19 insertions(+), 53 deletions(-) diff --git a/docs/resources/routing_utilization.md b/docs/resources/routing_utilization.md index b66575c7f..e0f7f239a 100644 --- a/docs/resources/routing_utilization.md +++ b/docs/resources/routing_utilization.md @@ -64,7 +64,7 @@ resource "genesyscloud_routing_utilization" "org-utilization" { - `callback` (Block List, Max: 1) Callback media settings. If not set, this reverts to the default media type settings. (see [below for nested schema](#nestedblock--callback)) - `chat` (Block List, Max: 1) Chat media settings. If not set, this reverts to the default media type settings. (see [below for nested schema](#nestedblock--chat)) - `email` (Block List, Max: 1) Email media settings. If not set, this reverts to the default media type settings. (see [below for nested schema](#nestedblock--email)) -- `label_utilizations` (Block List) Label utilization settings. If not set, default label settings will be applied. This is in PREVIEW and should not be used unless the feature is available to your organization. (see [below for nested schema](#nestedblock--label_utilizations)) +- `label_utilizations` (Block List) Label utilization settings. If not set, default label settings will be applied. (see [below for nested schema](#nestedblock--label_utilizations)) - `message` (Block List, Max: 1) Message media settings. If not set, this reverts to the default media type settings. (see [below for nested schema](#nestedblock--message)) - `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) diff --git a/docs/resources/routing_utilization_label.md b/docs/resources/routing_utilization_label.md index 367e660a4..7714919f7 100644 --- a/docs/resources/routing_utilization_label.md +++ b/docs/resources/routing_utilization_label.md @@ -2,11 +2,11 @@ page_title: "genesyscloud_routing_utilization_label Resource - terraform-provider-genesyscloud" subcategory: "" description: |- - Genesys Cloud Routing Utilization Label. This resource is not yet widely available. Only use it if the feature is enabled. + Genesys Cloud Routing Utilization Label. --- # genesyscloud_routing_utilization_label (Resource) -Genesys Cloud Routing Utilization Label. This resource is not yet widely available. Only use it if the feature is enabled. +Genesys Cloud Routing Utilization Label. ## 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: diff --git a/genesyscloud/resource_genesyscloud_user.go b/genesyscloud/resource_genesyscloud_user.go index 79baca358..c900235a0 100644 --- a/genesyscloud/resource_genesyscloud_user.go +++ b/genesyscloud/resource_genesyscloud_user.go @@ -417,7 +417,7 @@ func ResourceUser() *schema.Resource { Elem: routingUtilization.UtilizationSettingsResource, }, "label_utilizations": { - Description: "Label utilization settings. If not set, default label settings will be applied. This is in PREVIEW and should not be used unless the feature is available to your organization.", + Description: "Label utilization settings. If not set, default label settings will be applied.", Type: schema.TypeList, Optional: true, Computed: true, diff --git a/genesyscloud/resource_genesyscloud_user_test.go b/genesyscloud/resource_genesyscloud_user_test.go index c064114ea..eb0ba0435 100644 --- a/genesyscloud/resource_genesyscloud_user_test.go +++ b/genesyscloud/resource_genesyscloud_user_test.go @@ -864,12 +864,7 @@ func TestAccResourceUserroutingUtilWithLabels(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { - util.TestAccPreCheck(t) - if err := routingUtilizationLabel.CheckIfLabelsAreEnabled(); err != nil { - t.Skipf("%v", err) // be sure to skip the test and not fail it - } - }, + PreCheck: func() { util.TestAccPreCheck(t) }, ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), Steps: []resource.TestStep{ { diff --git a/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_schema.go b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_schema.go index 0ebba6209..6c0a47f6e 100644 --- a/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_schema.go +++ b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_schema.go @@ -2,13 +2,14 @@ package routing_utilization import ( "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "strings" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) const resourceName = "genesyscloud_routing_utilization" @@ -149,7 +150,7 @@ func ResourceRoutingUtilization() *schema.Resource { Elem: UtilizationSettingsResource, }, "label_utilizations": { - Description: "Label utilization settings. If not set, default label settings will be applied. This is in PREVIEW and should not be used unless the feature is available to your organization.", + Description: "Label utilization settings. If not set, default label settings will be applied.", Type: schema.TypeList, Optional: true, Computed: true, diff --git a/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_test.go b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_test.go index 0e5019ce6..9428dc69e 100644 --- a/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_test.go +++ b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_test.go @@ -17,7 +17,7 @@ import ( "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" ) -func TestAccResourceBasicRoutingUtilization(t *testing.T) { +func TestAccResourceRoutingUtilizationBasic(t *testing.T) { t.Parallel() var ( maxCapacity1 = "3" @@ -114,12 +114,7 @@ func TestAccResourceRoutingUtilizationWithLabels(t *testing.T) { } resource.Test(t, resource.TestCase{ - PreCheck: func() { - util.TestAccPreCheck(t) - if err := routingUtilizationLabel.CheckIfLabelsAreEnabled(); err != nil { - t.Skipf("%v", err) // be sure to skip the test and not fail it - } - }, + PreCheck: func() { util.TestAccPreCheck(t) }, ProviderFactories: provider.GetProviderFactories(providerResources, nil), Steps: []resource.TestStep{ { @@ -295,7 +290,7 @@ func CleanupRoutingUtilizationLabel() error { const pageSize = 100 labels, _, getErr := routingAPI.GetRoutingUtilizationLabels(pageSize, pageNum, "", "") if getErr != nil { - log.Printf("failed to get page %v of routing email domains: %v", pageNum, getErr) + log.Printf("failed to get page %v of utilization labels: %v", pageNum, getErr) return getErr } @@ -307,7 +302,7 @@ func CleanupRoutingUtilizationLabel() error { if label.Id != nil && strings.HasPrefix(*label.Name, "Terraform") { _, err := routingAPI.DeleteRoutingUtilizationLabel(*label.Id, true) if err != nil { - log.Printf("Failed to delete routing email domain %s: %s", *label.Id, err) + log.Printf("Failed to delete utilization label %s: %s", *label.Id, err) continue } time.Sleep(5 * time.Second) diff --git a/genesyscloud/routing_utilization_label/data_source_genesyscloud_routing_utilization_label_test.go b/genesyscloud/routing_utilization_label/data_source_genesyscloud_routing_utilization_label_test.go index d30634274..857060d3b 100644 --- a/genesyscloud/routing_utilization_label/data_source_genesyscloud_routing_utilization_label_test.go +++ b/genesyscloud/routing_utilization_label/data_source_genesyscloud_routing_utilization_label_test.go @@ -18,12 +18,7 @@ func TestAccDataSourceRoutingUtilizationLabel(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { - util.TestAccPreCheck(t) - if err := CheckIfLabelsAreEnabled(); err != nil { - t.Skipf("%v", err) // be sure to skip the test and not fail it - } - }, + PreCheck: func() { util.TestAccPreCheck(t) }, ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), Steps: []resource.TestStep{ { diff --git a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_schema.go b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_schema.go index 92761f50a..fb1c7d070 100644 --- a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_schema.go +++ b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_schema.go @@ -1,11 +1,12 @@ package routing_utilization_label import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) const resourceName = "genesyscloud_routing_utilization_label" @@ -19,7 +20,7 @@ func SetRegistrar(regInstance registrar.Registrar) { func ResourceRoutingUtilizationLabel() *schema.Resource { return &schema.Resource{ - Description: "Genesys Cloud Routing Utilization Label. This resource is not yet widely available. Only use it if the feature is enabled.", + Description: "Genesys Cloud Routing Utilization Label.", CreateContext: provider.CreateWithPooledClient(createRoutingUtilizationLabel), ReadContext: provider.ReadWithPooledClient(readRoutingUtilizationLabel), diff --git a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_test.go b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_test.go index 793fb3f3f..afa9af8ce 100644 --- a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_test.go +++ b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_test.go @@ -20,12 +20,7 @@ func TestAccResourceRoutingUtilizationLabelBasic(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { - util.TestAccPreCheck(t) - if err := CheckIfLabelsAreEnabled(); err != nil { - t.Skipf("%v", err) // be sure to skip the test and not fail it - } - }, + PreCheck: func() { util.TestAccPreCheck(t) }, ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), Steps: []resource.TestStep{ { diff --git a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_utils.go b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_utils.go index 22322c59d..dcdae7656 100644 --- a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_utils.go +++ b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_utils.go @@ -2,9 +2,7 @@ package routing_utilization_label import ( "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "strings" - "terraform-provider-genesyscloud/genesyscloud/provider" ) func GenerateRoutingUtilizationLabelResource(resourceID string, name string, dependsOnResource string) string { @@ -21,20 +19,6 @@ func GenerateRoutingUtilizationLabelResource(resourceID string, name string, dep `, resourceID, name, dependsOn) } -func CheckIfLabelsAreEnabled() error { // remove once the feature is globally enabled - sdkConfig, err := provider.AuthorizeSdk() - if err != nil { - return err - } - - api := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - _, resp, _ := api.GetRoutingUtilizationLabels(100, 1, "", "") - if resp.StatusCode == 501 { - return fmt.Errorf("feature is not yet implemented in this org.") - } - return nil -} - func GenerateLabelUtilization( labelResource string, maxCapacity string, From 66d41dc0cbbe26cee4ab9ab5368cb5c18b813511 Mon Sep 17 00:00:00 2001 From: shrutisuryawanshigenesys Date: Wed, 26 Jun 2024 05:33:08 -0400 Subject: [PATCH 31/62] Bug/devtooling 681 - New attributes for IDP (#1122) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Merge Dev to Main for Release v1.41.0 (#1118) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 (#1008) * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.1 to 0.19.2. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.1...v0.19.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * ran go generate --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * DEVTOOLING-352 - provider oauth credential rate limit exceeded (#1004) * Testing something * Adding retry * Fixed retry * Moved functionality to retries package * Fixed inport cycle * Extending sleep * Added retry to AuthorizeSdk * Using with retries * Remving old function * Feat/devtooling 461 - WithRetries errors include improved logging (#1012) * calling diag func * Changed retryable functions to call Diagnostic function * Converted all withRetries errors to have improved wrapper * Made requested Changes * fixing unit test * Bump golang.org/x/net from 0.23.0 to 0.25.0 (#1017) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.25.0. - [Commits](https://github.com/golang/net/compare/v0.23.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix for issue 993 : Changed message_column to optional and add verification logic (#1013) * Changed message_column to optional and add verification logic * applied safer nil value handling * go generate (#1018) * bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1015) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Revert "bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1…" (#1019) This reverts commit 3ff66d472071905b18b4f66f6ee4b3d3725600e7. * bug/devtooling 560 - CX as Code crash when creating phones (#1020) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Made requested Change * feat/devtooling 579 - Improved Logging for Non-API errors (#1021) * Adding improved non-api diag errors * Pulling Merged PR * Added improved error * Added more logging * Ran go vet * Updated docs * Bump hashicorp/setup-terraform from 3.1.0 to 3.1.1 (#1024) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bug/devtooling 362 - Evaluation forms incorrectly assigning published attribute (#1022) * Correctly sets published feature * Added functionality to set published field correctly * Fixed docs * Bug/devtooling 444: Custom resolver function for outbound campaign script_id (#1014) * Resolving campaign script_id to default outbound script data source when appropriate * Created constants package * editing scripts proxy so that the datasource catches Default scripts * Finished writing tests for new campaign field custom resolver * Fixed linting errors in campaigns package * implemented caching for campaigns exporter * minor changes to a comment * Add deleteCacheItem func + some refactoring work * Refactoring call to resolveToDataSource function and added unit test * Fixing script data source test * Bump github.com/nyaruka/phonenumbers from 1.3.4 to 1.3.5 (#1026) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.4 to 1.3.5. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.4...v1.3.5) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Devtooling-162: Refactored idp salesforce (#999) * Refactored idp salesforce * Fixing docs * Changed function name * Removed original file * Changed Build Function Call to fix type difference (#1029) * fixing test for published attribute (#1030) * No jira: fixing up a few acceptance tests (#1031) * fixed journey segment update * Adding check to journey segment tests to validate is feature is supported * preventing panic in export helper function * Adding sleep to milestone data source test * Cleaning up fmt.Print statements appearing in export tests * undoing changes to segment resource file * Fix routing queue (#1028) * README update (#1025) * Pre-verify if the tfState is in sync with the exporter (#1027) * Add state comapartors * Upddate review comments * Devtooling-591: Consistency Checker Refactor (#1032) * Moved where consistency checker is created in resources * Cleaned up consitency checker file * Added resource name to message * Conditionally adding name * Made requested changes * Feature/devtooling 589 1 (#1035) * update doc * fix reviews * Fix acceptance tests - TCA and Prod (#1033) * Fix edge,export,script test,Jenkin to run tca&prod * Fix export & integration tests * Fix auth tests Fix auth tests * fix tests * resolve conflicts * move assignregion func, remove commented function modify to return empty string - assignregion func return default region --------- Co-authored-by: Monisha Padmavathi Ragavan * Bug/devtooling 597 - Routing email route test failing (#1039) * Added call to cleanup function * linter * adding hotfix to pr labeler config file (#1042) * bug/DEVTOOLING-436 - Added cleanup function for webdeployments resources (#1038) * Added cleanup function for webdeployments resources * fixing conflict * Made requested changes * Made requested changes * Bump github.com/hashicorp/terraform-plugin-sdk/v2 from 2.33.0 to 2.34.0 (#1047) Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.33.0 to 2.34.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.33.0...v2.34.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bug/devtooling 287 temp disable cchecker (#1037) * removed consistency checker * changed DID number * phoneUpdated * Merging dev to main for v1.38.0 (#1036) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routin… * added name, slo_uri, slo_binding * added name, relying_party_identifier, slo_uri, slo_binding * updated docs --------- Signed-off-by: dependabot[bot] Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: Charlie Conneely Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> Co-authored-by: sureshperiyappan <61573777+sureshperiyappan@users.noreply.github.com> Co-authored-by: willjeuniaux-genesys <153622483+willjeuniaux-genesys@users.noreply.github.com> Co-authored-by: Will <37446330+williamjeuniaux@users.noreply.github.com> Co-authored-by: Ivan Mikhalchenko Co-authored-by: ivan Co-authored-by: HemanthDogiparthi12 Co-authored-by: Majharul Islam Rafat Co-authored-by: Mohammed Islam Co-authored-by: tsantos-genesys <154342374+tsantos-genesys@users.noreply.github.com> Co-authored-by: Brian Goad --- docs/resources/idp_adfs.md | 2 +- docs/resources/idp_generic.md | 2 +- docs/resources/idp_gsuite.md | 2 +- docs/resources/idp_ping.md | 2 +- .../resource_genesyscloud_idp_adfs.go | 6 ++ .../resource_genesyscloud_idp_adfs_schema.go | 2 +- .../resource_genesyscloud_idp_adfs_test.go | 45 ++++++++++++- ...esource_genesyscloud_idp_generic_schema.go | 2 +- ...resource_genesyscloud_idp_gsuite_schema.go | 2 +- .../resource_genesyscloud_idp_okta.go | 14 ++++- .../resource_genesyscloud_idp_okta_test.go | 63 +++++++++++++++++-- .../resource_genesyscloud_idp_ping_schema.go | 2 +- 12 files changed, 127 insertions(+), 17 deletions(-) diff --git a/docs/resources/idp_adfs.md b/docs/resources/idp_adfs.md index ee0c86fd6..42ce28c9c 100644 --- a/docs/resources/idp_adfs.md +++ b/docs/resources/idp_adfs.md @@ -40,7 +40,7 @@ resource "genesyscloud_idp_adfs" "adfs" { - `name` (String) IDP ADFS resource name - `relying_party_identifier` (String) String used to identify Genesys Cloud to ADFS. - `slo_binding` (String) Valid values: HTTP Redirect, HTTP Post -- `slo_uri` (String) Provided by ADSF on app creation +- `slo_uri` (String) Provided by ADFS on app creation - `target_uri` (String) Target URI provided by ADFS. - `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) diff --git a/docs/resources/idp_generic.md b/docs/resources/idp_generic.md index ccb733b61..0accb0ded 100644 --- a/docs/resources/idp_generic.md +++ b/docs/resources/idp_generic.md @@ -47,7 +47,7 @@ resource "genesyscloud_idp_generic" "generic" { - `name_identifier_format` (String) SAML name identifier format. (urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified | urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress | urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName | urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName | urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos | urn:oasis:names:tc:SAML:2.0:nameid-format:entity | urn:oasis:names:tc:SAML:2.0:nameid-format:persistent | urn:oasis:names:tc:SAML:2.0:nameid-format:transient) Defaults to `urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified`. - `relying_party_identifier` (String) String used to identify Genesys Cloud to the identity provider. - `slo_binding` (String) Valid values: HTTP Redirect, HTTP Post -- `slo_uri` (String) Provided by Okta on app creation. +- `slo_uri` (String) Provided on app creation. - `target_uri` (String) Target URI provided by the provider. - `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) diff --git a/docs/resources/idp_gsuite.md b/docs/resources/idp_gsuite.md index a8881b908..e10fde192 100644 --- a/docs/resources/idp_gsuite.md +++ b/docs/resources/idp_gsuite.md @@ -40,7 +40,7 @@ resource "genesyscloud_idp_gsuite" "gsuite" { - `name` (String) Name of the provider. - `relying_party_identifier` (String) String used to identify Genesys Cloud to GSuite. - `slo_binding` (String) Valid values: HTTP Redirect, HTTP Post -- `slo_uri` (String) Provided by Okta on app creation. +- `slo_uri` (String) Provided on app creation. - `target_uri` (String) Target URI provided by GSuite. - `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) diff --git a/docs/resources/idp_ping.md b/docs/resources/idp_ping.md index 4fc5abe66..827158a7b 100644 --- a/docs/resources/idp_ping.md +++ b/docs/resources/idp_ping.md @@ -40,7 +40,7 @@ resource "genesyscloud_idp_ping" "ping" { - `name` (String) Name of the provider - `relying_party_identifier` (String) String used to identify Genesys Cloud to Ping. - `slo_binding` (String) Valid values: HTTP Redirect, HTTP Post -- `slo_uri` (String) Provided by Okta on app creation. +- `slo_uri` (String) Provided on app creation. - `target_uri` (String) Target URI provided by Ping. - `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) diff --git a/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs.go b/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs.go index cde86dead..bf5166854 100644 --- a/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs.go +++ b/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs.go @@ -69,10 +69,13 @@ func readIdpAdfs(ctx context.Context, d *schema.ResourceData, meta interface{}) return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read IDP ADFS: %s", getErr), resp)) } + resourcedata.SetNillableValue(d, "name", aDFS.Name) resourcedata.SetNillableValue(d, "disabled", aDFS.Disabled) resourcedata.SetNillableValue(d, "issuer_uri", aDFS.IssuerURI) resourcedata.SetNillableValue(d, "target_uri", aDFS.SsoTargetURI) resourcedata.SetNillableValue(d, "relying_party_identifier", aDFS.RelyingPartyIdentifier) + resourcedata.SetNillableValue(d, "slo_uri", aDFS.SloURI) + resourcedata.SetNillableValue(d, "slo_binding", aDFS.SloBinding) if aDFS.Certificate != nil { d.Set("certificates", lists.StringListToInterfaceList([]string{*aDFS.Certificate})) @@ -137,9 +140,12 @@ func deleteIdpAdfs(ctx context.Context, d *schema.ResourceData, meta interface{} // getIdpAdfsFromResourceData maps data from schema ResourceData object to a platformclientv2.Adfs func getIdpAdfsFromResourceData(d *schema.ResourceData) platformclientv2.Adfs { return platformclientv2.Adfs{ + Name: platformclientv2.String(d.Get("name").(string)), Disabled: platformclientv2.Bool(d.Get("disabled").(bool)), IssuerURI: platformclientv2.String(d.Get("issuer_uri").(string)), SsoTargetURI: platformclientv2.String(d.Get("target_uri").(string)), RelyingPartyIdentifier: platformclientv2.String(d.Get("relying_party_identifier").(string)), + SloURI: platformclientv2.String(d.Get("slo_uri").(string)), + SloBinding: platformclientv2.String(d.Get("slo_binding").(string)), } } diff --git a/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_schema.go b/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_schema.go index beb08620b..85e6db742 100644 --- a/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_schema.go +++ b/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_schema.go @@ -67,7 +67,7 @@ func ResourceIdpAdfs() *schema.Resource { Type: schema.TypeString, }, `slo_uri`: { - Description: `Provided by ADSF on app creation`, + Description: `Provided by ADFS on app creation`, Optional: true, Type: schema.TypeString, }, diff --git a/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_test.go b/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_test.go index ef089ab46..d6474dce4 100644 --- a/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_test.go +++ b/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_test.go @@ -7,6 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "testing" + "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" @@ -14,10 +15,14 @@ import ( func TestAccResourceIdpAdfs(t *testing.T) { var ( + name1 = "Test ADFS " + uuid.NewString() uri1 = "https://test.com/1" uri2 = "https://test.com/2" relyingPartyID1 = "test-id1" relyingPartyID2 = "test-id2" + uri3 = "https://example.com" + slo_binding1 = "HTTP Redirect" + slo_binding2 = "HTTP Post" ) resource.Test(t, resource.TestCase{ @@ -27,83 +32,111 @@ func TestAccResourceIdpAdfs(t *testing.T) { { // Create Config: generateIdpAdfsResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1)), uri1, uri2, util.NullValue, // No relying party ID util.NullValue, // Not disabled + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "name", name1), util.ValidateStringInArray("genesyscloud_idp_adfs.adfs", "certificates", util.TestCert1), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "issuer_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "target_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "relying_party_identifier", ""), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "slo_binding", slo_binding1), ), }, { // Update with new values Config: generateIdpAdfsResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert2)), uri2, uri1, strconv.Quote(relyingPartyID1), util.TrueValue, // disabled + uri3, + slo_binding2, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "name", name1), util.ValidateStringInArray("genesyscloud_idp_adfs.adfs", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "relying_party_identifier", relyingPartyID1), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "disabled", util.TrueValue), + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "slo_binding", slo_binding2), ), }, { // Update with multiple certs Config: generateIdpAdfsResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1), strconv.Quote(util.TestCert2)), uri2, uri1, strconv.Quote(relyingPartyID2), util.FalseValue, // disabled + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "name", name1), util.ValidateStringInArray("genesyscloud_idp_adfs.adfs", "certificates", util.TestCert1), util.ValidateStringInArray("genesyscloud_idp_adfs.adfs", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "relying_party_identifier", relyingPartyID2), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "slo_binding", slo_binding1), ), }, { // Update to one cert in array Config: generateIdpAdfsResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1)), uri2, uri1, strconv.Quote(relyingPartyID2), util.FalseValue, // disabled + uri3, + slo_binding2, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "name", name1), util.ValidateStringInArray("genesyscloud_idp_adfs.adfs", "certificates", util.TestCert1), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "certificates.#", "1"), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "relying_party_identifier", relyingPartyID2), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "slo_binding", slo_binding2), ), }, { // Update back to two certs in array Config: generateIdpAdfsResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1), strconv.Quote(util.TestCert2)), uri2, uri1, strconv.Quote(relyingPartyID2), util.FalseValue, // disabled + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "name", name1), util.ValidateStringInArray("genesyscloud_idp_adfs.adfs", "certificates", util.TestCert1), util.ValidateStringInArray("genesyscloud_idp_adfs.adfs", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "certificates.#", "2"), @@ -111,6 +144,8 @@ func TestAccResourceIdpAdfs(t *testing.T) { resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "relying_party_identifier", relyingPartyID2), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "slo_binding", slo_binding1), ), }, { @@ -125,19 +160,25 @@ func TestAccResourceIdpAdfs(t *testing.T) { } func generateIdpAdfsResource( + name string, certs string, issuerURI string, targetURI string, partyID string, - disabled string) string { + disabled string, + sloURI string, + sloBinding string) string { return fmt.Sprintf(`resource "genesyscloud_idp_adfs" "adfs" { + name = "%s" certificates = %s issuer_uri = "%s" target_uri = "%s" relying_party_identifier = %s disabled = %s + slo_uri = "%s" + slo_binding = "%s" } - `, certs, issuerURI, targetURI, partyID, disabled) + `, name, certs, issuerURI, targetURI, partyID, disabled, sloURI, sloBinding) } func testVerifyIdpAdfsDestroyed(state *terraform.State) error { diff --git a/genesyscloud/idp_generic/resource_genesyscloud_idp_generic_schema.go b/genesyscloud/idp_generic/resource_genesyscloud_idp_generic_schema.go index 66d014625..cb5806bca 100644 --- a/genesyscloud/idp_generic/resource_genesyscloud_idp_generic_schema.go +++ b/genesyscloud/idp_generic/resource_genesyscloud_idp_generic_schema.go @@ -67,7 +67,7 @@ func ResourceIdpGeneric() *schema.Resource { Type: schema.TypeString, }, `slo_uri`: { - Description: `Provided by Okta on app creation.`, + Description: `Provided on app creation.`, Optional: true, Type: schema.TypeString, }, diff --git a/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_schema.go b/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_schema.go index ee79a6385..6a9f80034 100644 --- a/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_schema.go +++ b/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_schema.go @@ -67,7 +67,7 @@ func ResourceIdpGsuite() *schema.Resource { Type: schema.TypeString, }, `slo_uri`: { - Description: `Provided by Okta on app creation.`, + Description: `Provided on app creation.`, Optional: true, Type: schema.TypeString, }, diff --git a/genesyscloud/idp_okta/resource_genesyscloud_idp_okta.go b/genesyscloud/idp_okta/resource_genesyscloud_idp_okta.go index 7f0de2a14..3c88ee0d5 100644 --- a/genesyscloud/idp_okta/resource_genesyscloud_idp_okta.go +++ b/genesyscloud/idp_okta/resource_genesyscloud_idp_okta.go @@ -70,9 +70,13 @@ func readIdpOkta(ctx context.Context, d *schema.ResourceData, meta interface{}) cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceIdpOkta(), constants.DefaultConsistencyChecks, "genesyscloud_idp_okta") + resourcedata.SetNillableValue(d, "name", okta.Name) resourcedata.SetNillableValue(d, "disabled", okta.Disabled) resourcedata.SetNillableValue(d, "issuer_uri", okta.IssuerURI) resourcedata.SetNillableValue(d, "target_uri", okta.SsoTargetURI) + resourcedata.SetNillableValue(d, "relying_party_identifier", okta.RelyingPartyIdentifier) + resourcedata.SetNillableValue(d, "slo_uri", okta.SloURI) + resourcedata.SetNillableValue(d, "slo_binding", okta.SloBinding) if okta.Certificate != nil { d.Set("certificates", lists.StringListToInterfaceList([]string{*okta.Certificate})) @@ -140,8 +144,12 @@ func deleteIdpOkta(ctx context.Context, d *schema.ResourceData, meta interface{} // getIdpOktaFromResourceData maps data from schema ResourceData object to a platformclientv2.Okta func getIdpOktaFromResourceData(d *schema.ResourceData) platformclientv2.Okta { return platformclientv2.Okta{ - Disabled: platformclientv2.Bool(d.Get("disabled").(bool)), - IssuerURI: platformclientv2.String(d.Get("issuer_uri").(string)), - SsoTargetURI: platformclientv2.String(d.Get("target_uri").(string)), + Name: platformclientv2.String(d.Get("name").(string)), + Disabled: platformclientv2.Bool(d.Get("disabled").(bool)), + IssuerURI: platformclientv2.String(d.Get("issuer_uri").(string)), + SsoTargetURI: platformclientv2.String(d.Get("target_uri").(string)), + RelyingPartyIdentifier: platformclientv2.String(d.Get("relying_party_identifier").(string)), + SloURI: platformclientv2.String(d.Get("slo_uri").(string)), + SloBinding: platformclientv2.String(d.Get("slo_binding").(string)), } } diff --git a/genesyscloud/idp_okta/resource_genesyscloud_idp_okta_test.go b/genesyscloud/idp_okta/resource_genesyscloud_idp_okta_test.go index 3b2e770aa..c3f924a3f 100644 --- a/genesyscloud/idp_okta/resource_genesyscloud_idp_okta_test.go +++ b/genesyscloud/idp_okta/resource_genesyscloud_idp_okta_test.go @@ -7,6 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "testing" + "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" @@ -14,8 +15,14 @@ import ( func TestAccResourceIdpOkta(t *testing.T) { var ( - uri1 = "https://test.com/1" - uri2 = "https://test.com/2" + name1 = "Test okta " + uuid.NewString() + uri1 = "https://test.com/1" + uri2 = "https://test.com/2" + relyingPartyID1 = "test-id1" + relyingPartyID2 = "test-id2" + uri3 = "https://example.com" + slo_binding1 = "HTTP Redirect" + slo_binding2 = "HTTP Post" ) resource.Test(t, resource.TestCase{ @@ -25,80 +32,120 @@ func TestAccResourceIdpOkta(t *testing.T) { { // Create Config: generateIdpOktaResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1)), uri1, uri2, util.NullValue, // Not disabled + util.NullValue, // No relying party ID + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "name", name1), util.ValidateStringInArray("genesyscloud_idp_okta.okta", "certificates", util.TestCert1), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "issuer_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "target_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "relying_party_identifier", ""), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "slo_binding", slo_binding1), ), }, { // Update with new values Config: generateIdpOktaResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert2)), uri2, uri1, util.TrueValue, // disabled + strconv.Quote(relyingPartyID1), + uri3, + slo_binding2, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "name", name1), util.ValidateStringInArray("genesyscloud_idp_okta.okta", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "disabled", util.TrueValue), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "relying_party_identifier", relyingPartyID1), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "slo_binding", slo_binding2), ), }, { // Update with multiple certs Config: generateIdpOktaResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1), strconv.Quote(util.TestCert2)), uri2, uri1, util.FalseValue, // disabled + strconv.Quote(relyingPartyID2), + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "name", name1), util.ValidateStringInArray("genesyscloud_idp_okta.okta", "certificates", util.TestCert1), util.ValidateStringInArray("genesyscloud_idp_okta.okta", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "relying_party_identifier", relyingPartyID2), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "slo_binding", slo_binding1), ), }, { // Update to one cert in array Config: generateIdpOktaResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1)), uri2, uri1, util.FalseValue, // disabled + strconv.Quote(relyingPartyID2), + uri3, + slo_binding2, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "name", name1), util.ValidateStringInArray("genesyscloud_idp_okta.okta", "certificates", util.TestCert1), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "certificates.#", "1"), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "relying_party_identifier", relyingPartyID2), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "slo_binding", slo_binding2), ), }, { // Update back to two certs in array Config: generateIdpOktaResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1), strconv.Quote(util.TestCert2)), uri2, uri1, util.FalseValue, // disabled + strconv.Quote(relyingPartyID2), + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "name", name1), util.ValidateStringInArray("genesyscloud_idp_okta.okta", "certificates", util.TestCert1), util.ValidateStringInArray("genesyscloud_idp_okta.okta", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "certificates.#", "2"), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "relying_party_identifier", relyingPartyID2), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "slo_binding", slo_binding1), ), }, { @@ -113,17 +160,25 @@ func TestAccResourceIdpOkta(t *testing.T) { } func generateIdpOktaResource( + name string, certs string, issuerURI string, targetURI string, - disabled string) string { + disabled string, + partyID string, + sloURI string, + sloBinding string) string { return fmt.Sprintf(`resource "genesyscloud_idp_okta" "okta" { + name = "%s" certificates = %s issuer_uri = "%s" target_uri = "%s" disabled = %s + relying_party_identifier = %s + slo_uri = "%s" + slo_binding = "%s" } - `, certs, issuerURI, targetURI, disabled) + `, name, certs, issuerURI, targetURI, disabled, partyID, sloURI, sloBinding) } func testVerifyIdpOktaDestroyed(state *terraform.State) error { diff --git a/genesyscloud/idp_ping/resource_genesyscloud_idp_ping_schema.go b/genesyscloud/idp_ping/resource_genesyscloud_idp_ping_schema.go index fbf708089..de778f1c2 100644 --- a/genesyscloud/idp_ping/resource_genesyscloud_idp_ping_schema.go +++ b/genesyscloud/idp_ping/resource_genesyscloud_idp_ping_schema.go @@ -67,7 +67,7 @@ func ResourceIdpPing() *schema.Resource { Type: schema.TypeString, }, `slo_uri`: { - Description: `Provided by Okta on app creation.`, + Description: `Provided on app creation.`, Optional: true, Type: schema.TypeString, }, From ce2433e3ba93b9c87fdf4ac6546bf6c8db0df1c7 Mon Sep 17 00:00:00 2001 From: tsantos-genesys <154342374+tsantos-genesys@users.noreply.github.com> Date: Wed, 26 Jun 2024 11:11:46 +0100 Subject: [PATCH 32/62] Chore/Bump platform-client-sdk-go to v133 (#1119) --- .../data_source_genesyscloud_architect_datatable.go | 2 +- .../resource_genesyscloud_architect_datatable.go | 2 +- .../resource_genesyscloud_architect_datatable_proxy.go | 2 +- .../resource_genesyscloud_architect_datatable_test.go | 2 +- .../genesyscloud_architect_datatable_row_utils.go | 2 +- .../resource_genesyscloud_architect_datatable_row.go | 2 +- ...esource_genesyscloud_architect_datatable_row_proxy.go | 5 +++-- ...resource_genesyscloud_architect_datatable_row_test.go | 2 +- .../genesyscloud_architect_emergencygroup_proxy.go | 3 ++- .../resource_genesyscloud_architect_emergencygroup.go | 2 +- ...esource_genesyscloud_architect_emergencygroup_test.go | 2 +- ...source_genesyscloud_architect_emergencygroup_utils.go | 2 +- .../resource_genesyscloud_architect_flow_proxy.go | 3 ++- .../architect_flow/resource_genesyscloud_flow.go | 2 +- .../architect_flow/resource_genesyscloud_flow_test.go | 2 +- .../genesyscloud_architect_grammar_proxy.go | 2 +- .../resource_genesyscloud_architect_grammar.go | 2 +- .../resource_genesyscloud_architect_grammar_test.go | 2 +- .../genesyscloud_architect_grammar_language_proxy.go | 2 +- .../resource_genesyscloud_architect_grammar_language.go | 2 +- ...ource_genesyscloud_architect_grammar_language_test.go | 2 +- ...urce_genesyscloud_architect_grammar_language_utils.go | 2 +- .../data_source_genesyscloud_architect_ivr_test.go | 2 +- .../architect_ivr/genesyscloud_architect_ivr_proxy.go | 2 +- .../genesyscloud_architect_ivr_proxy_unit_test.go | 2 +- .../architect_ivr/resource_genesyscloud_architect_ivr.go | 2 +- .../resource_genesyscloud_architect_ivr_test.go | 2 +- .../resource_genesyscloud_architect_ivr_unit_test.go | 2 +- .../resource_genesyscloud_architect_ivr_utils.go | 2 +- .../genesyscloud_architect_schedulegroups_proxy.go | 3 ++- .../resource_genesyscloud_architect_schedulegroups.go | 2 +- ...esource_genesyscloud_architect_schedulegroups_test.go | 2 +- .../genesyscloud_architect_schedules_proxy.go | 2 +- .../resource_genesyscloud_architect_schedules.go | 2 +- .../resource_genesyscloud_architect_schedules_test.go | 2 +- .../genesyscloud_architect_user_prompt_proxy.go | 2 +- .../resource_genesyscloud_architect_user_prompt.go | 2 +- .../resource_genesyscloud_architect_user_prompt_test.go | 2 +- .../resource_genesyscloud_architect_user_prompt_utils.go | 2 +- .../auth_role/data_source_genesyscloud_auth_role.go | 9 +++++---- genesyscloud/auth_role/genesyscloud_auth_role_proxy.go | 2 +- .../auth_role/resource_genesyscloud_auth_role.go | 9 +++++---- .../auth_role/resource_genesyscloud_auth_role_test.go | 2 +- .../auth_role/resource_genesyscloud_auth_role_utils.go | 2 +- ...ata_source_genesyscloud_authorization_product_test.go | 2 +- .../genesyscloud_authorization_product_proxy.go | 2 +- .../data_source_genesyscloud_architect_schedules.go | 2 +- genesyscloud/data_source_genesyscloud_auth_division.go | 2 +- .../data_source_genesyscloud_auth_division_home.go | 2 +- .../data_source_genesyscloud_journey_action_map.go | 2 +- .../data_source_genesyscloud_journey_action_template.go | 2 +- genesyscloud/data_source_genesyscloud_journey_outcome.go | 2 +- genesyscloud/data_source_genesyscloud_journey_segment.go | 2 +- .../data_source_genesyscloud_knowledge_category.go | 2 +- .../data_source_genesyscloud_knowledge_knowledgebase.go | 2 +- genesyscloud/data_source_genesyscloud_knowledge_label.go | 2 +- genesyscloud/data_source_genesyscloud_location.go | 2 +- .../data_source_genesyscloud_organizations_me.go | 7 ++++--- .../data_source_genesyscloud_quality_forms_evaluation.go | 2 +- .../data_source_genesyscloud_quality_forms_survey.go | 2 +- .../data_source_genesyscloud_routing_email_domain.go | 2 +- ...data_source_genesyscloud_routing_email_domain_test.go | 2 +- .../data_source_genesyscloud_routing_language.go | 2 +- genesyscloud/data_source_genesyscloud_routing_skill.go | 2 +- .../data_source_genesyscloud_routing_skill_group.go | 9 +++++---- .../data_source_genesyscloud_routing_wrapupcode.go | 2 +- genesyscloud/data_source_genesyscloud_user.go | 2 +- .../data_source_genesyscloud_widget_deployment.go | 2 +- .../genesyscloud_dependent_consumer_proxy.go | 5 +++-- ...loyeeperformance_externalmetrics_definitions_proxy.go | 3 ++- ...ud_employeeperformance_externalmetrics_definitions.go | 7 ++++--- ...ployeeperformance_externalmetrics_definitions_test.go | 2 +- .../genesyscloud_externalcontacts_contact_proxy.go | 2 +- .../resource_genesyscloud_externalcontacts_contact.go | 2 +- ...esource_genesyscloud_externalcontacts_contact_test.go | 2 +- ...source_genesyscloud_externalcontacts_contact_utils.go | 2 +- .../flow_loglevel/genesyscloud_flow_loglevel_proxy.go | 3 ++- .../flow_loglevel/resource_genesyscloud_flow_loglevel.go | 2 +- .../resource_genesyscloud_flow_loglevel_test.go | 9 +++++---- .../flow_milestone/genesyscloud_flow_milestone_proxy.go | 2 +- .../resource_genesyscloud_flow_milestone.go | 2 +- .../resource_genesyscloud_flow_milestone_test.go | 2 +- .../resource_genesyscloud_flow_milestone_utils.go | 2 +- .../flow_outcome/genesyscloud_flow_outcome_proxy.go | 2 +- .../flow_outcome/resource_genesyscloud_flow_outcome.go | 2 +- .../resource_genesyscloud_flow_outcome_utils.go | 2 +- .../group/data_source_genesyscloud_group_test.go | 2 +- genesyscloud/group/genesyscloud_group_proxy.go | 3 ++- genesyscloud/group/resource_genesyscloud_group.go | 2 +- genesyscloud/group/resource_genesyscloud_group_test.go | 2 +- genesyscloud/group/resource_genesyscloud_group_utils.go | 5 +++-- .../group_roles/genesyscloud_group_roles_proxy.go | 2 +- .../resource_genesyscloud_group_roles_schema.go | 2 +- .../resource_genesyscloud_group_roles_utils.go | 2 +- genesyscloud/idp_adfs/genesyscloud_idp_adfs_proxy.go | 2 +- genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs.go | 2 +- .../idp_adfs/resource_genesyscloud_idp_adfs_test.go | 2 +- .../idp_generic/genesyscloud_idp_generic_proxy.go | 2 +- .../idp_generic/resource_genesyscloud_idp_generic.go | 2 +- .../resource_genesyscloud_idp_generic_test.go | 2 +- genesyscloud/idp_gsuite/genesyscloud_idp_gsuite_proxy.go | 2 +- .../idp_gsuite/resource_genesyscloud_idp_gsuite.go | 2 +- .../idp_gsuite/resource_genesyscloud_idp_gsuite_test.go | 2 +- genesyscloud/idp_okta/genesyscloud_idp_okta_proxy.go | 2 +- genesyscloud/idp_okta/resource_genesyscloud_idp_okta.go | 2 +- .../idp_okta/resource_genesyscloud_idp_okta_test.go | 2 +- genesyscloud/idp_ping/genesyscloud_idp_ping_proxy.go | 2 +- genesyscloud/idp_ping/resource_genesyscloud_idp_ping.go | 2 +- .../idp_ping/resource_genesyscloud_idp_ping_test.go | 2 +- .../idp_salesforce/genesyscloud_idp_salesforce_proxy.go | 3 ++- .../resource_genesyscloud_idp_salesforce.go | 9 +++++---- .../resource_genesyscloud_idp_salesforce_test.go | 2 +- .../integration/genesyscloud_integration_proxy.go | 2 +- .../integration/resource_genesyscloud_integration.go | 2 +- .../resource_genesyscloud_integration_test.go | 2 +- .../resource_genesyscloud_integration_utils.go | 2 +- .../genesyscloud_integration_action_proxy.go | 3 ++- .../resource_genesyscloud_integration_action.go | 2 +- .../resource_genesyscloud_integration_action_test.go | 2 +- .../resource_genesyscloud_integration_action_utils.go | 2 +- .../genesyscloud_integration_credential_proxy.go | 2 +- .../resource_genesyscloud_integration_credential.go | 2 +- .../resource_genesyscloud_integration_credential_test.go | 2 +- .../genesyscloud_integration_custom_auth_action_proxy.go | 2 +- ...source_genesyscloud_integration_custom_auth_action.go | 2 +- ...e_genesyscloud_integration_custom_auth_action_test.go | 2 +- ..._genesyscloud_integration_custom_auth_action_utils.go | 2 +- .../genesyscloud_journey_outcome_predictor_proxy.go | 3 ++- .../resource_genesyscloud_journey_outcome_predictor.go | 2 +- ...source_genesyscloud_journey_outcome_predictor_test.go | 2 +- .../journey_views/genesyscloud_journey_views_proxy.go | 3 ++- .../journey_views/resource_genesyscloud_journey_views.go | 9 +++++---- .../resource_genesyscloud_journey_views_test.go | 9 +++++---- .../resource_genesyscloud_journey_views_utils.go | 5 +++-- .../oauth_client/resource_genesyscloud_oauth_client.go | 2 +- .../resource_genesyscloud_oauth_client_proxy.go | 2 +- .../resource_genesyscloud_oauth_client_utils.go | 2 +- .../resource_genesyscloude_oauth_client_unit_test.go | 2 +- ...yscloud_organization_authentication_settings_proxy.go | 3 ++- ..._genesyscloud_organization_authentication_settings.go | 7 ++++--- ...oud_organization_authentication_settings_unit_test.go | 9 +++++---- ...yscloud_organization_authentication_settings_utils.go | 2 +- .../genesyscloud_orgauthorization_pairing_proxy.go | 2 +- .../resource_genesyscloud_orgauthorization_pairing.go | 2 +- .../data_source_genesyscloud_outbound_cattemptlimit.go | 2 +- ...ata_source_genesyscloud_outbound_messagingcampaign.go | 2 +- ...ource_genesyscloud_outbound_messagingcampaign_test.go | 2 +- .../resource_genesyscloud_outbound_messagingcampaign.go | 2 +- ...ource_genesyscloud_outbound_messagingcampaign_test.go | 2 +- .../data_source_genesyscloud_outbound_attemptlimit.go | 2 +- .../resource_genesyscloud_outbound_attemptlimit.go | 2 +- .../resource_genesyscloud_outbound_attemptlimit_test.go | 2 +- .../genesyscloud_outbound_callabletimeset_proxy.go | 2 +- .../resource_genesyscloud_outbound_callabletimeset.go | 2 +- ...esource_genesyscloud_outbound_callabletimeset_test.go | 2 +- ...source_genesyscloud_outbound_callabletimeset_utils.go | 2 +- ...enesyscloud_outbound_callanalysisresponseset_proxy.go | 3 ++- ...urce_genesyscloud_outbound_callanalysisresponseset.go | 9 +++++---- ...genesyscloud_outbound_callanalysisresponseset_test.go | 2 +- ...enesyscloud_outbound_callanalysisresponseset_utils.go | 5 +++-- .../genesyscloud_outbound_campaign_init_test.go | 2 +- .../genesyscloud_outbound_campaign_proxy.go | 2 +- .../resource_genesyscloud_outbound_campaign.go | 2 +- .../resource_genesyscloud_outbound_campaign_test.go | 2 +- .../resource_genesyscloud_outbound_campaign_utils.go | 2 +- .../data_source_genesyscloud_outbound_campaignrule.go | 2 +- .../genesyscloud_outbound_campaignrule_proxy.go | 2 +- .../resource_genesyscloud_outbound_campaignrule.go | 2 +- .../resource_genesyscloud_outbound_campaignrule_test.go | 2 +- ...ource_genesyscloud_outbound_campaignrule_unit_test.go | 2 +- .../resource_genesyscloud_outbound_campaignrule_utils.go | 2 +- .../data_source_genesyscloud_outbound_contactlist.go | 2 +- .../resource_genesyscloud_outbound_contactlist.go | 2 +- .../resource_genesyscloud_outbound_contactlist_test.go | 2 +- .../genesyscloud_outbound_contact_list_contact_proxy.go | 3 ++- ...esource_genesyscloud_outbound_contact_list_contact.go | 9 +++++---- ...e_genesyscloud_outbound_contact_list_contact_utils.go | 5 +++-- .../genesyscloud_outbound_contactlistfilter_proxy.go | 3 ++- .../resource_genesyscloud_outbound_contactlistfilter.go | 9 +++++---- ...ource_genesyscloud_outbound_contactlistfilter_test.go | 2 +- ...urce_genesyscloud_outbound_contactlistfilter_utils.go | 5 +++-- .../genesyscloud_outbound_dnclist_proxy.go | 5 +++-- .../resource_genesyscloud_outbound_dnclist.go | 2 +- .../resource_genesyscloud_outbound_dnclist_test.go | 2 +- ...esyscloud_outbound_filespecificationtemplate_proxy.go | 2 +- ...ce_genesyscloud_outbound_filespecificationtemplate.go | 2 +- ...nesyscloud_outbound_filespecificationtemplate_test.go | 2 +- ...esyscloud_outbound_filespecificationtemplate_utils.go | 5 +++-- .../genesyscloud_outbound_ruleset_proxy.go | 2 +- .../resource_genesyscloud_outbound_ruleset.go | 2 +- .../resource_genesyscloud_outbound_ruleset_test.go | 2 +- .../resource_genesyscloud_outbound_ruleset_unit_test.go | 2 +- .../resource_genesyscloud_outbound_ruleset_utils.go | 2 +- .../genesyscloud_outbound_sequence_init_test.go | 2 +- .../genesyscloud_outbound_sequence_proxy.go | 2 +- .../resource_genesyscloud_outbound_sequence.go | 2 +- .../resource_genesyscloud_outbound_sequence_test.go | 2 +- .../resource_genesyscloud_outbound_sequence_utils.go | 2 +- .../genesyscloud_outbound_settings_proxy.go | 3 ++- .../resource_genesyscloud_outbound_settings.go | 9 +++++---- .../resource_genesyscloud_outbound_settings_utils.go | 5 +++-- .../genesyscloud_wrapupcode_mappings_proxy.go | 2 +- ...ce_genesyscloud_outbound_wrapupcode_mappings_utils.go | 2 +- .../resource_genesyscloud_outbound_wrapupcodemappings.go | 2 +- ...data_source_genesyscloud_processautomation_trigger.go | 2 +- .../process_automation_triggers_proxy.go | 2 +- .../process_automations_triggers_struct.go | 2 +- .../resource_genesyscloud_processautomation_trigger.go | 5 +++-- ...source_genesyscloud_processautomation_trigger_test.go | 2 +- genesyscloud/provider/division.go | 5 +++-- genesyscloud/provider/provider.go | 5 +++-- genesyscloud/provider/sdk_client_pool.go | 2 +- ...yscloud_recording_media_retention_policy_init_test.go | 2 +- ...enesyscloud_recording_media_retention_policy_proxy.go | 2 +- ...urce_genesyscloud_recording_media_retention_policy.go | 2 +- ...genesyscloud_recording_media_retention_policy_test.go | 2 +- ...enesyscloud_recording_media_retention_policy_utils.go | 2 +- genesyscloud/resource_cache/datasource_cache.go | 2 +- genesyscloud/resource_exporter/resource_exporter.go | 9 +++++---- .../resource_exporter/resource_exporter_custom.go | 3 ++- .../resource_genesyscloud_architect_schedules.go | 2 +- genesyscloud/resource_genesyscloud_auth_division.go | 2 +- genesyscloud/resource_genesyscloud_auth_division_test.go | 2 +- genesyscloud/resource_genesyscloud_idp_onelogin.go | 2 +- genesyscloud/resource_genesyscloud_idp_onelogin_test.go | 2 +- genesyscloud/resource_genesyscloud_init_test.go | 2 +- genesyscloud/resource_genesyscloud_journey_action_map.go | 2 +- .../resource_genesyscloud_journey_action_map_test.go | 2 +- .../resource_genesyscloud_journey_action_template.go | 2 +- ...resource_genesyscloud_journey_action_template_test.go | 2 +- genesyscloud/resource_genesyscloud_journey_outcome.go | 2 +- .../resource_genesyscloud_journey_outcome_test.go | 2 +- genesyscloud/resource_genesyscloud_journey_segment.go | 2 +- .../resource_genesyscloud_journey_segment_test.go | 2 +- genesyscloud/resource_genesyscloud_knowledge_category.go | 2 +- .../resource_genesyscloud_knowledge_category_test.go | 2 +- genesyscloud/resource_genesyscloud_knowledge_document.go | 2 +- .../resource_genesyscloud_knowledge_document_test.go | 2 +- ...resource_genesyscloud_knowledge_document_variation.go | 2 +- ...rce_genesyscloud_knowledge_document_variation_test.go | 2 +- .../resource_genesyscloud_knowledge_knowledgebase.go | 2 +- ...resource_genesyscloud_knowledge_knowledgebase_test.go | 2 +- genesyscloud/resource_genesyscloud_knowledge_label.go | 2 +- .../resource_genesyscloud_knowledge_label_test.go | 2 +- .../resource_genesyscloud_knowledge_v1_category.go | 2 +- .../resource_genesyscloud_knowledge_v1_category_test.go | 2 +- .../resource_genesyscloud_knowledge_v1_document.go | 2 +- .../resource_genesyscloud_knowledge_v1_document_test.go | 2 +- genesyscloud/resource_genesyscloud_location.go | 2 +- genesyscloud/resource_genesyscloud_location_test.go | 2 +- .../resource_genesyscloud_quality_forms_evaluation.go | 2 +- ...esource_genesyscloud_quality_forms_evaluation_test.go | 2 +- .../resource_genesyscloud_quality_forms_survey.go | 2 +- .../resource_genesyscloud_quality_forms_survey_test.go | 2 +- .../resource_genesyscloud_routing_email_domain.go | 2 +- .../resource_genesyscloud_routing_email_domain_test.go | 2 +- genesyscloud/resource_genesyscloud_routing_language.go | 2 +- .../resource_genesyscloud_routing_language_test.go | 2 +- genesyscloud/resource_genesyscloud_routing_skill.go | 2 +- .../resource_genesyscloud_routing_skill_group.go | 2 +- .../resource_genesyscloud_routing_skill_group_test.go | 2 +- genesyscloud/resource_genesyscloud_routing_skill_test.go | 2 +- genesyscloud/resource_genesyscloud_routing_wrapupcode.go | 2 +- .../resource_genesyscloud_routing_wrapupcode_test.go | 2 +- genesyscloud/resource_genesyscloud_user.go | 2 +- genesyscloud/resource_genesyscloud_user_test.go | 2 +- genesyscloud/resource_genesyscloud_widget_deployment.go | 2 +- .../resource_genesyscloud_widget_deployment_test.go | 2 +- .../genesyscloud_responsemanagement_library_proxy.go | 3 ++- .../resource_genesyscloud_responsemanagement_library.go | 7 ++++--- ...ource_genesyscloud_responsemanagement_library_test.go | 2 +- .../genesyscloud_responsemanagement_response_proxy.go | 3 ++- .../resource_genesyscloud_responsemanagement_response.go | 9 +++++---- ...urce_genesyscloud_responsemanagement_response_test.go | 2 +- ...rce_genesyscloud_responsemanagement_response_utils.go | 5 +++-- ...enesyscloud_responsemanagement_responseasset_proxy.go | 2 +- ...urce_genesyscloud_responsemanagement_responseasset.go | 9 +++++---- ...genesyscloud_responsemanagement_responseasset_test.go | 2 +- .../genesyscloud_routing_email_route_proxy.go | 2 +- .../resource_genesyscloud_routing_email_route.go | 2 +- .../resource_genesyscloud_routing_email_route_test.go | 2 +- .../resource_genesyscloud_routing_email_route_utils.go | 2 +- .../data_source_genesyscloud_routing_queue.go | 2 +- .../routing_queue/genesyscloud_routing_queue_proxy.go | 2 +- .../routing_queue/resource_genesyscloud_routing_queue.go | 2 +- .../resource_genesyscloud_routing_queue_test.go | 2 +- ...loud_routing_queue_conditional_group_routing_proxy.go | 3 ++- ...nesyscloud_routing_queue_conditional_group_routing.go | 9 +++++---- ...cloud_routing_queue_conditional_group_routing_test.go | 2 +- ..._routing_queue_conditional_group_routing_unit_test.go | 9 +++++---- ...yscloud_routing_queue_outbound_email_address_proxy.go | 3 ++- ..._genesyscloud_routing_queue_outbound_email_address.go | 9 +++++---- ...syscloud_routing_queue_outbound_email_address_test.go | 9 +++++---- ...oud_routing_queue_outbound_email_address_unit_test.go | 9 +++++---- .../genesyscloud_routing_settings_proxy.go | 3 ++- .../resource_genesyscloud_routing_settings.go | 2 +- .../genesyscloud_routing_sms_addresses_proxy.go | 2 +- .../resource_genesyscloud_routing_sms_addresses.go | 2 +- .../resource_genesyscloud_routing_sms_addresses_test.go | 2 +- .../genesyscloud_routing_utilization_proxy.go | 3 ++- .../resource_genesyscloud_routing_utilization.go | 8 +++++--- .../resource_genesyscloud_routing_utilization_test.go | 2 +- .../resource_routing_utilization_utils.go | 5 +++-- .../genesyscloud_routing_utilization_label_proxy.go | 4 ++-- .../resource_genesyscloud_routing_utilization_label.go | 2 +- ...source_genesyscloud_routing_utilization_label_test.go | 2 +- genesyscloud/scripts/genesyscloud_scripts_proxy.go | 2 +- genesyscloud/scripts/resource_genesyscloud_script.go | 2 +- .../scripts/resource_genesyscloud_script_test.go | 2 +- genesyscloud/station/genesyscloud_station_init_test.go | 2 +- genesyscloud/station/genesyscloud_station_proxy.go | 2 +- .../genesyscloud_task_management_workbin_proxy.go | 2 +- .../resource_genesyscloud_task_management_workbin.go | 2 +- ...resource_genesyscloud_task_management_workbin_test.go | 2 +- .../genesyscloud_task_management_workitem_proxy.go | 2 +- .../resource_genesyscloud_task_management_workitem.go | 2 +- ...esource_genesyscloud_task_management_workitem_test.go | 2 +- ...ce_genesyscloud_task_management_workitem_unit_test.go | 2 +- ...source_genesyscloud_task_management_workitem_utils.go | 2 +- ...genesyscloud_task_management_workitem_schema_proxy.go | 2 +- ...ource_genesyscloud_task_management_workitem_schema.go | 2 +- ..._genesyscloud_task_management_workitem_schema_test.go | 2 +- ...syscloud_task_management_workitem_schema_unit_test.go | 2 +- ...genesyscloud_task_management_workitem_schema_utils.go | 2 +- ...data_source_genesyscloud_task_management_unit_test.go | 7 ++++--- .../genesyscloud_task_management_worktype_proxy.go | 2 +- .../resource_genesyscloud_task_management_worktype.go | 2 +- ...esource_genesyscloud_task_management_worktype_test.go | 2 +- ...ce_genesyscloud_task_management_worktype_unit_test.go | 2 +- ...source_genesyscloud_task_management_worktype_utils.go | 2 +- genesyscloud/team/genesyscloud_team_proxy.go | 2 +- genesyscloud/team/resource_genesyscloud_team.go | 2 +- genesyscloud/team/resource_genesyscloud_team_test.go | 7 ++++--- .../team/resource_genesyscloud_team_unit_test.go | 2 +- genesyscloud/team/resource_genesyscloud_team_utils.go | 4 +++- ...scloud_telephony_providers_edges_trunkbasesettings.go | 2 +- ...d_telephony_providers_edges_trunkbasesettings_test.go | 2 +- .../genesyscloud_telephony_providers_edges_did_proxy.go | 2 +- ...esyscloud_telephony_providers_edges_did_pool_proxy.go | 2 +- ...ce_genesyscloud_telephony_providers_edges_did_pool.go | 2 +- ...nesyscloud_telephony_providers_edges_did_pool_test.go | 2 +- ...esyscloud_telephony_providers_edges_did_pool_utils.go | 2 +- ...yscloud_telephony_providers_edges_edge_group_proxy.go | 2 +- ..._genesyscloud_telephony_providers_edges_edge_group.go | 2 +- ...syscloud_telephony_providers_edges_edge_group_test.go | 2 +- ...yscloud_telephony_providers_edges_edge_group_utils.go | 2 +- ...oud_telephony_providers_edges_extension_pool_proxy.go | 2 +- ...esyscloud_telephony_providers_edges_extension_pool.go | 2 +- ...loud_telephony_providers_edges_extension_pool_test.go | 2 +- ...yscloud_telephony_providers_edges_linebasesettings.go | 2 +- ...syscloud_telephony_providers_edges_phone_init_test.go | 2 +- ...genesyscloud_telephony_providers_edges_phone_proxy.go | 2 +- ...ource_genesyscloud_telephony_providers_edges_phone.go | 2 +- ..._genesyscloud_telephony_providers_edges_phone_test.go | 2 +- ...genesyscloud_telephony_providers_edges_phone_utils.go | 2 +- ...scloud_telephony_providers_edges_phonebasesettings.go | 2 +- ..._telephony_providers_edges_phonebasesettings_proxy.go | 2 +- ...scloud_telephony_providers_edges_phonebasesettings.go | 2 +- ...d_telephony_providers_edges_phonebasesettings_test.go | 2 +- ..._telephony_providers_edges_phonebasesettings_utils.go | 2 +- ...e_genesyscloud_telephony_providers_edges_site_test.go | 2 +- .../genesyscloud_telephony_providers_edges_site_proxy.go | 2 +- ...source_genesyscloud_telephony_providers_edges_site.go | 2 +- ...genesyscloud_telephony_providers_edges_site_schema.go | 7 ++++--- ...e_genesyscloud_telephony_providers_edges_site_test.go | 2 +- ..._genesyscloud_telephony_providers_edges_site_utils.go | 2 +- ...hony_providers_edges_site_outbound_route_init_test.go | 5 +++-- ...elephony_providers_edges_site_outbound_route_proxy.go | 3 ++- ...loud_telephony_providers_edges_site_outbound_route.go | 9 +++++---- ...elephony_providers_edges_site_outbound_route_utils.go | 5 +++-- ...ource_genesyscloud_telephony_providers_edges_trunk.go | 2 +- ...genesyscloud_telephony_providers_edges_trunk_proxy.go | 2 +- ...ource_genesyscloud_telephony_providers_edges_trunk.go | 2 +- .../tfexporter/genesyscloud_resource_exporter.go | 2 +- .../tfexporter/genesyscloud_resource_exporter_test.go | 5 +++-- .../tfexporter/resource_genesyscloud_tf_export_test.go | 2 +- genesyscloud/user_roles/genesyscloud_user_roles_proxy.go | 2 +- .../user_roles/resource_genesyscloud_user_roles_utils.go | 2 +- genesyscloud/util/resourcedata/resourcedata.go | 2 +- genesyscloud/util/util_basesetting_properties.go | 2 +- genesyscloud/util/util_diagnostic_unit_test.go | 5 +++-- genesyscloud/util/util_diagnostics.go | 3 ++- genesyscloud/util/util_divisions.go | 2 +- genesyscloud/util/util_domainentities.go | 2 +- genesyscloud/util/util_retries.go | 2 +- .../genesyscloud_webdeployments_configuration_proxy.go | 2 +- ...resource_genesyscloud_webdeployments_configuration.go | 2 +- ...rce_genesyscloud_webdeployments_configuration_test.go | 2 +- ..._genesyscloud_webdeployments_configuration_journey.go | 2 +- ...enesyscloud_webdeployments_configuration_messenger.go | 5 +++-- ...scloud_webdeployments_configuration_support_center.go | 2 +- ...ce_genesyscloud_webdeployments_configuration_utils.go | 2 +- .../genesyscloud_webdeployments_deployment_proxy.go | 7 ++++--- .../resource_genesyscloud_webdeployments_deployment.go | 2 +- ...source_genesyscloud_webdeployments_deployment_test.go | 2 +- ...ource_genesyscloud_webdeployments_deployment_utils.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- 398 files changed, 578 insertions(+), 501 deletions(-) diff --git a/genesyscloud/architect_datatable/data_source_genesyscloud_architect_datatable.go b/genesyscloud/architect_datatable/data_source_genesyscloud_architect_datatable.go index fe8f6f8e6..8ec505d59 100644 --- a/genesyscloud/architect_datatable/data_source_genesyscloud_architect_datatable.go +++ b/genesyscloud/architect_datatable/data_source_genesyscloud_architect_datatable.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func DataSourceArchitectDatatableRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { diff --git a/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable.go b/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable.go index 0aa344ef2..10739a8d2 100644 --- a/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable.go +++ b/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type Datatableproperty struct { diff --git a/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_proxy.go b/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_proxy.go index 9223c15f3..232263a12 100644 --- a/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_proxy.go +++ b/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_proxy.go @@ -6,7 +6,7 @@ import ( "errors" "net/http" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // internalProxy holds a proxy instance that can be used throughout the package diff --git a/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_test.go b/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_test.go index bd6b97a9e..d2df0544c 100644 --- a/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_test.go +++ b/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceArchitectDatatable(t *testing.T) { diff --git a/genesyscloud/architect_datatable_row/genesyscloud_architect_datatable_row_utils.go b/genesyscloud/architect_datatable_row/genesyscloud_architect_datatable_row_utils.go index a346d63de..134f773ad 100644 --- a/genesyscloud/architect_datatable_row/genesyscloud_architect_datatable_row_utils.go +++ b/genesyscloud/architect_datatable_row/genesyscloud_architect_datatable_row_utils.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // Row IDs structured as {table-id}/{key-value} diff --git a/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row.go b/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row.go index 74a126ee4..d75e6d836 100644 --- a/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row.go +++ b/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type Datatableproperty struct { diff --git a/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_proxy.go b/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_proxy.go index 1f94400bc..eddc171ee 100644 --- a/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_proxy.go +++ b/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_proxy.go @@ -4,11 +4,12 @@ import ( "context" "encoding/json" "errors" - "github.com/mitchellh/mapstructure" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "net/http" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" + + "github.com/mitchellh/mapstructure" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // internalProxy holds a proxy instance that can be used throughout the package diff --git a/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_test.go b/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_test.go index 070e1bc05..5a277203b 100644 --- a/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_test.go +++ b/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_test.go @@ -11,7 +11,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceArchitectDatatableRow(t *testing.T) { diff --git a/genesyscloud/architect_emergencygroup/genesyscloud_architect_emergencygroup_proxy.go b/genesyscloud/architect_emergencygroup/genesyscloud_architect_emergencygroup_proxy.go index 01d41745a..d4d565748 100644 --- a/genesyscloud/architect_emergencygroup/genesyscloud_architect_emergencygroup_proxy.go +++ b/genesyscloud/architect_emergencygroup/genesyscloud_architect_emergencygroup_proxy.go @@ -3,7 +3,8 @@ package architect_emergencygroup import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *architectEmergencyGroupProxy diff --git a/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup.go b/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup.go index 9523a2472..e6640bc33 100644 --- a/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup.go +++ b/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllEmergencyGroups(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_test.go b/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_test.go index 0cf52ad50..7be483c9f 100644 --- a/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_test.go +++ b/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceArchitectEmergencyGroups(t *testing.T) { diff --git a/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_utils.go b/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_utils.go index 11ecb8e35..7d57c85ab 100644 --- a/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_utils.go +++ b/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_utils.go @@ -2,7 +2,7 @@ package architect_emergencygroup import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func buildSdkEmergencyGroupCallFlows(d *schema.ResourceData) *[]platformclientv2.Emergencycallflow { diff --git a/genesyscloud/architect_flow/resource_genesyscloud_architect_flow_proxy.go b/genesyscloud/architect_flow/resource_genesyscloud_architect_flow_proxy.go index f0642e4e5..f4a1b6b73 100644 --- a/genesyscloud/architect_flow/resource_genesyscloud_architect_flow_proxy.go +++ b/genesyscloud/architect_flow/resource_genesyscloud_architect_flow_proxy.go @@ -3,9 +3,10 @@ package architect_flow import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *architectFlowProxy diff --git a/genesyscloud/architect_flow/resource_genesyscloud_flow.go b/genesyscloud/architect_flow/resource_genesyscloud_flow.go index 6c70707fd..2ad10f577 100644 --- a/genesyscloud/architect_flow/resource_genesyscloud_flow.go +++ b/genesyscloud/architect_flow/resource_genesyscloud_flow.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllFlows(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/architect_flow/resource_genesyscloud_flow_test.go b/genesyscloud/architect_flow/resource_genesyscloud_flow_test.go index bb721ed40..ddcfb05e4 100644 --- a/genesyscloud/architect_flow/resource_genesyscloud_flow_test.go +++ b/genesyscloud/architect_flow/resource_genesyscloud_flow_test.go @@ -17,7 +17,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // lockFlow will search for a specific flow and then lock it. This is to specifically test the force_unlock flag where I want to create a flow, simulate some one locking it and then attempt to diff --git a/genesyscloud/architect_grammar/genesyscloud_architect_grammar_proxy.go b/genesyscloud/architect_grammar/genesyscloud_architect_grammar_proxy.go index 36c73863d..cd0493219 100644 --- a/genesyscloud/architect_grammar/genesyscloud_architect_grammar_proxy.go +++ b/genesyscloud/architect_grammar/genesyscloud_architect_grammar_proxy.go @@ -6,7 +6,7 @@ import ( "log" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar.go b/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar.go index 6fe8bff54..e7a667976 100644 --- a/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar.go +++ b/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar_test.go b/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar_test.go index 6d81a2d27..a85bf3bd2 100644 --- a/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar_test.go +++ b/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceArchitectGrammar(t *testing.T) { diff --git a/genesyscloud/architect_grammar_language/genesyscloud_architect_grammar_language_proxy.go b/genesyscloud/architect_grammar_language/genesyscloud_architect_grammar_language_proxy.go index 6647b9801..00051d1d7 100644 --- a/genesyscloud/architect_grammar_language/genesyscloud_architect_grammar_language_proxy.go +++ b/genesyscloud/architect_grammar_language/genesyscloud_architect_grammar_language_proxy.go @@ -8,7 +8,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/files" "time" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type FileType int diff --git a/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language.go b/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language.go index b8423f1a4..d1374d9f1 100644 --- a/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language.go +++ b/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_test.go b/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_test.go index 7bc029fd3..bbff62799 100644 --- a/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_test.go +++ b/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_test.go @@ -15,7 +15,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceArchitectGrammarLanguage(t *testing.T) { diff --git a/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_utils.go b/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_utils.go index 97f30023c..b4a6aa530 100644 --- a/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_utils.go +++ b/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_utils.go @@ -13,7 +13,7 @@ import ( "time" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/architect_ivr/data_source_genesyscloud_architect_ivr_test.go b/genesyscloud/architect_ivr/data_source_genesyscloud_architect_ivr_test.go index 97345394d..0fb9de850 100644 --- a/genesyscloud/architect_ivr/data_source_genesyscloud_architect_ivr_test.go +++ b/genesyscloud/architect_ivr/data_source_genesyscloud_architect_ivr_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/stretchr/testify/assert" "github.com/google/uuid" diff --git a/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy.go b/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy.go index fdd8c9c55..096f1fdbf 100644 --- a/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy.go +++ b/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy.go @@ -7,7 +7,7 @@ import ( utillists "terraform-provider-genesyscloud/genesyscloud/util/lists" "time" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy_unit_test.go b/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy_unit_test.go index 9c00434e0..a49095e59 100644 --- a/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy_unit_test.go +++ b/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy_unit_test.go @@ -11,7 +11,7 @@ import ( "testing" "github.com/google/uuid" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestUnitUploadIvrDnisChunksSuccess(t *testing.T) { diff --git a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr.go b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr.go index ab6fb8e76..c90727097 100644 --- a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr.go +++ b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // getAllIvrConfigs retrieves all architect IVRs and is used for the exporter diff --git a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_test.go b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_test.go index 166d0320e..7cb398da0 100644 --- a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_test.go +++ b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceIvrConfigBasic(t *testing.T) { diff --git a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_unit_test.go b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_unit_test.go index b5c97be4b..6b8073966 100644 --- a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_unit_test.go +++ b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_unit_test.go @@ -11,7 +11,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/stretchr/testify/assert" ) diff --git a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_utils.go b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_utils.go index cfe4f8446..4ef23a38a 100644 --- a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_utils.go +++ b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_utils.go @@ -8,7 +8,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type IvrConfigStruct struct { diff --git a/genesyscloud/architect_schedulegroups/genesyscloud_architect_schedulegroups_proxy.go b/genesyscloud/architect_schedulegroups/genesyscloud_architect_schedulegroups_proxy.go index 44bf1b3ee..5072b3500 100644 --- a/genesyscloud/architect_schedulegroups/genesyscloud_architect_schedulegroups_proxy.go +++ b/genesyscloud/architect_schedulegroups/genesyscloud_architect_schedulegroups_proxy.go @@ -3,8 +3,9 @@ package architect_schedulegroups import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups.go b/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups.go index 3b8bd4e45..85805b7a6 100644 --- a/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups.go +++ b/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups_test.go b/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups_test.go index b654c0254..1b2e57d71 100644 --- a/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups_test.go +++ b/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceArchitectScheduleGroups(t *testing.T) { diff --git a/genesyscloud/architect_schedules/genesyscloud_architect_schedules_proxy.go b/genesyscloud/architect_schedules/genesyscloud_architect_schedules_proxy.go index 9fb733127..f19f33763 100644 --- a/genesyscloud/architect_schedules/genesyscloud_architect_schedules_proxy.go +++ b/genesyscloud/architect_schedules/genesyscloud_architect_schedules_proxy.go @@ -6,7 +6,7 @@ import ( "log" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules.go b/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules.go index 7d0c6ba1e..a5b53eba8 100644 --- a/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules.go +++ b/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules.go @@ -19,7 +19,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) const timeFormat = "2006-01-02T15:04:05.000000" diff --git a/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules_test.go b/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules_test.go index f780c8d5e..41821062d 100644 --- a/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules_test.go +++ b/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceArchitectSchedules(t *testing.T) { diff --git a/genesyscloud/architect_user_prompt/genesyscloud_architect_user_prompt_proxy.go b/genesyscloud/architect_user_prompt/genesyscloud_architect_user_prompt_proxy.go index 25ac10cb1..1f0467e5b 100644 --- a/genesyscloud/architect_user_prompt/genesyscloud_architect_user_prompt_proxy.go +++ b/genesyscloud/architect_user_prompt/genesyscloud_architect_user_prompt_proxy.go @@ -4,7 +4,7 @@ import ( "context" "log" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // internalProxy holds a proxy instance that can be used throughout the package diff --git a/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt.go b/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt.go index 6c7a11825..823b8318c 100644 --- a/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt.go +++ b/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllUserPrompts(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_test.go b/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_test.go index 9ed5d9cce..f7c539930 100644 --- a/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_test.go +++ b/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_test.go @@ -16,7 +16,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceUserPromptBasic(t *testing.T) { diff --git a/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_utils.go b/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_utils.go index 615a715c3..5250ed023 100644 --- a/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_utils.go +++ b/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_utils.go @@ -16,7 +16,7 @@ import ( files "terraform-provider-genesyscloud/genesyscloud/util/files" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type PromptAudioData struct { diff --git a/genesyscloud/auth_role/data_source_genesyscloud_auth_role.go b/genesyscloud/auth_role/data_source_genesyscloud_auth_role.go index a5539383f..5bce507ee 100644 --- a/genesyscloud/auth_role/data_source_genesyscloud_auth_role.go +++ b/genesyscloud/auth_role/data_source_genesyscloud_auth_role.go @@ -3,13 +3,14 @@ package auth_role import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/auth_role/genesyscloud_auth_role_proxy.go b/genesyscloud/auth_role/genesyscloud_auth_role_proxy.go index 07200518c..9bd760116 100644 --- a/genesyscloud/auth_role/genesyscloud_auth_role_proxy.go +++ b/genesyscloud/auth_role/genesyscloud_auth_role_proxy.go @@ -6,7 +6,7 @@ import ( rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/auth_role/resource_genesyscloud_auth_role.go b/genesyscloud/auth_role/resource_genesyscloud_auth_role.go index 37b70ee8a..587e91ce9 100644 --- a/genesyscloud/auth_role/resource_genesyscloud_auth_role.go +++ b/genesyscloud/auth_role/resource_genesyscloud_auth_role.go @@ -3,10 +3,6 @@ package auth_role import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -16,6 +12,11 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/lists" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/auth_role/resource_genesyscloud_auth_role_test.go b/genesyscloud/auth_role/resource_genesyscloud_auth_role_test.go index 80782c374..d39dae8cd 100644 --- a/genesyscloud/auth_role/resource_genesyscloud_auth_role_test.go +++ b/genesyscloud/auth_role/resource_genesyscloud_auth_role_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceAuthRoleDefault(t *testing.T) { diff --git a/genesyscloud/auth_role/resource_genesyscloud_auth_role_utils.go b/genesyscloud/auth_role/resource_genesyscloud_auth_role_utils.go index 7efb5f4e1..85375d231 100644 --- a/genesyscloud/auth_role/resource_genesyscloud_auth_role_utils.go +++ b/genesyscloud/auth_role/resource_genesyscloud_auth_role_utils.go @@ -6,7 +6,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func validatePermissionPolicy(proxy *authRoleProxy, policy platformclientv2.Domainpermissionpolicy) (*platformclientv2.APIResponse, error) { diff --git a/genesyscloud/authorization_product/data_source_genesyscloud_authorization_product_test.go b/genesyscloud/authorization_product/data_source_genesyscloud_authorization_product_test.go index f26f62ca5..7629eb42b 100644 --- a/genesyscloud/authorization_product/data_source_genesyscloud_authorization_product_test.go +++ b/genesyscloud/authorization_product/data_source_genesyscloud_authorization_product_test.go @@ -7,7 +7,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/stretchr/testify/assert" "golang.org/x/net/context" diff --git a/genesyscloud/authorization_product/genesyscloud_authorization_product_proxy.go b/genesyscloud/authorization_product/genesyscloud_authorization_product_proxy.go index 0a920b87a..fa0ce1465 100644 --- a/genesyscloud/authorization_product/genesyscloud_authorization_product_proxy.go +++ b/genesyscloud/authorization_product/genesyscloud_authorization_product_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/data_source_genesyscloud_architect_schedules.go b/genesyscloud/data_source_genesyscloud_architect_schedules.go index a1b604725..1d9411608 100644 --- a/genesyscloud/data_source_genesyscloud_architect_schedules.go +++ b/genesyscloud/data_source_genesyscloud_architect_schedules.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func DataSourceSchedule() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_auth_division.go b/genesyscloud/data_source_genesyscloud_auth_division.go index dbf0c9e84..1bdacb2f1 100644 --- a/genesyscloud/data_source_genesyscloud_auth_division.go +++ b/genesyscloud/data_source_genesyscloud_auth_division.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceAuthDivision() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_auth_division_home.go b/genesyscloud/data_source_genesyscloud_auth_division_home.go index bf12bec4b..b49303d31 100644 --- a/genesyscloud/data_source_genesyscloud_auth_division_home.go +++ b/genesyscloud/data_source_genesyscloud_auth_division_home.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func DataSourceAuthDivisionHome() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_journey_action_map.go b/genesyscloud/data_source_genesyscloud_journey_action_map.go index 4f02d9b46..33a8d112f 100644 --- a/genesyscloud/data_source_genesyscloud_journey_action_map.go +++ b/genesyscloud/data_source_genesyscloud_journey_action_map.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceJourneyActionMap() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_journey_action_template.go b/genesyscloud/data_source_genesyscloud_journey_action_template.go index 32f4f93e8..c24b722c3 100644 --- a/genesyscloud/data_source_genesyscloud_journey_action_template.go +++ b/genesyscloud/data_source_genesyscloud_journey_action_template.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceJourneyActionTemplate() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_journey_outcome.go b/genesyscloud/data_source_genesyscloud_journey_outcome.go index ec3473602..9ece86b26 100644 --- a/genesyscloud/data_source_genesyscloud_journey_outcome.go +++ b/genesyscloud/data_source_genesyscloud_journey_outcome.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceJourneyOutcome() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_journey_segment.go b/genesyscloud/data_source_genesyscloud_journey_segment.go index d870635b8..e66ad5fc7 100644 --- a/genesyscloud/data_source_genesyscloud_journey_segment.go +++ b/genesyscloud/data_source_genesyscloud_journey_segment.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceJourneySegment() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_knowledge_category.go b/genesyscloud/data_source_genesyscloud_knowledge_category.go index 27801fee5..c113709fb 100644 --- a/genesyscloud/data_source_genesyscloud_knowledge_category.go +++ b/genesyscloud/data_source_genesyscloud_knowledge_category.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceKnowledgeCategory() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_knowledge_knowledgebase.go b/genesyscloud/data_source_genesyscloud_knowledge_knowledgebase.go index 96f15c63c..24d258401 100644 --- a/genesyscloud/data_source_genesyscloud_knowledge_knowledgebase.go +++ b/genesyscloud/data_source_genesyscloud_knowledge_knowledgebase.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceKnowledgeKnowledgebase() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_knowledge_label.go b/genesyscloud/data_source_genesyscloud_knowledge_label.go index 45312d9d4..bee3cddfe 100644 --- a/genesyscloud/data_source_genesyscloud_knowledge_label.go +++ b/genesyscloud/data_source_genesyscloud_knowledge_label.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceKnowledgeLabel() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_location.go b/genesyscloud/data_source_genesyscloud_location.go index 2063e68b5..611dbdf33 100644 --- a/genesyscloud/data_source_genesyscloud_location.go +++ b/genesyscloud/data_source_genesyscloud_location.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func DataSourceLocation() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_organizations_me.go b/genesyscloud/data_source_genesyscloud_organizations_me.go index fe8a15dbe..018930170 100644 --- a/genesyscloud/data_source_genesyscloud_organizations_me.go +++ b/genesyscloud/data_source_genesyscloud_organizations_me.go @@ -3,11 +3,12 @@ package genesyscloud import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func DataSourceOrganizationsMe() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_quality_forms_evaluation.go b/genesyscloud/data_source_genesyscloud_quality_forms_evaluation.go index a69e74b4a..52aef5fed 100644 --- a/genesyscloud/data_source_genesyscloud_quality_forms_evaluation.go +++ b/genesyscloud/data_source_genesyscloud_quality_forms_evaluation.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type EvaluationFormQuestionGroupStruct struct { diff --git a/genesyscloud/data_source_genesyscloud_quality_forms_survey.go b/genesyscloud/data_source_genesyscloud_quality_forms_survey.go index c3f3d84ae..7c7544614 100644 --- a/genesyscloud/data_source_genesyscloud_quality_forms_survey.go +++ b/genesyscloud/data_source_genesyscloud_quality_forms_survey.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceQualityFormsSurvey() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_routing_email_domain.go b/genesyscloud/data_source_genesyscloud_routing_email_domain.go index 2e9266932..dadf36ac9 100644 --- a/genesyscloud/data_source_genesyscloud_routing_email_domain.go +++ b/genesyscloud/data_source_genesyscloud_routing_email_domain.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // Returns the schema for the routing email domain diff --git a/genesyscloud/data_source_genesyscloud_routing_email_domain_test.go b/genesyscloud/data_source_genesyscloud_routing_email_domain_test.go index f155f18b3..5afcebfd5 100644 --- a/genesyscloud/data_source_genesyscloud_routing_email_domain_test.go +++ b/genesyscloud/data_source_genesyscloud_routing_email_domain_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccDataSourceRoutingEmailDomain(t *testing.T) { diff --git a/genesyscloud/data_source_genesyscloud_routing_language.go b/genesyscloud/data_source_genesyscloud_routing_language.go index eeebd35e8..729080fc8 100644 --- a/genesyscloud/data_source_genesyscloud_routing_language.go +++ b/genesyscloud/data_source_genesyscloud_routing_language.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceRoutingLanguage() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_routing_skill.go b/genesyscloud/data_source_genesyscloud_routing_skill.go index 22bdf02dd..bf82e832d 100644 --- a/genesyscloud/data_source_genesyscloud_routing_skill.go +++ b/genesyscloud/data_source_genesyscloud_routing_skill.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // The context is now added without Timeout , diff --git a/genesyscloud/data_source_genesyscloud_routing_skill_group.go b/genesyscloud/data_source_genesyscloud_routing_skill_group.go index 5bb30ae14..cb5b51cce 100644 --- a/genesyscloud/data_source_genesyscloud_routing_skill_group.go +++ b/genesyscloud/data_source_genesyscloud_routing_skill_group.go @@ -3,13 +3,14 @@ package genesyscloud import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceRoutingSkillGroup() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_routing_wrapupcode.go b/genesyscloud/data_source_genesyscloud_routing_wrapupcode.go index 33d96f72b..c28a387e5 100644 --- a/genesyscloud/data_source_genesyscloud_routing_wrapupcode.go +++ b/genesyscloud/data_source_genesyscloud_routing_wrapupcode.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func DataSourceRoutingWrapupcode() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_user.go b/genesyscloud/data_source_genesyscloud_user.go index 42ce5df10..eb9e5f24a 100644 --- a/genesyscloud/data_source_genesyscloud_user.go +++ b/genesyscloud/data_source_genesyscloud_user.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func DataSourceUser() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_widget_deployment.go b/genesyscloud/data_source_genesyscloud_widget_deployment.go index 31b04b4de..472d8aa7e 100644 --- a/genesyscloud/data_source_genesyscloud_widget_deployment.go +++ b/genesyscloud/data_source_genesyscloud_widget_deployment.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceWidgetDeployments() *schema.Resource { diff --git a/genesyscloud/dependent_consumers/genesyscloud_dependent_consumer_proxy.go b/genesyscloud/dependent_consumers/genesyscloud_dependent_consumer_proxy.go index 1b806376d..5bfaea832 100644 --- a/genesyscloud/dependent_consumers/genesyscloud_dependent_consumer_proxy.go +++ b/genesyscloud/dependent_consumers/genesyscloud_dependent_consumer_proxy.go @@ -4,13 +4,14 @@ import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "strings" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" "terraform-provider-genesyscloud/genesyscloud/util/stringmap" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type DependentConsumerProxy struct { diff --git a/genesyscloud/employeeperformance_externalmetrics_definitions/genesyscloud_employeeperformance_externalmetrics_definitions_proxy.go b/genesyscloud/employeeperformance_externalmetrics_definitions/genesyscloud_employeeperformance_externalmetrics_definitions_proxy.go index 4f123630e..73fe26385 100644 --- a/genesyscloud/employeeperformance_externalmetrics_definitions/genesyscloud_employeeperformance_externalmetrics_definitions_proxy.go +++ b/genesyscloud/employeeperformance_externalmetrics_definitions/genesyscloud_employeeperformance_externalmetrics_definitions_proxy.go @@ -3,8 +3,9 @@ package employeeperformance_externalmetrics_definitions import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions.go b/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions.go index f8ff2b8c8..ff6b02b2c 100644 --- a/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions.go +++ b/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions.go @@ -3,9 +3,6 @@ package employeeperformance_externalmetrics_definitions import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -14,6 +11,10 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" "time" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" + "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" diff --git a/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions_test.go b/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions_test.go index 105eb00e5..d988ab237 100644 --- a/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions_test.go +++ b/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceEmployeePerformanceExternalMetricsDefintions(t *testing.T) { diff --git a/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_proxy.go b/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_proxy.go index f624411ce..4530e2812 100644 --- a/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_proxy.go +++ b/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_proxy.go @@ -7,7 +7,7 @@ import ( rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact.go b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact.go index 98565b2ea..bc0f113fd 100644 --- a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact.go +++ b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_test.go b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_test.go index bf6c6c2b0..31b245525 100644 --- a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_test.go +++ b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_utils.go b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_utils.go index d7b3df901..2c2142ff6 100644 --- a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_utils.go +++ b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_utils.go @@ -5,7 +5,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/nyaruka/phonenumbers" ) diff --git a/genesyscloud/flow_loglevel/genesyscloud_flow_loglevel_proxy.go b/genesyscloud/flow_loglevel/genesyscloud_flow_loglevel_proxy.go index 34437c34a..cd9193470 100644 --- a/genesyscloud/flow_loglevel/genesyscloud_flow_loglevel_proxy.go +++ b/genesyscloud/flow_loglevel/genesyscloud_flow_loglevel_proxy.go @@ -3,7 +3,8 @@ package flow_loglevel import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel.go b/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel.go index 0100e60ae..748ef1fd6 100644 --- a/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel.go +++ b/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel_test.go b/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel_test.go index acbf5cd6f..883241ef7 100644 --- a/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel_test.go +++ b/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel_test.go @@ -2,14 +2,15 @@ package flow_loglevel import ( "fmt" - "github.com/google/uuid" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/architect_flow" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "testing" + + "github.com/google/uuid" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceFlowLogLevel(t *testing.T) { diff --git a/genesyscloud/flow_milestone/genesyscloud_flow_milestone_proxy.go b/genesyscloud/flow_milestone/genesyscloud_flow_milestone_proxy.go index 932a45cc7..e6fc37bc1 100644 --- a/genesyscloud/flow_milestone/genesyscloud_flow_milestone_proxy.go +++ b/genesyscloud/flow_milestone/genesyscloud_flow_milestone_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone.go b/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone.go index b83780b75..67538cb90 100644 --- a/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone.go +++ b/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_test.go b/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_test.go index 2f26afbd0..eedf346fb 100644 --- a/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_test.go +++ b/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceFlowMilestone(t *testing.T) { diff --git a/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_utils.go b/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_utils.go index 46b801e53..78cea07b5 100644 --- a/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_utils.go +++ b/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_utils.go @@ -2,7 +2,7 @@ package flow_milestone import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/flow_outcome/genesyscloud_flow_outcome_proxy.go b/genesyscloud/flow_outcome/genesyscloud_flow_outcome_proxy.go index 4aa3507bc..b2790b6bc 100644 --- a/genesyscloud/flow_outcome/genesyscloud_flow_outcome_proxy.go +++ b/genesyscloud/flow_outcome/genesyscloud_flow_outcome_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome.go b/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome.go index b36bf8781..89037d9ad 100644 --- a/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome.go +++ b/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome_utils.go b/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome_utils.go index efde6651e..2d143eb77 100644 --- a/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome_utils.go +++ b/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome_utils.go @@ -2,7 +2,7 @@ package flow_outcome import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/group/data_source_genesyscloud_group_test.go b/genesyscloud/group/data_source_genesyscloud_group_test.go index f69c4f037..548649fc7 100644 --- a/genesyscloud/group/data_source_genesyscloud_group_test.go +++ b/genesyscloud/group/data_source_genesyscloud_group_test.go @@ -10,7 +10,7 @@ import ( "time" "github.com/google/uuid" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" diff --git a/genesyscloud/group/genesyscloud_group_proxy.go b/genesyscloud/group/genesyscloud_group_proxy.go index 956ba6d43..a6a380c1a 100644 --- a/genesyscloud/group/genesyscloud_group_proxy.go +++ b/genesyscloud/group/genesyscloud_group_proxy.go @@ -3,8 +3,9 @@ package group import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *groupProxy diff --git a/genesyscloud/group/resource_genesyscloud_group.go b/genesyscloud/group/resource_genesyscloud_group.go index 60faa5abc..2aa146fd4 100644 --- a/genesyscloud/group/resource_genesyscloud_group.go +++ b/genesyscloud/group/resource_genesyscloud_group.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func GetAllGroups(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/group/resource_genesyscloud_group_test.go b/genesyscloud/group/resource_genesyscloud_group_test.go index f9658b391..17a022b04 100644 --- a/genesyscloud/group/resource_genesyscloud_group_test.go +++ b/genesyscloud/group/resource_genesyscloud_group_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceGroupBasic(t *testing.T) { diff --git a/genesyscloud/group/resource_genesyscloud_group_utils.go b/genesyscloud/group/resource_genesyscloud_group_utils.go index b7b5652fe..1c93548fd 100644 --- a/genesyscloud/group/resource_genesyscloud_group_utils.go +++ b/genesyscloud/group/resource_genesyscloud_group_utils.go @@ -2,12 +2,13 @@ package group import ( "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "strings" "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // 'number' and 'extension' conflict with eachother. However, one must be set. diff --git a/genesyscloud/group_roles/genesyscloud_group_roles_proxy.go b/genesyscloud/group_roles/genesyscloud_group_roles_proxy.go index 87cb8703e..c868fe9c5 100644 --- a/genesyscloud/group_roles/genesyscloud_group_roles_proxy.go +++ b/genesyscloud/group_roles/genesyscloud_group_roles_proxy.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *groupRolesProxy diff --git a/genesyscloud/group_roles/resource_genesyscloud_group_roles_schema.go b/genesyscloud/group_roles/resource_genesyscloud_group_roles_schema.go index 7adf536f1..734573648 100644 --- a/genesyscloud/group_roles/resource_genesyscloud_group_roles_schema.go +++ b/genesyscloud/group_roles/resource_genesyscloud_group_roles_schema.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" diff --git a/genesyscloud/group_roles/resource_genesyscloud_group_roles_utils.go b/genesyscloud/group_roles/resource_genesyscloud_group_roles_utils.go index d1ecb34c9..3a9940d33 100644 --- a/genesyscloud/group_roles/resource_genesyscloud_group_roles_utils.go +++ b/genesyscloud/group_roles/resource_genesyscloud_group_roles_utils.go @@ -7,7 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func flattenSubjectRoles(d *schema.ResourceData, p *groupRolesProxy) (*schema.Set, *platformclientv2.APIResponse, error) { diff --git a/genesyscloud/idp_adfs/genesyscloud_idp_adfs_proxy.go b/genesyscloud/idp_adfs/genesyscloud_idp_adfs_proxy.go index a1825f1c1..d2284ab71 100644 --- a/genesyscloud/idp_adfs/genesyscloud_idp_adfs_proxy.go +++ b/genesyscloud/idp_adfs/genesyscloud_idp_adfs_proxy.go @@ -3,7 +3,7 @@ package idp_adfs import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs.go b/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs.go index bf5166854..c747406f9 100644 --- a/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs.go +++ b/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_test.go b/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_test.go index d6474dce4..2f77a11f2 100644 --- a/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_test.go +++ b/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceIdpAdfs(t *testing.T) { diff --git a/genesyscloud/idp_generic/genesyscloud_idp_generic_proxy.go b/genesyscloud/idp_generic/genesyscloud_idp_generic_proxy.go index a08d52f0c..8aeda9acc 100644 --- a/genesyscloud/idp_generic/genesyscloud_idp_generic_proxy.go +++ b/genesyscloud/idp_generic/genesyscloud_idp_generic_proxy.go @@ -3,7 +3,7 @@ package idp_generic import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/idp_generic/resource_genesyscloud_idp_generic.go b/genesyscloud/idp_generic/resource_genesyscloud_idp_generic.go index 83121add0..a72f05274 100644 --- a/genesyscloud/idp_generic/resource_genesyscloud_idp_generic.go +++ b/genesyscloud/idp_generic/resource_genesyscloud_idp_generic.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/idp_generic/resource_genesyscloud_idp_generic_test.go b/genesyscloud/idp_generic/resource_genesyscloud_idp_generic_test.go index 1662fc6f8..fa9a266f9 100644 --- a/genesyscloud/idp_generic/resource_genesyscloud_idp_generic_test.go +++ b/genesyscloud/idp_generic/resource_genesyscloud_idp_generic_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceIdpGeneric(t *testing.T) { diff --git a/genesyscloud/idp_gsuite/genesyscloud_idp_gsuite_proxy.go b/genesyscloud/idp_gsuite/genesyscloud_idp_gsuite_proxy.go index c7c804470..820b555d5 100644 --- a/genesyscloud/idp_gsuite/genesyscloud_idp_gsuite_proxy.go +++ b/genesyscloud/idp_gsuite/genesyscloud_idp_gsuite_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite.go b/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite.go index 1b4128fbf..e9b32c0e3 100644 --- a/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite.go +++ b/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_test.go b/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_test.go index d62c45dbf..c93f1a188 100644 --- a/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_test.go +++ b/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceIdpGsuite(t *testing.T) { diff --git a/genesyscloud/idp_okta/genesyscloud_idp_okta_proxy.go b/genesyscloud/idp_okta/genesyscloud_idp_okta_proxy.go index 1af69517d..252806870 100644 --- a/genesyscloud/idp_okta/genesyscloud_idp_okta_proxy.go +++ b/genesyscloud/idp_okta/genesyscloud_idp_okta_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/idp_okta/resource_genesyscloud_idp_okta.go b/genesyscloud/idp_okta/resource_genesyscloud_idp_okta.go index 3c88ee0d5..b4b1517f5 100644 --- a/genesyscloud/idp_okta/resource_genesyscloud_idp_okta.go +++ b/genesyscloud/idp_okta/resource_genesyscloud_idp_okta.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/constants" "terraform-provider-genesyscloud/genesyscloud/util/lists" diff --git a/genesyscloud/idp_okta/resource_genesyscloud_idp_okta_test.go b/genesyscloud/idp_okta/resource_genesyscloud_idp_okta_test.go index c3f924a3f..003b2f2f6 100644 --- a/genesyscloud/idp_okta/resource_genesyscloud_idp_okta_test.go +++ b/genesyscloud/idp_okta/resource_genesyscloud_idp_okta_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceIdpOkta(t *testing.T) { diff --git a/genesyscloud/idp_ping/genesyscloud_idp_ping_proxy.go b/genesyscloud/idp_ping/genesyscloud_idp_ping_proxy.go index 2fb2e6a55..2c9fc61db 100644 --- a/genesyscloud/idp_ping/genesyscloud_idp_ping_proxy.go +++ b/genesyscloud/idp_ping/genesyscloud_idp_ping_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/idp_ping/resource_genesyscloud_idp_ping.go b/genesyscloud/idp_ping/resource_genesyscloud_idp_ping.go index c6bc5cc6d..7fb4ba610 100644 --- a/genesyscloud/idp_ping/resource_genesyscloud_idp_ping.go +++ b/genesyscloud/idp_ping/resource_genesyscloud_idp_ping.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/idp_ping/resource_genesyscloud_idp_ping_test.go b/genesyscloud/idp_ping/resource_genesyscloud_idp_ping_test.go index 1a56474ca..68f07dc76 100644 --- a/genesyscloud/idp_ping/resource_genesyscloud_idp_ping_test.go +++ b/genesyscloud/idp_ping/resource_genesyscloud_idp_ping_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceIdpPing(t *testing.T) { diff --git a/genesyscloud/idp_salesforce/genesyscloud_idp_salesforce_proxy.go b/genesyscloud/idp_salesforce/genesyscloud_idp_salesforce_proxy.go index 0610597c8..12d674558 100644 --- a/genesyscloud/idp_salesforce/genesyscloud_idp_salesforce_proxy.go +++ b/genesyscloud/idp_salesforce/genesyscloud_idp_salesforce_proxy.go @@ -2,7 +2,8 @@ package idp_salesforce import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce.go b/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce.go index eadc684c1..7408150da 100644 --- a/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce.go +++ b/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce.go @@ -3,10 +3,6 @@ package idp_salesforce import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -16,6 +12,11 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/lists" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce_test.go b/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce_test.go index d891e5601..2d5e43a9a 100644 --- a/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce_test.go +++ b/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceIdpSalesforce(t *testing.T) { diff --git a/genesyscloud/integration/genesyscloud_integration_proxy.go b/genesyscloud/integration/genesyscloud_integration_proxy.go index 5f40e21a4..d88f700c7 100644 --- a/genesyscloud/integration/genesyscloud_integration_proxy.go +++ b/genesyscloud/integration/genesyscloud_integration_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/integration/resource_genesyscloud_integration.go b/genesyscloud/integration/resource_genesyscloud_integration.go index d164f75a6..e801c945b 100644 --- a/genesyscloud/integration/resource_genesyscloud_integration.go +++ b/genesyscloud/integration/resource_genesyscloud_integration.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/integration/resource_genesyscloud_integration_test.go b/genesyscloud/integration/resource_genesyscloud_integration_test.go index 4f0476236..41a195fd3 100644 --- a/genesyscloud/integration/resource_genesyscloud_integration_test.go +++ b/genesyscloud/integration/resource_genesyscloud_integration_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/integration/resource_genesyscloud_integration_utils.go b/genesyscloud/integration/resource_genesyscloud_integration_utils.go index b28c17d00..24e2b6385 100644 --- a/genesyscloud/integration/resource_genesyscloud_integration_utils.go +++ b/genesyscloud/integration/resource_genesyscloud_integration_utils.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/integration_action/genesyscloud_integration_action_proxy.go b/genesyscloud/integration_action/genesyscloud_integration_action_proxy.go index bc7f7591a..2f6fbffce 100644 --- a/genesyscloud/integration_action/genesyscloud_integration_action_proxy.go +++ b/genesyscloud/integration_action/genesyscloud_integration_action_proxy.go @@ -4,8 +4,9 @@ import ( "context" "encoding/json" "errors" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "net/http" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/integration_action/resource_genesyscloud_integration_action.go b/genesyscloud/integration_action/resource_genesyscloud_integration_action.go index b2d9139c9..7ba76039e 100644 --- a/genesyscloud/integration_action/resource_genesyscloud_integration_action.go +++ b/genesyscloud/integration_action/resource_genesyscloud_integration_action.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/integration_action/resource_genesyscloud_integration_action_test.go b/genesyscloud/integration_action/resource_genesyscloud_integration_action_test.go index 24fe588ff..5f5cf9478 100644 --- a/genesyscloud/integration_action/resource_genesyscloud_integration_action_test.go +++ b/genesyscloud/integration_action/resource_genesyscloud_integration_action_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/integration_action/resource_genesyscloud_integration_action_utils.go b/genesyscloud/integration_action/resource_genesyscloud_integration_action_utils.go index f74621600..7d6362e49 100644 --- a/genesyscloud/integration_action/resource_genesyscloud_integration_action_utils.go +++ b/genesyscloud/integration_action/resource_genesyscloud_integration_action_utils.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" ) diff --git a/genesyscloud/integration_credential/genesyscloud_integration_credential_proxy.go b/genesyscloud/integration_credential/genesyscloud_integration_credential_proxy.go index 31f0da8df..f74d2148f 100644 --- a/genesyscloud/integration_credential/genesyscloud_integration_credential_proxy.go +++ b/genesyscloud/integration_credential/genesyscloud_integration_credential_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/integration_credential/resource_genesyscloud_integration_credential.go b/genesyscloud/integration_credential/resource_genesyscloud_integration_credential.go index e82c6ca79..f0cae5e89 100644 --- a/genesyscloud/integration_credential/resource_genesyscloud_integration_credential.go +++ b/genesyscloud/integration_credential/resource_genesyscloud_integration_credential.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_test.go b/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_test.go index f401541ac..2b3c6ca3c 100644 --- a/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_test.go +++ b/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/integration_custom_auth_action/genesyscloud_integration_custom_auth_action_proxy.go b/genesyscloud/integration_custom_auth_action/genesyscloud_integration_custom_auth_action_proxy.go index dda4e4553..a38118540 100644 --- a/genesyscloud/integration_custom_auth_action/genesyscloud_integration_custom_auth_action_proxy.go +++ b/genesyscloud/integration_custom_auth_action/genesyscloud_integration_custom_auth_action_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "strings" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action.go b/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action.go index 8839fee9b..6e33849ea 100644 --- a/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action.go +++ b/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_test.go b/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_test.go index 3d2e51163..9e9ec4361 100644 --- a/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_test.go +++ b/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_test.go @@ -15,7 +15,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type customAuthActionResource struct { diff --git a/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_utils.go b/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_utils.go index 209c4e24d..0dc80f639 100644 --- a/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_utils.go +++ b/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_utils.go @@ -6,7 +6,7 @@ import ( integrationAction "terraform-provider-genesyscloud/genesyscloud/integration_action" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/journey_outcome_predictor/genesyscloud_journey_outcome_predictor_proxy.go b/genesyscloud/journey_outcome_predictor/genesyscloud_journey_outcome_predictor_proxy.go index e5846292b..6d1a11ce6 100644 --- a/genesyscloud/journey_outcome_predictor/genesyscloud_journey_outcome_predictor_proxy.go +++ b/genesyscloud/journey_outcome_predictor/genesyscloud_journey_outcome_predictor_proxy.go @@ -2,7 +2,8 @@ package journey_outcome_predictor import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor.go b/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor.go index cda54b354..ba39ce936 100644 --- a/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor.go +++ b/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor_test.go b/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor_test.go index 98872d160..fdcbbd1ec 100644 --- a/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor_test.go +++ b/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceJourneyOutcomePredictor(t *testing.T) { diff --git a/genesyscloud/journey_views/genesyscloud_journey_views_proxy.go b/genesyscloud/journey_views/genesyscloud_journey_views_proxy.go index 4964990b3..5503209a0 100644 --- a/genesyscloud/journey_views/genesyscloud_journey_views_proxy.go +++ b/genesyscloud/journey_views/genesyscloud_journey_views_proxy.go @@ -2,8 +2,9 @@ package journey_views import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *journeyViewsProxy diff --git a/genesyscloud/journey_views/resource_genesyscloud_journey_views.go b/genesyscloud/journey_views/resource_genesyscloud_journey_views.go index 2d6b4f702..2ec96bddd 100644 --- a/genesyscloud/journey_views/resource_genesyscloud_journey_views.go +++ b/genesyscloud/journey_views/resource_genesyscloud_journey_views.go @@ -3,10 +3,6 @@ package journey_views import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -14,6 +10,11 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func createJourneyView(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { diff --git a/genesyscloud/journey_views/resource_genesyscloud_journey_views_test.go b/genesyscloud/journey_views/resource_genesyscloud_journey_views_test.go index 8116ced64..6e0588a7e 100644 --- a/genesyscloud/journey_views/resource_genesyscloud_journey_views_test.go +++ b/genesyscloud/journey_views/resource_genesyscloud_journey_views_test.go @@ -2,14 +2,15 @@ package journey_views import ( "fmt" - "github.com/google/uuid" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "strings" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "testing" + + "github.com/google/uuid" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceJourneyViewsBasic(t *testing.T) { diff --git a/genesyscloud/journey_views/resource_genesyscloud_journey_views_utils.go b/genesyscloud/journey_views/resource_genesyscloud_journey_views_utils.go index 7c8254f7d..a6e3b35fb 100644 --- a/genesyscloud/journey_views/resource_genesyscloud_journey_views_utils.go +++ b/genesyscloud/journey_views/resource_genesyscloud_journey_views_utils.go @@ -2,9 +2,10 @@ package journey_views import ( "errors" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func buildElements(d *schema.ResourceData) (*[]platformclientv2.Journeyviewelement, error) { diff --git a/genesyscloud/oauth_client/resource_genesyscloud_oauth_client.go b/genesyscloud/oauth_client/resource_genesyscloud_oauth_client.go index 851bf78cc..3693ad9a0 100644 --- a/genesyscloud/oauth_client/resource_genesyscloud_oauth_client.go +++ b/genesyscloud/oauth_client/resource_genesyscloud_oauth_client.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllOAuthClients(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_proxy.go b/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_proxy.go index f4b0416f6..673342dc7 100644 --- a/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_proxy.go +++ b/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_proxy.go @@ -5,7 +5,7 @@ import ( "log" "sync" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *oauthClientProxy diff --git a/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_utils.go b/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_utils.go index dcdacc228..ef33c44ea 100644 --- a/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_utils.go +++ b/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_utils.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func buildOAuthRedirectURIs(d *schema.ResourceData) *[]string { diff --git a/genesyscloud/oauth_client/resource_genesyscloude_oauth_client_unit_test.go b/genesyscloud/oauth_client/resource_genesyscloude_oauth_client_unit_test.go index 2f8b9e9fb..f4a20d830 100644 --- a/genesyscloud/oauth_client/resource_genesyscloude_oauth_client_unit_test.go +++ b/genesyscloud/oauth_client/resource_genesyscloude_oauth_client_unit_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/stretchr/testify/assert" ) diff --git a/genesyscloud/organization_authentication_settings/genesyscloud_organization_authentication_settings_proxy.go b/genesyscloud/organization_authentication_settings/genesyscloud_organization_authentication_settings_proxy.go index bd316f7db..b4a1f3920 100644 --- a/genesyscloud/organization_authentication_settings/genesyscloud_organization_authentication_settings_proxy.go +++ b/genesyscloud/organization_authentication_settings/genesyscloud_organization_authentication_settings_proxy.go @@ -3,7 +3,8 @@ package organization_authentication_settings import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings.go b/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings.go index 00e0e5f2f..18f951c6b 100644 --- a/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings.go +++ b/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings.go @@ -3,9 +3,6 @@ package organization_authentication_settings import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -13,6 +10,10 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/constants" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" + "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" diff --git a/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_unit_test.go b/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_unit_test.go index 2d65d7a8b..6d9e2a9c3 100644 --- a/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_unit_test.go +++ b/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_unit_test.go @@ -2,14 +2,15 @@ package organization_authentication_settings import ( "context" + "net/http" + "terraform-provider-genesyscloud/genesyscloud/provider" + "testing" + "github.com/google/go-cmp/cmp" "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/stretchr/testify/assert" - "net/http" - "terraform-provider-genesyscloud/genesyscloud/provider" - "testing" ) // Unit Test diff --git a/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_utils.go b/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_utils.go index d981238fd..cdd63df6a 100644 --- a/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_utils.go +++ b/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_utils.go @@ -5,7 +5,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/orgauthorization_pairing/genesyscloud_orgauthorization_pairing_proxy.go b/genesyscloud/orgauthorization_pairing/genesyscloud_orgauthorization_pairing_proxy.go index 5cfb68125..dda0b1368 100644 --- a/genesyscloud/orgauthorization_pairing/genesyscloud_orgauthorization_pairing_proxy.go +++ b/genesyscloud/orgauthorization_pairing/genesyscloud_orgauthorization_pairing_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *orgauthorizationPairingProxy diff --git a/genesyscloud/orgauthorization_pairing/resource_genesyscloud_orgauthorization_pairing.go b/genesyscloud/orgauthorization_pairing/resource_genesyscloud_orgauthorization_pairing.go index 5f4bc6923..87c15d137 100644 --- a/genesyscloud/orgauthorization_pairing/resource_genesyscloud_orgauthorization_pairing.go +++ b/genesyscloud/orgauthorization_pairing/resource_genesyscloud_orgauthorization_pairing.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func createOrgauthorizationPairing(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { diff --git a/genesyscloud/outbound/data_source_genesyscloud_outbound_cattemptlimit.go b/genesyscloud/outbound/data_source_genesyscloud_outbound_cattemptlimit.go index 25a84f122..a76adebbc 100644 --- a/genesyscloud/outbound/data_source_genesyscloud_outbound_cattemptlimit.go +++ b/genesyscloud/outbound/data_source_genesyscloud_outbound_cattemptlimit.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func DataSourceOutboundAttemptLimit() *schema.Resource { diff --git a/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign.go b/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign.go index 391bbdbf2..a6b3bae39 100644 --- a/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign.go +++ b/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceOutboundMessagingcampaign() *schema.Resource { diff --git a/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign_test.go b/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign_test.go index a95ebc65b..56192696e 100644 --- a/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign_test.go +++ b/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var TrueValue = "true" diff --git a/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign.go b/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign.go index b497d5851..1c1a11c11 100644 --- a/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign.go +++ b/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) const ( diff --git a/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign_test.go b/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign_test.go index c0d206474..7f4e83de3 100644 --- a/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign_test.go +++ b/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" obCallableTimeset "terraform-provider-genesyscloud/genesyscloud/outbound_callabletimeset" obContactList "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list" diff --git a/genesyscloud/outbound_attempt_limit/data_source_genesyscloud_outbound_attemptlimit.go b/genesyscloud/outbound_attempt_limit/data_source_genesyscloud_outbound_attemptlimit.go index 1d330796b..36308b5a8 100644 --- a/genesyscloud/outbound_attempt_limit/data_source_genesyscloud_outbound_attemptlimit.go +++ b/genesyscloud/outbound_attempt_limit/data_source_genesyscloud_outbound_attemptlimit.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func DataSourceOutboundAttemptLimit() *schema.Resource { diff --git a/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit.go b/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit.go index febb736c6..501055d4f 100644 --- a/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit.go +++ b/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) const ( diff --git a/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit_test.go b/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit_test.go index d9d1292be..53880070f 100644 --- a/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit_test.go +++ b/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // func init() { diff --git a/genesyscloud/outbound_callabletimeset/genesyscloud_outbound_callabletimeset_proxy.go b/genesyscloud/outbound_callabletimeset/genesyscloud_outbound_callabletimeset_proxy.go index 96f564262..9e07b4c83 100644 --- a/genesyscloud/outbound_callabletimeset/genesyscloud_outbound_callabletimeset_proxy.go +++ b/genesyscloud/outbound_callabletimeset/genesyscloud_outbound_callabletimeset_proxy.go @@ -6,7 +6,7 @@ import ( "log" "strings" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset.go b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset.go index c9eb25331..3252e41c7 100644 --- a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset.go +++ b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_test.go b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_test.go index 12f28a9d2..f899b1fea 100644 --- a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_test.go +++ b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceOutboundCallabletimeset(t *testing.T) { diff --git a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_utils.go b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_utils.go index acba89881..7186d9656 100644 --- a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_utils.go +++ b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_utils.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_callanalysisresponseset/genesyscloud_outbound_callanalysisresponseset_proxy.go b/genesyscloud/outbound_callanalysisresponseset/genesyscloud_outbound_callanalysisresponseset_proxy.go index 5eded85c3..d2be5cd95 100644 --- a/genesyscloud/outbound_callanalysisresponseset/genesyscloud_outbound_callanalysisresponseset_proxy.go +++ b/genesyscloud/outbound_callanalysisresponseset/genesyscloud_outbound_callanalysisresponseset_proxy.go @@ -3,8 +3,9 @@ package outbound_callanalysisresponseset import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset.go b/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset.go index 90744ea1f..4a78aa3ef 100644 --- a/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset.go +++ b/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset.go @@ -3,10 +3,6 @@ package outbound_callanalysisresponseset import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -15,6 +11,11 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_test.go b/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_test.go index 74cd9f5fd..7083040f3 100644 --- a/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_test.go +++ b/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceOutboundCallAnalysisResponseSet(t *testing.T) { diff --git a/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_utils.go b/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_utils.go index d48a46401..766684c0d 100644 --- a/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_utils.go +++ b/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_utils.go @@ -2,10 +2,11 @@ package outbound_callanalysisresponseset import ( "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "strings" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getResponseSetFromResourceData(d *schema.ResourceData) platformclientv2.Responseset { diff --git a/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_init_test.go b/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_init_test.go index 03bdbd559..fe001444c 100644 --- a/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_init_test.go +++ b/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_init_test.go @@ -16,7 +16,7 @@ import ( telephonyProvidersEdgesSite "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site" "testing" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_proxy.go b/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_proxy.go index 8105cebb3..c73561bab 100644 --- a/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_proxy.go +++ b/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_proxy.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign.go b/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign.go index bdcd48c47..26ca8308c 100644 --- a/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign.go +++ b/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_test.go b/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_test.go index 2ada8f3fa..55a7c5004 100644 --- a/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_test.go +++ b/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_test.go @@ -23,7 +23,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // Add a special generator DEVENGAGE-1646. Basically, the API makes it look like you need a full phone_columns field here. However, the API ignores the type because the devs reused the phone_columns object. However, diff --git a/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_utils.go b/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_utils.go index 6f8fdc95a..dbd2b3d46 100644 --- a/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_utils.go +++ b/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_utils.go @@ -18,7 +18,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_campaignrule/data_source_genesyscloud_outbound_campaignrule.go b/genesyscloud/outbound_campaignrule/data_source_genesyscloud_outbound_campaignrule.go index e6694ebb2..9bd8ae0b5 100644 --- a/genesyscloud/outbound_campaignrule/data_source_genesyscloud_outbound_campaignrule.go +++ b/genesyscloud/outbound_campaignrule/data_source_genesyscloud_outbound_campaignrule.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceOutboundCampaignruleRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { diff --git a/genesyscloud/outbound_campaignrule/genesyscloud_outbound_campaignrule_proxy.go b/genesyscloud/outbound_campaignrule/genesyscloud_outbound_campaignrule_proxy.go index 0af2b5ba4..9d5fce2b3 100644 --- a/genesyscloud/outbound_campaignrule/genesyscloud_outbound_campaignrule_proxy.go +++ b/genesyscloud/outbound_campaignrule/genesyscloud_outbound_campaignrule_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule.go b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule.go index f94ae8fe3..b94076b68 100644 --- a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule.go +++ b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllAuthCampaignRules(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_test.go b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_test.go index 2a1726d2f..2e4353e1e 100644 --- a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_test.go +++ b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceOutboundCampaignRuleBasic(t *testing.T) { diff --git a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_unit_test.go b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_unit_test.go index aa5a5196c..314548cf4 100644 --- a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_unit_test.go +++ b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_unit_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/stretchr/testify/assert" ) diff --git a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_utils.go b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_utils.go index 0d3240299..152bef57b 100644 --- a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_utils.go +++ b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_utils.go @@ -5,7 +5,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getCampaignruleFromResourceData(d *schema.ResourceData) platformclientv2.Campaignrule { diff --git a/genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contactlist.go b/genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contactlist.go index 3c2f58501..b3fb96131 100644 --- a/genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contactlist.go +++ b/genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contactlist.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func DataSourceOutboundContactList() *schema.Resource { diff --git a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist.go b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist.go index 144afc54a..3e0b05fdf 100644 --- a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist.go +++ b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) const ( diff --git a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist_test.go b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist_test.go index fd80cce10..a07bfdedf 100644 --- a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist_test.go +++ b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceOutboundContactListBasic(t *testing.T) { diff --git a/genesyscloud/outbound_contact_list_contact/genesyscloud_outbound_contact_list_contact_proxy.go b/genesyscloud/outbound_contact_list_contact/genesyscloud_outbound_contact_list_contact_proxy.go index 021e5b804..805bdb53b 100644 --- a/genesyscloud/outbound_contact_list_contact/genesyscloud_outbound_contact_list_contact_proxy.go +++ b/genesyscloud/outbound_contact_list_contact/genesyscloud_outbound_contact_list_contact_proxy.go @@ -2,8 +2,9 @@ package outbound_contact_list_contact import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *contactProxy diff --git a/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact.go b/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact.go index d8e4cdab6..5aa60af40 100644 --- a/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact.go +++ b/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact.go @@ -3,10 +3,6 @@ package outbound_contact_list_contact import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -15,6 +11,11 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllContacts(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_utils.go b/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_utils.go index 797624746..e7bf542f0 100644 --- a/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_utils.go +++ b/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_utils.go @@ -2,11 +2,12 @@ package outbound_contact_list_contact import ( "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "strings" utillists "terraform-provider-genesyscloud/genesyscloud/util/lists" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // buildWritableContactFromResourceData used to build the request body for contact creation diff --git a/genesyscloud/outbound_contactlistfilter/genesyscloud_outbound_contactlistfilter_proxy.go b/genesyscloud/outbound_contactlistfilter/genesyscloud_outbound_contactlistfilter_proxy.go index b1e9651bb..f31cd1302 100644 --- a/genesyscloud/outbound_contactlistfilter/genesyscloud_outbound_contactlistfilter_proxy.go +++ b/genesyscloud/outbound_contactlistfilter/genesyscloud_outbound_contactlistfilter_proxy.go @@ -3,8 +3,9 @@ package outbound_contactlistfilter import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter.go b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter.go index 135ed9a44..ec48254e9 100644 --- a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter.go +++ b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter.go @@ -3,10 +3,6 @@ package outbound_contactlistfilter import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -15,6 +11,11 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_test.go b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_test.go index 385842ec2..2b11c3dae 100644 --- a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_test.go +++ b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceOutboundContactListFilter(t *testing.T) { diff --git a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_utils.go b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_utils.go index ae8aa6042..c76d07fdc 100644 --- a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_utils.go +++ b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_utils.go @@ -2,11 +2,12 @@ package outbound_contactlistfilter import ( "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "strings" "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getContactlistfilterFromResourceData(d *schema.ResourceData) platformclientv2.Contactlistfilter { diff --git a/genesyscloud/outbound_dnclist/genesyscloud_outbound_dnclist_proxy.go b/genesyscloud/outbound_dnclist/genesyscloud_outbound_dnclist_proxy.go index dc051f755..1e2833edc 100644 --- a/genesyscloud/outbound_dnclist/genesyscloud_outbound_dnclist_proxy.go +++ b/genesyscloud/outbound_dnclist/genesyscloud_outbound_dnclist_proxy.go @@ -3,10 +3,11 @@ package outbound_dnclist import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/util" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *outboundDnclistProxy diff --git a/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist.go b/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist.go index 5a98e1aa7..d77595ba2 100644 --- a/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist.go +++ b/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllOutboundDncLists(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_test.go b/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_test.go index 1eed72464..5b24ce8af 100644 --- a/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_test.go +++ b/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) const NullValue = "null" diff --git a/genesyscloud/outbound_filespecificationtemplate/genesyscloud_outbound_filespecificationtemplate_proxy.go b/genesyscloud/outbound_filespecificationtemplate/genesyscloud_outbound_filespecificationtemplate_proxy.go index 189cc266b..31a27000f 100644 --- a/genesyscloud/outbound_filespecificationtemplate/genesyscloud_outbound_filespecificationtemplate_proxy.go +++ b/genesyscloud/outbound_filespecificationtemplate/genesyscloud_outbound_filespecificationtemplate_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate.go b/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate.go index 8aaed672a..01905de0f 100644 --- a/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate.go +++ b/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllFileSpecificationTemplates(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_test.go b/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_test.go index 7e272fa62..36765840d 100644 --- a/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_test.go +++ b/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceOutboundFileSpecificationTemplate(t *testing.T) { diff --git a/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_utils.go b/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_utils.go index f765fa485..db00f47d2 100644 --- a/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_utils.go +++ b/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_utils.go @@ -1,9 +1,10 @@ package outbound_filespecificationtemplate import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getFilespecificationtemplateFromResourceData(d *schema.ResourceData) platformclientv2.Filespecificationtemplate { diff --git a/genesyscloud/outbound_ruleset/genesyscloud_outbound_ruleset_proxy.go b/genesyscloud/outbound_ruleset/genesyscloud_outbound_ruleset_proxy.go index 5e12b64ee..303e62e84 100644 --- a/genesyscloud/outbound_ruleset/genesyscloud_outbound_ruleset_proxy.go +++ b/genesyscloud/outbound_ruleset/genesyscloud_outbound_ruleset_proxy.go @@ -6,7 +6,7 @@ import ( "log" "strings" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset.go b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset.go index 37cfa4574..932a5cda7 100644 --- a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset.go +++ b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_test.go b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_test.go index d25b21570..36f0b7f28 100644 --- a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_test.go +++ b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" obContactList "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list" ) diff --git a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_unit_test.go b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_unit_test.go index d39433a83..9013a7365 100644 --- a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_unit_test.go +++ b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_unit_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestUnitDoesRuleConditionsRefDeletedSkill(t *testing.T) { diff --git a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_utils.go b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_utils.go index 6266b7a65..fd89ccf42 100644 --- a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_utils.go +++ b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_utils.go @@ -9,7 +9,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_init_test.go b/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_init_test.go index 35029a3e7..c9d70d283 100644 --- a/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_init_test.go +++ b/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_init_test.go @@ -12,7 +12,7 @@ import ( edgeSite "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site" "testing" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_proxy.go b/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_proxy.go index 85532bf50..d3fec81b8 100644 --- a/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_proxy.go +++ b/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence.go b/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence.go index 5bb9e88d7..375c4cfcc 100644 --- a/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence.go +++ b/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_test.go b/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_test.go index 3740a0da7..1ed0faccd 100644 --- a/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_test.go +++ b/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceOutboundSequence(t *testing.T) { diff --git a/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_utils.go b/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_utils.go index 3040db3dc..e0118f77f 100644 --- a/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_utils.go +++ b/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_utils.go @@ -6,7 +6,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_settings/genesyscloud_outbound_settings_proxy.go b/genesyscloud/outbound_settings/genesyscloud_outbound_settings_proxy.go index 1c30b0a12..e3f9843ea 100644 --- a/genesyscloud/outbound_settings/genesyscloud_outbound_settings_proxy.go +++ b/genesyscloud/outbound_settings/genesyscloud_outbound_settings_proxy.go @@ -3,7 +3,8 @@ package outbound_settings import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings.go b/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings.go index 0febb5174..1a62d1dd3 100644 --- a/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings.go +++ b/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings.go @@ -3,10 +3,6 @@ package outbound_settings import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -15,6 +11,11 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/constants" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings_utils.go b/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings_utils.go index 06c3989a6..65af76bfe 100644 --- a/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings_utils.go +++ b/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings_utils.go @@ -1,11 +1,12 @@ package outbound_settings import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/tfexporter_state" "terraform-provider-genesyscloud/genesyscloud/util/lists" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func buildOutboundSettingsAutomaticTimeZoneMapping(d *schema.ResourceData) *platformclientv2.Automatictimezonemappingsettings { diff --git a/genesyscloud/outbound_wrapupcode_mappings/genesyscloud_wrapupcode_mappings_proxy.go b/genesyscloud/outbound_wrapupcode_mappings/genesyscloud_wrapupcode_mappings_proxy.go index 16e688455..c706d4d96 100644 --- a/genesyscloud/outbound_wrapupcode_mappings/genesyscloud_wrapupcode_mappings_proxy.go +++ b/genesyscloud/outbound_wrapupcode_mappings/genesyscloud_wrapupcode_mappings_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *outboundWrapupCodeMappingsProxy diff --git a/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcode_mappings_utils.go b/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcode_mappings_utils.go index 1785d9808..8303ab14b 100644 --- a/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcode_mappings_utils.go +++ b/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcode_mappings_utils.go @@ -4,7 +4,7 @@ import ( lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // flattenOutboundWrapupCodeMappings maps a Genesys Cloud Wrapupcodemapping to a schema.Set diff --git a/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcodemappings.go b/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcodemappings.go index cccca5eb1..bab81ed6e 100644 --- a/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcodemappings.go +++ b/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcodemappings.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // getOutboundWrapupCodeMappings is used by the exporter to return all wrapupcode mappings diff --git a/genesyscloud/process_automation_trigger/data_source_genesyscloud_processautomation_trigger.go b/genesyscloud/process_automation_trigger/data_source_genesyscloud_processautomation_trigger.go index 0a8ee565b..e321312d8 100644 --- a/genesyscloud/process_automation_trigger/data_source_genesyscloud_processautomation_trigger.go +++ b/genesyscloud/process_automation_trigger/data_source_genesyscloud_processautomation_trigger.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type ProcessAutomationTriggers struct { diff --git a/genesyscloud/process_automation_trigger/process_automation_triggers_proxy.go b/genesyscloud/process_automation_trigger/process_automation_triggers_proxy.go index 3f6b07371..a2eb9daa3 100644 --- a/genesyscloud/process_automation_trigger/process_automation_triggers_proxy.go +++ b/genesyscloud/process_automation_trigger/process_automation_triggers_proxy.go @@ -11,7 +11,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func postProcessAutomationTrigger(pat *ProcessAutomationTrigger, api *platformclientv2.IntegrationsApi) (*ProcessAutomationTrigger, *platformclientv2.APIResponse, error) { diff --git a/genesyscloud/process_automation_trigger/process_automations_triggers_struct.go b/genesyscloud/process_automation_trigger/process_automations_triggers_struct.go index 539b80dfd..947625597 100644 --- a/genesyscloud/process_automation_trigger/process_automations_triggers_struct.go +++ b/genesyscloud/process_automation_trigger/process_automations_triggers_struct.go @@ -3,7 +3,7 @@ package process_automation_trigger import ( "encoding/json" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type ProcessAutomationTrigger struct { diff --git a/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger.go b/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger.go index b6878f8a7..b301d73a0 100644 --- a/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger.go +++ b/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger.go @@ -2,17 +2,18 @@ package process_automation_trigger import ( "context" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/constants" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "fmt" "log" "time" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger_test.go b/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger_test.go index e2905376f..363fcab19 100644 --- a/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger_test.go +++ b/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceProcessAutomationTrigger(t *testing.T) { diff --git a/genesyscloud/provider/division.go b/genesyscloud/provider/division.go index 9fefad4a8..e13afe209 100644 --- a/genesyscloud/provider/division.go +++ b/genesyscloud/provider/division.go @@ -1,9 +1,10 @@ package provider import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "sync" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type JsonMap map[string]interface{} diff --git a/genesyscloud/provider/provider.go b/genesyscloud/provider/provider.go index 346a29ffb..52f3704ee 100644 --- a/genesyscloud/provider/provider.go +++ b/genesyscloud/provider/provider.go @@ -3,7 +3,6 @@ package provider import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "log" "net/http" "os" @@ -12,10 +11,12 @@ import ( "strings" "time" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func init() { diff --git a/genesyscloud/provider/sdk_client_pool.go b/genesyscloud/provider/sdk_client_pool.go index 0123f541c..944661c5c 100644 --- a/genesyscloud/provider/sdk_client_pool.go +++ b/genesyscloud/provider/sdk_client_pool.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // SDKClientPool holds a Pool of client configs for the Genesys Cloud SDK. One should be diff --git a/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_init_test.go b/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_init_test.go index 35700f2f1..21bafbcb0 100644 --- a/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_init_test.go +++ b/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_init_test.go @@ -14,7 +14,7 @@ import ( "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_proxy.go b/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_proxy.go index 345294b53..43a61e614 100644 --- a/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_proxy.go +++ b/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_proxy.go @@ -7,7 +7,7 @@ import ( "net/http" "net/url" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy.go b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy.go index fc0777536..b89e8e7ce 100644 --- a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy.go +++ b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_test.go b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_test.go index 0c1b4c0a8..9b7bcc10a 100644 --- a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_test.go +++ b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_test.go @@ -22,7 +22,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_utils.go b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_utils.go index 62037798c..c3f69f1e3 100644 --- a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_utils.go +++ b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_utils.go @@ -10,7 +10,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/resource_cache/datasource_cache.go b/genesyscloud/resource_cache/datasource_cache.go index 20559e103..231874c09 100644 --- a/genesyscloud/resource_cache/datasource_cache.go +++ b/genesyscloud/resource_cache/datasource_cache.go @@ -8,7 +8,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // Cache for Data Sources diff --git a/genesyscloud/resource_exporter/resource_exporter.go b/genesyscloud/resource_exporter/resource_exporter.go index 81d28fbd1..33c97cf31 100644 --- a/genesyscloud/resource_exporter/resource_exporter.go +++ b/genesyscloud/resource_exporter/resource_exporter.go @@ -2,14 +2,15 @@ package resource_exporter import ( "context" - "github.com/hashicorp/go-cty/cty" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "regexp" "strings" "sync" + "github.com/hashicorp/go-cty/cty" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" + lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" diff --git a/genesyscloud/resource_exporter/resource_exporter_custom.go b/genesyscloud/resource_exporter/resource_exporter_custom.go index 70c976f12..3543dd4b4 100644 --- a/genesyscloud/resource_exporter/resource_exporter_custom.go +++ b/genesyscloud/resource_exporter/resource_exporter_custom.go @@ -3,11 +3,12 @@ package resource_exporter import ( "encoding/json" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "regexp" "strings" "terraform-provider-genesyscloud/genesyscloud/util/constants" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/resource_genesyscloud_architect_schedules.go b/genesyscloud/resource_genesyscloud_architect_schedules.go index e8feb700c..038f0db78 100644 --- a/genesyscloud/resource_genesyscloud_architect_schedules.go +++ b/genesyscloud/resource_genesyscloud_architect_schedules.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/leekchan/timeutil" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllArchitectSchedules(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_auth_division.go b/genesyscloud/resource_genesyscloud_auth_division.go index 557ba05d2..59374191b 100644 --- a/genesyscloud/resource_genesyscloud_auth_division.go +++ b/genesyscloud/resource_genesyscloud_auth_division.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllAuthDivisions(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_auth_division_test.go b/genesyscloud/resource_genesyscloud_auth_division_test.go index cebf83c42..fab7c0fb0 100644 --- a/genesyscloud/resource_genesyscloud_auth_division_test.go +++ b/genesyscloud/resource_genesyscloud_auth_division_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceAuthDivisionBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_idp_onelogin.go b/genesyscloud/resource_genesyscloud_idp_onelogin.go index 8191969da..1b6f2abf8 100644 --- a/genesyscloud/resource_genesyscloud_idp_onelogin.go +++ b/genesyscloud/resource_genesyscloud_idp_onelogin.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllIdpOnelogin(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_idp_onelogin_test.go b/genesyscloud/resource_genesyscloud_idp_onelogin_test.go index fcd55469b..62d340cc2 100644 --- a/genesyscloud/resource_genesyscloud_idp_onelogin_test.go +++ b/genesyscloud/resource_genesyscloud_idp_onelogin_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceIdpOnelogin(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_init_test.go b/genesyscloud/resource_genesyscloud_init_test.go index 9a90cd2a8..ae2ed4dae 100644 --- a/genesyscloud/resource_genesyscloud_init_test.go +++ b/genesyscloud/resource_genesyscloud_init_test.go @@ -15,7 +15,7 @@ import ( "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_journey_action_map.go b/genesyscloud/resource_genesyscloud_journey_action_map.go index 7e1c583f0..9519f9e52 100644 --- a/genesyscloud/resource_genesyscloud_journey_action_map.go +++ b/genesyscloud/resource_genesyscloud_journey_action_map.go @@ -25,7 +25,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_journey_action_map_test.go b/genesyscloud/resource_genesyscloud_journey_action_map_test.go index 22fa108ea..69f62eaa6 100644 --- a/genesyscloud/resource_genesyscloud_journey_action_map_test.go +++ b/genesyscloud/resource_genesyscloud_journey_action_map_test.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) const resourceName = "genesyscloud_journey_action_map" diff --git a/genesyscloud/resource_genesyscloud_journey_action_template.go b/genesyscloud/resource_genesyscloud_journey_action_template.go index ecd418113..c7b55a10f 100644 --- a/genesyscloud/resource_genesyscloud_journey_action_template.go +++ b/genesyscloud/resource_genesyscloud_journey_action_template.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_journey_action_template_test.go b/genesyscloud/resource_genesyscloud_journey_action_template_test.go index dd0cc9444..4fe521163 100644 --- a/genesyscloud/resource_genesyscloud_journey_action_template_test.go +++ b/genesyscloud/resource_genesyscloud_journey_action_template_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) const ActionTemplateResourceName = "genesyscloud_journey_action_template" diff --git a/genesyscloud/resource_genesyscloud_journey_outcome.go b/genesyscloud/resource_genesyscloud_journey_outcome.go index 40a1019ff..4e8ffe106 100644 --- a/genesyscloud/resource_genesyscloud_journey_outcome.go +++ b/genesyscloud/resource_genesyscloud_journey_outcome.go @@ -22,7 +22,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_journey_outcome_test.go b/genesyscloud/resource_genesyscloud_journey_outcome_test.go index 5f52a59bd..f89e638ce 100644 --- a/genesyscloud/resource_genesyscloud_journey_outcome_test.go +++ b/genesyscloud/resource_genesyscloud_journey_outcome_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceJourneyOutcome(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_journey_segment.go b/genesyscloud/resource_genesyscloud_journey_segment.go index 453d1191e..d899aa2d4 100644 --- a/genesyscloud/resource_genesyscloud_journey_segment.go +++ b/genesyscloud/resource_genesyscloud_journey_segment.go @@ -22,7 +22,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_journey_segment_test.go b/genesyscloud/resource_genesyscloud_journey_segment_test.go index 7e0946b52..36dce3d5d 100644 --- a/genesyscloud/resource_genesyscloud_journey_segment_test.go +++ b/genesyscloud/resource_genesyscloud_journey_segment_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceJourneySegment(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_category.go b/genesyscloud/resource_genesyscloud_knowledge_category.go index dc097759d..6bdd76f52 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_category.go +++ b/genesyscloud/resource_genesyscloud_knowledge_category.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_knowledge_category_test.go b/genesyscloud/resource_genesyscloud_knowledge_category_test.go index 06ca7764f..795c60613 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_category_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_category_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceKnowledgeCategoryBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_document.go b/genesyscloud/resource_genesyscloud_knowledge_document.go index 7c91e51bf..c70f722ae 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_document.go +++ b/genesyscloud/resource_genesyscloud_knowledge_document.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_knowledge_document_test.go b/genesyscloud/resource_genesyscloud_knowledge_document_test.go index 0e47251ac..37a7b7e65 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_document_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_document_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceKnowledgeDocumentBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_document_variation.go b/genesyscloud/resource_genesyscloud_knowledge_document_variation.go index b0ed284f2..0a6906123 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_document_variation.go +++ b/genesyscloud/resource_genesyscloud_knowledge_document_variation.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_knowledge_document_variation_test.go b/genesyscloud/resource_genesyscloud_knowledge_document_variation_test.go index 72e6fbfc4..a61504e32 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_document_variation_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_document_variation_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceKnowledgeDocumentVariationBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_knowledgebase.go b/genesyscloud/resource_genesyscloud_knowledge_knowledgebase.go index 4e824d71e..891d6e33d 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_knowledgebase.go +++ b/genesyscloud/resource_genesyscloud_knowledge_knowledgebase.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllKnowledgeKnowledgebases(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_knowledgebase_test.go b/genesyscloud/resource_genesyscloud_knowledge_knowledgebase_test.go index 798715ee1..460b02cd8 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_knowledgebase_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_knowledgebase_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceKnowledgeKnowledgebaseBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_label.go b/genesyscloud/resource_genesyscloud_knowledge_label.go index 9b622e0ae..0e62c1ed5 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_label.go +++ b/genesyscloud/resource_genesyscloud_knowledge_label.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_knowledge_label_test.go b/genesyscloud/resource_genesyscloud_knowledge_label_test.go index 146fa7f36..c9fa514c7 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_label_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_label_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceKnowledgeLabelBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_v1_category.go b/genesyscloud/resource_genesyscloud_knowledge_v1_category.go index b5af3291e..816f1d615 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_v1_category.go +++ b/genesyscloud/resource_genesyscloud_knowledge_v1_category.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_knowledge_v1_category_test.go b/genesyscloud/resource_genesyscloud_knowledge_v1_category_test.go index 578c23b26..ccd7370f4 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_v1_category_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_v1_category_test.go @@ -8,7 +8,7 @@ package genesyscloud // "github.com/google/uuid" // "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" // "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" -// "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" +// "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" // ) // func TestAccResourceKnowledgeV1CategoryBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_v1_document.go b/genesyscloud/resource_genesyscloud_knowledge_v1_document.go index a87a90384..0649a0804 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_v1_document.go +++ b/genesyscloud/resource_genesyscloud_knowledge_v1_document.go @@ -22,7 +22,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_knowledge_v1_document_test.go b/genesyscloud/resource_genesyscloud_knowledge_v1_document_test.go index b9ef197c6..33a0bc435 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_v1_document_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_v1_document_test.go @@ -8,7 +8,7 @@ package genesyscloud // "github.com/google/uuid" // "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" // "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" -// "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" +// "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" // ) // func TestAccResourceKnowledgeV1DocumentBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_location.go b/genesyscloud/resource_genesyscloud_location.go index eb2ac88e0..910a0521e 100644 --- a/genesyscloud/resource_genesyscloud_location.go +++ b/genesyscloud/resource_genesyscloud_location.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/nyaruka/phonenumbers" ) diff --git a/genesyscloud/resource_genesyscloud_location_test.go b/genesyscloud/resource_genesyscloud_location_test.go index b34a8c149..464de7e88 100644 --- a/genesyscloud/resource_genesyscloud_location_test.go +++ b/genesyscloud/resource_genesyscloud_location_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceLocationBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_quality_forms_evaluation.go b/genesyscloud/resource_genesyscloud_quality_forms_evaluation.go index b048bda93..46d25aaf5 100644 --- a/genesyscloud/resource_genesyscloud_quality_forms_evaluation.go +++ b/genesyscloud/resource_genesyscloud_quality_forms_evaluation.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_quality_forms_evaluation_test.go b/genesyscloud/resource_genesyscloud_quality_forms_evaluation_test.go index bceeeff41..bec7ffa7e 100644 --- a/genesyscloud/resource_genesyscloud_quality_forms_evaluation_test.go +++ b/genesyscloud/resource_genesyscloud_quality_forms_evaluation_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceEvaluationFormBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_quality_forms_survey.go b/genesyscloud/resource_genesyscloud_quality_forms_survey.go index a8941b378..9684600e1 100644 --- a/genesyscloud/resource_genesyscloud_quality_forms_survey.go +++ b/genesyscloud/resource_genesyscloud_quality_forms_survey.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type SurveyFormStruct struct { diff --git a/genesyscloud/resource_genesyscloud_quality_forms_survey_test.go b/genesyscloud/resource_genesyscloud_quality_forms_survey_test.go index cf763718c..f09b650fe 100644 --- a/genesyscloud/resource_genesyscloud_quality_forms_survey_test.go +++ b/genesyscloud/resource_genesyscloud_quality_forms_survey_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceSurveyFormBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_routing_email_domain.go b/genesyscloud/resource_genesyscloud_routing_email_domain.go index e17c91191..f49449257 100644 --- a/genesyscloud/resource_genesyscloud_routing_email_domain.go +++ b/genesyscloud/resource_genesyscloud_routing_email_domain.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllRoutingEmailDomains(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_routing_email_domain_test.go b/genesyscloud/resource_genesyscloud_routing_email_domain_test.go index 016f54c20..b01929e81 100644 --- a/genesyscloud/resource_genesyscloud_routing_email_domain_test.go +++ b/genesyscloud/resource_genesyscloud_routing_email_domain_test.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceRoutingEmailDomainSub(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_routing_language.go b/genesyscloud/resource_genesyscloud_routing_language.go index e30132331..9340ff2b7 100644 --- a/genesyscloud/resource_genesyscloud_routing_language.go +++ b/genesyscloud/resource_genesyscloud_routing_language.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllRoutingLanguages(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_routing_language_test.go b/genesyscloud/resource_genesyscloud_routing_language_test.go index a3f416a09..5d0349c8a 100644 --- a/genesyscloud/resource_genesyscloud_routing_language_test.go +++ b/genesyscloud/resource_genesyscloud_routing_language_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceRoutingLanguageBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_routing_skill.go b/genesyscloud/resource_genesyscloud_routing_skill.go index 91ccf0574..33093ab37 100644 --- a/genesyscloud/resource_genesyscloud_routing_skill.go +++ b/genesyscloud/resource_genesyscloud_routing_skill.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllRoutingSkills(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_routing_skill_group.go b/genesyscloud/resource_genesyscloud_routing_skill_group.go index 6508806de..5e47d30c1 100644 --- a/genesyscloud/resource_genesyscloud_routing_skill_group.go +++ b/genesyscloud/resource_genesyscloud_routing_skill_group.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type SkillGroupsRequest struct { diff --git a/genesyscloud/resource_genesyscloud_routing_skill_group_test.go b/genesyscloud/resource_genesyscloud_routing_skill_group_test.go index 311e08fc7..3fdf5e580 100644 --- a/genesyscloud/resource_genesyscloud_routing_skill_group_test.go +++ b/genesyscloud/resource_genesyscloud_routing_skill_group_test.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func testAccCheckSkillConditions(resourceName string, targetSkillConditionJson string) resource.TestCheckFunc { diff --git a/genesyscloud/resource_genesyscloud_routing_skill_test.go b/genesyscloud/resource_genesyscloud_routing_skill_test.go index 551c061a6..e847a18ff 100644 --- a/genesyscloud/resource_genesyscloud_routing_skill_test.go +++ b/genesyscloud/resource_genesyscloud_routing_skill_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceRoutingSkillBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_routing_wrapupcode.go b/genesyscloud/resource_genesyscloud_routing_wrapupcode.go index 962e28073..210584bb5 100644 --- a/genesyscloud/resource_genesyscloud_routing_wrapupcode.go +++ b/genesyscloud/resource_genesyscloud_routing_wrapupcode.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllRoutingWrapupCodes(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_routing_wrapupcode_test.go b/genesyscloud/resource_genesyscloud_routing_wrapupcode_test.go index d4becc64d..6fc78d61d 100644 --- a/genesyscloud/resource_genesyscloud_routing_wrapupcode_test.go +++ b/genesyscloud/resource_genesyscloud_routing_wrapupcode_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceRoutingWrapupcode(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_user.go b/genesyscloud/resource_genesyscloud_user.go index c900235a0..256eaa3cc 100644 --- a/genesyscloud/resource_genesyscloud_user.go +++ b/genesyscloud/resource_genesyscloud_user.go @@ -24,7 +24,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/nyaruka/phonenumbers" ) diff --git a/genesyscloud/resource_genesyscloud_user_test.go b/genesyscloud/resource_genesyscloud_user_test.go index eb0ba0435..e3f37ddb9 100644 --- a/genesyscloud/resource_genesyscloud_user_test.go +++ b/genesyscloud/resource_genesyscloud_user_test.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceUserBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_widget_deployment.go b/genesyscloud/resource_genesyscloud_widget_deployment.go index 54ef064af..989d19d87 100644 --- a/genesyscloud/resource_genesyscloud_widget_deployment.go +++ b/genesyscloud/resource_genesyscloud_widget_deployment.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) const ( diff --git a/genesyscloud/resource_genesyscloud_widget_deployment_test.go b/genesyscloud/resource_genesyscloud_widget_deployment_test.go index 2f4b56c25..cc8519ce1 100644 --- a/genesyscloud/resource_genesyscloud_widget_deployment_test.go +++ b/genesyscloud/resource_genesyscloud_widget_deployment_test.go @@ -11,7 +11,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type widgetDeploymentConfig struct { diff --git a/genesyscloud/responsemanagement_library/genesyscloud_responsemanagement_library_proxy.go b/genesyscloud/responsemanagement_library/genesyscloud_responsemanagement_library_proxy.go index 9478205ec..644d5de5b 100644 --- a/genesyscloud/responsemanagement_library/genesyscloud_responsemanagement_library_proxy.go +++ b/genesyscloud/responsemanagement_library/genesyscloud_responsemanagement_library_proxy.go @@ -3,8 +3,9 @@ package responsemanagement_library import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library.go b/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library.go index 2970dd174..0d922993b 100644 --- a/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library.go +++ b/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library.go @@ -3,9 +3,6 @@ package responsemanagement_library import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" @@ -13,6 +10,10 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" "time" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" + "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" diff --git a/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library_test.go b/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library_test.go index 2724c81d1..6473a47d1 100644 --- a/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library_test.go +++ b/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceResponseManagementLibrary(t *testing.T) { diff --git a/genesyscloud/responsemanagement_response/genesyscloud_responsemanagement_response_proxy.go b/genesyscloud/responsemanagement_response/genesyscloud_responsemanagement_response_proxy.go index 70921cbd8..15aa5c24e 100644 --- a/genesyscloud/responsemanagement_response/genesyscloud_responsemanagement_response_proxy.go +++ b/genesyscloud/responsemanagement_response/genesyscloud_responsemanagement_response_proxy.go @@ -3,8 +3,9 @@ package responsemanagement_response import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response.go b/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response.go index 5e7dec46c..2de69e6cb 100644 --- a/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response.go +++ b/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response.go @@ -3,10 +3,6 @@ package responsemanagement_response import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -15,6 +11,11 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_test.go b/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_test.go index c9dbca7a6..1a12a384a 100644 --- a/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_test.go +++ b/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_test.go @@ -16,7 +16,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceResponseManagementResponseFooterField(t *testing.T) { diff --git a/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_utils.go b/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_utils.go index f2dd8555f..45d6bb6f3 100644 --- a/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_utils.go +++ b/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_utils.go @@ -1,11 +1,12 @@ package responsemanagement_response import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/lists" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getResponseFromResourceData(d *schema.ResourceData) platformclientv2.Response { diff --git a/genesyscloud/responsemanagement_responseasset/genesyscloud_responsemanagement_responseasset_proxy.go b/genesyscloud/responsemanagement_responseasset/genesyscloud_responsemanagement_responseasset_proxy.go index fe64370e1..8495f4910 100644 --- a/genesyscloud/responsemanagement_responseasset/genesyscloud_responsemanagement_responseasset_proxy.go +++ b/genesyscloud/responsemanagement_responseasset/genesyscloud_responsemanagement_responseasset_proxy.go @@ -6,7 +6,7 @@ import ( "log" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset.go b/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset.go index 94a4a0c2e..b0e7d9470 100644 --- a/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset.go +++ b/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset.go @@ -3,10 +3,6 @@ package responsemanagement_responseasset import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -15,6 +11,11 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" "terraform-provider-genesyscloud/genesyscloud/util/files" "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset_test.go b/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset_test.go index 7cb665c73..8d222e26e 100644 --- a/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset_test.go +++ b/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceResponseManagementResponseAsset(t *testing.T) { diff --git a/genesyscloud/routing_email_route/genesyscloud_routing_email_route_proxy.go b/genesyscloud/routing_email_route/genesyscloud_routing_email_route_proxy.go index 6c8df29b3..ac6ac1328 100644 --- a/genesyscloud/routing_email_route/genesyscloud_routing_email_route_proxy.go +++ b/genesyscloud/routing_email_route/genesyscloud_routing_email_route_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route.go b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route.go index 8bdffc449..d2910fa3e 100644 --- a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route.go +++ b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go index 4cec51ca3..075bd7b7c 100644 --- a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go +++ b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceRoutingEmailRoute(t *testing.T) { diff --git a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_utils.go b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_utils.go index c47783f4b..7c5b58343 100644 --- a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_utils.go +++ b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_utils.go @@ -8,7 +8,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/routing_queue/data_source_genesyscloud_routing_queue.go b/genesyscloud/routing_queue/data_source_genesyscloud_routing_queue.go index cd47befaa..08fa4fb5b 100644 --- a/genesyscloud/routing_queue/data_source_genesyscloud_routing_queue.go +++ b/genesyscloud/routing_queue/data_source_genesyscloud_routing_queue.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/routing_queue/genesyscloud_routing_queue_proxy.go b/genesyscloud/routing_queue/genesyscloud_routing_queue_proxy.go index 3a06aa969..2d27a41d0 100644 --- a/genesyscloud/routing_queue/genesyscloud_routing_queue_proxy.go +++ b/genesyscloud/routing_queue/genesyscloud_routing_queue_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue.go b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue.go index 46ae0cba6..4ee275d58 100644 --- a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue.go +++ b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue.go @@ -25,7 +25,7 @@ import ( "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var bullseyeExpansionTypeTimeout = "TIMEOUT_SECONDS" diff --git a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go index 20252e1db..c1a359274 100644 --- a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go +++ b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go @@ -20,7 +20,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/routing_queue_conditional_group_routing/genesyscloud_routing_queue_conditional_group_routing_proxy.go b/genesyscloud/routing_queue_conditional_group_routing/genesyscloud_routing_queue_conditional_group_routing_proxy.go index 8072bfcc7..c30bd06f0 100644 --- a/genesyscloud/routing_queue_conditional_group_routing/genesyscloud_routing_queue_conditional_group_routing_proxy.go +++ b/genesyscloud/routing_queue_conditional_group_routing/genesyscloud_routing_queue_conditional_group_routing_proxy.go @@ -3,9 +3,10 @@ package routing_queue_conditional_group_routing import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // internalProxy holds a proxy instance that can be used throughout the package diff --git a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing.go b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing.go index a0d3b94a3..3877f16fd 100644 --- a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing.go +++ b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing.go @@ -3,10 +3,6 @@ package routing_queue_conditional_group_routing import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "strings" consistencyChecker "terraform-provider-genesyscloud/genesyscloud/consistency_checker" @@ -16,6 +12,11 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" featureToggles "terraform-provider-genesyscloud/genesyscloud/util/feature_toggles" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_test.go b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_test.go index dadf085c8..e910fb72c 100644 --- a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_test.go +++ b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_test.go @@ -18,7 +18,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_unit_test.go b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_unit_test.go index 16b682245..fc4f84f7f 100644 --- a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_unit_test.go +++ b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_unit_test.go @@ -2,14 +2,15 @@ package routing_queue_conditional_group_routing import ( "context" + "net/http" + "terraform-provider-genesyscloud/genesyscloud/provider" + "testing" + "github.com/google/go-cmp/cmp" "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/stretchr/testify/assert" - "net/http" - "terraform-provider-genesyscloud/genesyscloud/provider" - "testing" ) func TestUnitResourceRoutingQueueConditionalGroupRoutingUpdate(t *testing.T) { diff --git a/genesyscloud/routing_queue_outbound_email_address/genesyscloud_routing_queue_outbound_email_address_proxy.go b/genesyscloud/routing_queue_outbound_email_address/genesyscloud_routing_queue_outbound_email_address_proxy.go index e12da7114..b79e9f767 100644 --- a/genesyscloud/routing_queue_outbound_email_address/genesyscloud_routing_queue_outbound_email_address_proxy.go +++ b/genesyscloud/routing_queue_outbound_email_address/genesyscloud_routing_queue_outbound_email_address_proxy.go @@ -3,9 +3,10 @@ package routing_queue_outbound_email_address import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // internalProxy holds a proxy instance that can be used throughout the package diff --git a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address.go b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address.go index e94fdaee1..79d72046b 100644 --- a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address.go +++ b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address.go @@ -3,10 +3,6 @@ package routing_queue_outbound_email_address import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "strings" consistencyChecker "terraform-provider-genesyscloud/genesyscloud/consistency_checker" @@ -16,6 +12,11 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" featureToggles "terraform-provider-genesyscloud/genesyscloud/util/feature_toggles" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_test.go b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_test.go index cfac071ce..534bd35bf 100644 --- a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_test.go +++ b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_test.go @@ -2,10 +2,6 @@ package routing_queue_outbound_email_address import ( "fmt" - "github.com/google/uuid" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "os" "strings" @@ -17,6 +13,11 @@ import ( featureToggles "terraform-provider-genesyscloud/genesyscloud/util/feature_toggles" "testing" "time" + + "github.com/google/uuid" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceRoutingQueueOutboundEmailAddress(t *testing.T) { diff --git a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_unit_test.go b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_unit_test.go index 6ef38582c..00f239f42 100644 --- a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_unit_test.go +++ b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_unit_test.go @@ -2,13 +2,14 @@ package routing_queue_outbound_email_address import ( "context" - "github.com/google/uuid" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" - "github.com/stretchr/testify/assert" "net/http" "terraform-provider-genesyscloud/genesyscloud/provider" "testing" + + "github.com/google/uuid" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" + "github.com/stretchr/testify/assert" ) func TestUnitResourceRoutingQueueOutboundEmailAddressUpdate(t *testing.T) { diff --git a/genesyscloud/routing_settings/genesyscloud_routing_settings_proxy.go b/genesyscloud/routing_settings/genesyscloud_routing_settings_proxy.go index 111dcf6f1..00fc3df53 100644 --- a/genesyscloud/routing_settings/genesyscloud_routing_settings_proxy.go +++ b/genesyscloud/routing_settings/genesyscloud_routing_settings_proxy.go @@ -2,7 +2,8 @@ package routing_settings import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *routingSettingsProxy diff --git a/genesyscloud/routing_settings/resource_genesyscloud_routing_settings.go b/genesyscloud/routing_settings/resource_genesyscloud_routing_settings.go index 3f4a4f2e8..24faf3c06 100644 --- a/genesyscloud/routing_settings/resource_genesyscloud_routing_settings.go +++ b/genesyscloud/routing_settings/resource_genesyscloud_routing_settings.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllRoutingSettings(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/routing_sms_addresses/genesyscloud_routing_sms_addresses_proxy.go b/genesyscloud/routing_sms_addresses/genesyscloud_routing_sms_addresses_proxy.go index 4da161286..85212774a 100644 --- a/genesyscloud/routing_sms_addresses/genesyscloud_routing_sms_addresses_proxy.go +++ b/genesyscloud/routing_sms_addresses/genesyscloud_routing_sms_addresses_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // Type definitions for each func on our proxy so we can easily mock them out later diff --git a/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses.go b/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses.go index d578d8b0c..1da47bc0d 100644 --- a/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses.go +++ b/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) const resourceName = "genesyscloud_routing_sms_address" diff --git a/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses_test.go b/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses_test.go index 4d4185ee8..5ea01bb2c 100644 --- a/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses_test.go +++ b/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceRoutingSmsAddressesProdOrg(t *testing.T) { diff --git a/genesyscloud/routing_utilization/genesyscloud_routing_utilization_proxy.go b/genesyscloud/routing_utilization/genesyscloud_routing_utilization_proxy.go index 776d9664a..305a941ef 100644 --- a/genesyscloud/routing_utilization/genesyscloud_routing_utilization_proxy.go +++ b/genesyscloud/routing_utilization/genesyscloud_routing_utilization_proxy.go @@ -3,8 +3,9 @@ package routing_utilization import ( "context" "fmt" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *routingUtilizationProxy diff --git a/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization.go b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization.go index 27acc28ba..20e417b56 100644 --- a/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization.go +++ b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization.go @@ -4,18 +4,20 @@ import ( "context" "encoding/json" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "log" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/constants" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "terraform-provider-genesyscloud/genesyscloud/consistency_checker" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" - resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllRoutingUtilization(_ context.Context, _ *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_test.go b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_test.go index 9428dc69e..c568a4018 100644 --- a/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_test.go +++ b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceRoutingUtilizationBasic(t *testing.T) { diff --git a/genesyscloud/routing_utilization/resource_routing_utilization_utils.go b/genesyscloud/routing_utilization/resource_routing_utilization_utils.go index 060d857b8..4c6757afa 100644 --- a/genesyscloud/routing_utilization/resource_routing_utilization_utils.go +++ b/genesyscloud/routing_utilization/resource_routing_utilization_utils.go @@ -2,11 +2,12 @@ package routing_utilization import ( "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "sort" "strings" "terraform-provider-genesyscloud/genesyscloud/util/lists" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func buildSdkMediaUtilizations(d *schema.ResourceData) *map[string]platformclientv2.Mediautilization { diff --git a/genesyscloud/routing_utilization_label/genesyscloud_routing_utilization_label_proxy.go b/genesyscloud/routing_utilization_label/genesyscloud_routing_utilization_label_proxy.go index fc19feb6c..ee8f5de3b 100644 --- a/genesyscloud/routing_utilization_label/genesyscloud_routing_utilization_label_proxy.go +++ b/genesyscloud/routing_utilization_label/genesyscloud_routing_utilization_label_proxy.go @@ -6,7 +6,7 @@ import ( "log" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *routingUtilizationLabelProxy @@ -127,7 +127,7 @@ func getRoutingUtilizationLabelByNameFn(ctx context.Context, p *routingUtilizati return nil, false, resp, fmt.Errorf("error retrieving routing utilization label by name %s", err) } - if labels == nil || len(*labels) == 0{ + if labels == nil || len(*labels) == 0 { return nil, true, resp, fmt.Errorf("no routing utilization labels found with name %s", name) } diff --git a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label.go b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label.go index c4ca7d422..755e6c358 100644 --- a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label.go +++ b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllRoutingUtilizationLabels(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_test.go b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_test.go index afa9af8ce..28b1d9019 100644 --- a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_test.go +++ b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceRoutingUtilizationLabelBasic(t *testing.T) { diff --git a/genesyscloud/scripts/genesyscloud_scripts_proxy.go b/genesyscloud/scripts/genesyscloud_scripts_proxy.go index 7f5a53860..03f44c83e 100644 --- a/genesyscloud/scripts/genesyscloud_scripts_proxy.go +++ b/genesyscloud/scripts/genesyscloud_scripts_proxy.go @@ -14,7 +14,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/files" "time" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/scripts/resource_genesyscloud_script.go b/genesyscloud/scripts/resource_genesyscloud_script.go index 53df15885..62d706f9c 100644 --- a/genesyscloud/scripts/resource_genesyscloud_script.go +++ b/genesyscloud/scripts/resource_genesyscloud_script.go @@ -12,7 +12,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/genesyscloud/scripts/resource_genesyscloud_script_test.go b/genesyscloud/scripts/resource_genesyscloud_script_test.go index 23d3a7471..12c06e057 100644 --- a/genesyscloud/scripts/resource_genesyscloud_script_test.go +++ b/genesyscloud/scripts/resource_genesyscloud_script_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/station/genesyscloud_station_init_test.go b/genesyscloud/station/genesyscloud_station_init_test.go index 9641ffcb3..0eb7ec81f 100644 --- a/genesyscloud/station/genesyscloud_station_init_test.go +++ b/genesyscloud/station/genesyscloud_station_init_test.go @@ -6,7 +6,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" "testing" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" gcloud "terraform-provider-genesyscloud/genesyscloud" edgePhone "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_phone" diff --git a/genesyscloud/station/genesyscloud_station_proxy.go b/genesyscloud/station/genesyscloud_station_proxy.go index 7486790e1..8e744bdf8 100644 --- a/genesyscloud/station/genesyscloud_station_proxy.go +++ b/genesyscloud/station/genesyscloud_station_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // internalProxy holds a proxy instance that can be used throughout the package diff --git a/genesyscloud/task_management_workbin/genesyscloud_task_management_workbin_proxy.go b/genesyscloud/task_management_workbin/genesyscloud_task_management_workbin_proxy.go index acbe12980..dcce50592 100644 --- a/genesyscloud/task_management_workbin/genesyscloud_task_management_workbin_proxy.go +++ b/genesyscloud/task_management_workbin/genesyscloud_task_management_workbin_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin.go b/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin.go index 5b4c8a5f5..394e23a79 100644 --- a/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin.go +++ b/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin_test.go b/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin_test.go index b468918ea..731c143e8 100644 --- a/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin_test.go +++ b/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin_test.go @@ -12,7 +12,7 @@ import ( gcloud "terraform-provider-genesyscloud/genesyscloud" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workitem/genesyscloud_task_management_workitem_proxy.go b/genesyscloud/task_management_workitem/genesyscloud_task_management_workitem_proxy.go index 82aa8f0c4..cc3cd86d5 100644 --- a/genesyscloud/task_management_workitem/genesyscloud_task_management_workitem_proxy.go +++ b/genesyscloud/task_management_workitem/genesyscloud_task_management_workitem_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem.go b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem.go index 9f5494392..3abfa846d 100644 --- a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem.go +++ b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_test.go b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_test.go index c9d31132c..ae67f2425 100644 --- a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_test.go +++ b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_test.go @@ -23,7 +23,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_unit_test.go b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_unit_test.go index 591301bbb..6c53bb3dc 100644 --- a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_unit_test.go +++ b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_unit_test.go @@ -16,7 +16,7 @@ import ( lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_utils.go b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_utils.go index 6d3ab7ebf..505faf533 100644 --- a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_utils.go +++ b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_utils.go @@ -9,7 +9,7 @@ import ( lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workitem_schema/genesyscloud_task_management_workitem_schema_proxy.go b/genesyscloud/task_management_workitem_schema/genesyscloud_task_management_workitem_schema_proxy.go index a93f33c34..309470b2d 100644 --- a/genesyscloud/task_management_workitem_schema/genesyscloud_task_management_workitem_schema_proxy.go +++ b/genesyscloud/task_management_workitem_schema/genesyscloud_task_management_workitem_schema_proxy.go @@ -8,7 +8,7 @@ import ( "log" "net/http" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema.go b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema.go index f96eba1df..5ed7bd9f5 100644 --- a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema.go +++ b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_test.go b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_test.go index f043ef040..3599174c3 100644 --- a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_test.go +++ b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_test.go @@ -15,7 +15,7 @@ import ( lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_unit_test.go b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_unit_test.go index d9914e3b1..7b5452778 100644 --- a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_unit_test.go +++ b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_unit_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/stretchr/testify/assert" ) diff --git a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_utils.go b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_utils.go index 7594a8ccf..d7a5f0056 100644 --- a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_utils.go +++ b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_utils.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) const ( diff --git a/genesyscloud/task_management_worktype/data_source_genesyscloud_task_management_unit_test.go b/genesyscloud/task_management_worktype/data_source_genesyscloud_task_management_unit_test.go index 6cfd137aa..0fa5a999a 100644 --- a/genesyscloud/task_management_worktype/data_source_genesyscloud_task_management_unit_test.go +++ b/genesyscloud/task_management_worktype/data_source_genesyscloud_task_management_unit_test.go @@ -2,12 +2,13 @@ package task_management_worktype import ( "context" + "terraform-provider-genesyscloud/genesyscloud/provider" + "testing" + "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/stretchr/testify/assert" - "terraform-provider-genesyscloud/genesyscloud/provider" - "testing" ) // TestUnitataSourceTaskManagementWorktypeStatus tests the retrieve of a status id. diff --git a/genesyscloud/task_management_worktype/genesyscloud_task_management_worktype_proxy.go b/genesyscloud/task_management_worktype/genesyscloud_task_management_worktype_proxy.go index 5f5417369..c24b2bab2 100644 --- a/genesyscloud/task_management_worktype/genesyscloud_task_management_worktype_proxy.go +++ b/genesyscloud/task_management_worktype/genesyscloud_task_management_worktype_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype.go b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype.go index df9a05aa0..a322ff5c5 100644 --- a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype.go +++ b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_test.go b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_test.go index f796b484d..90bf04a63 100644 --- a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_test.go +++ b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_test.go @@ -18,7 +18,7 @@ import ( workitemSchema "terraform-provider-genesyscloud/genesyscloud/task_management_workitem_schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_unit_test.go b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_unit_test.go index aefbe1a22..4af168184 100644 --- a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_unit_test.go +++ b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_unit_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/stretchr/testify/assert" ) diff --git a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go index 79284a9b9..45a292407 100644 --- a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go +++ b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go @@ -7,7 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/team/genesyscloud_team_proxy.go b/genesyscloud/team/genesyscloud_team_proxy.go index 2880ca8c0..c33c27eab 100644 --- a/genesyscloud/team/genesyscloud_team_proxy.go +++ b/genesyscloud/team/genesyscloud_team_proxy.go @@ -6,7 +6,7 @@ import ( "log" "terraform-provider-genesyscloud/genesyscloud/util" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/team/resource_genesyscloud_team.go b/genesyscloud/team/resource_genesyscloud_team.go index 2c6d8414e..dd3f6fbcd 100644 --- a/genesyscloud/team/resource_genesyscloud_team.go +++ b/genesyscloud/team/resource_genesyscloud_team.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" diff --git a/genesyscloud/team/resource_genesyscloud_team_test.go b/genesyscloud/team/resource_genesyscloud_team_test.go index 03bede55f..edf5e83db 100644 --- a/genesyscloud/team/resource_genesyscloud_team_test.go +++ b/genesyscloud/team/resource_genesyscloud_team_test.go @@ -2,15 +2,16 @@ package team import ( "fmt" - "github.com/google/uuid" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "math/rand" "strings" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "testing" + "github.com/google/uuid" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" + gcloud "terraform-provider-genesyscloud/genesyscloud" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" diff --git a/genesyscloud/team/resource_genesyscloud_team_unit_test.go b/genesyscloud/team/resource_genesyscloud_team_unit_test.go index 3b3e670cb..c3e8650ea 100644 --- a/genesyscloud/team/resource_genesyscloud_team_unit_test.go +++ b/genesyscloud/team/resource_genesyscloud_team_unit_test.go @@ -11,7 +11,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/stretchr/testify/assert" ) diff --git a/genesyscloud/team/resource_genesyscloud_team_utils.go b/genesyscloud/team/resource_genesyscloud_team_utils.go index 8c926b239..6f5a7f976 100644 --- a/genesyscloud/team/resource_genesyscloud_team_utils.go +++ b/genesyscloud/team/resource_genesyscloud_team_utils.go @@ -3,14 +3,16 @@ package team import ( "context" "fmt" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "strings" "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/chunks" "terraform-provider-genesyscloud/genesyscloud/util/lists" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // getTeamFromResourceData maps data from schema ResourceData object to a platformclientv2.Team diff --git a/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings.go b/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings.go index e81844e03..6d4a7a125 100644 --- a/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings.go +++ b/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings.go @@ -22,7 +22,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) const ( diff --git a/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings_test.go b/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings_test.go index d0a1ecab1..e2210b361 100644 --- a/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings_test.go +++ b/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceTrunkBaseSettings(t *testing.T) { diff --git a/genesyscloud/telephony_providers_edges_did/genesyscloud_telephony_providers_edges_did_proxy.go b/genesyscloud/telephony_providers_edges_did/genesyscloud_telephony_providers_edges_did_proxy.go index 553f33454..931f3d720 100644 --- a/genesyscloud/telephony_providers_edges_did/genesyscloud_telephony_providers_edges_did_proxy.go +++ b/genesyscloud/telephony_providers_edges_did/genesyscloud_telephony_providers_edges_did_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/telephony_providers_edges_did_pool/genesyscloud_telephony_providers_edges_did_pool_proxy.go b/genesyscloud/telephony_providers_edges_did_pool/genesyscloud_telephony_providers_edges_did_pool_proxy.go index 65d2cdb54..be410c042 100644 --- a/genesyscloud/telephony_providers_edges_did_pool/genesyscloud_telephony_providers_edges_did_pool_proxy.go +++ b/genesyscloud/telephony_providers_edges_did_pool/genesyscloud_telephony_providers_edges_did_pool_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool.go b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool.go index a0a870405..b666afff3 100644 --- a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool.go +++ b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // getAllDidPools retrieves all DID pools and is used for the exporter diff --git a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_test.go b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_test.go index 184070128..8ae609857 100644 --- a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_test.go +++ b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceDidPoolBasic(t *testing.T) { diff --git a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_utils.go b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_utils.go index 2f7ffa5c9..bc4f14a10 100644 --- a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_utils.go +++ b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_utils.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type DidPoolStruct struct { diff --git a/genesyscloud/telephony_providers_edges_edge_group/genesyscloud_telephony_providers_edges_edge_group_proxy.go b/genesyscloud/telephony_providers_edges_edge_group/genesyscloud_telephony_providers_edges_edge_group_proxy.go index 6db0ceb02..8dbbf2440 100644 --- a/genesyscloud/telephony_providers_edges_edge_group/genesyscloud_telephony_providers_edges_edge_group_proxy.go +++ b/genesyscloud/telephony_providers_edges_edge_group/genesyscloud_telephony_providers_edges_edge_group_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *edgeGroupProxy diff --git a/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group.go b/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group.go index 45882bed4..77616d81c 100644 --- a/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group.go +++ b/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func createEdgeGroup(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { diff --git a/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_test.go b/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_test.go index 6c0968e95..c0d722626 100644 --- a/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_test.go +++ b/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceEdgeGroup(t *testing.T) { diff --git a/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_utils.go b/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_utils.go index 6089618c0..1b3883f0a 100644 --- a/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_utils.go +++ b/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_utils.go @@ -6,7 +6,7 @@ import ( lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func buildSdkTrunkBases(d *schema.ResourceData) *[]platformclientv2.Trunkbase { diff --git a/genesyscloud/telephony_providers_edges_extension_pool/genesyscloud_telephony_providers_edges_extension_pool_proxy.go b/genesyscloud/telephony_providers_edges_extension_pool/genesyscloud_telephony_providers_edges_extension_pool_proxy.go index 21de47b35..1cea85894 100644 --- a/genesyscloud/telephony_providers_edges_extension_pool/genesyscloud_telephony_providers_edges_extension_pool_proxy.go +++ b/genesyscloud/telephony_providers_edges_extension_pool/genesyscloud_telephony_providers_edges_extension_pool_proxy.go @@ -3,7 +3,7 @@ package telephony_providers_edges_extension_pool import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *extensionPoolProxy diff --git a/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool.go b/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool.go index 4cbe729b1..49c20d856 100644 --- a/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool.go +++ b/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllExtensionPools(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool_test.go b/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool_test.go index 84a0d93a0..80d602e94 100644 --- a/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool_test.go +++ b/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type extensionPoolStruct struct { diff --git a/genesyscloud/telephony_providers_edges_linebasesettings/data_source_genesyscloud_telephony_providers_edges_linebasesettings.go b/genesyscloud/telephony_providers_edges_linebasesettings/data_source_genesyscloud_telephony_providers_edges_linebasesettings.go index 912f7a8b7..90d8bdd81 100644 --- a/genesyscloud/telephony_providers_edges_linebasesettings/data_source_genesyscloud_telephony_providers_edges_linebasesettings.go +++ b/genesyscloud/telephony_providers_edges_linebasesettings/data_source_genesyscloud_telephony_providers_edges_linebasesettings.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceLineBaseSettingsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { diff --git a/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_init_test.go b/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_init_test.go index ddfe3a1b9..8eaeab5cd 100644 --- a/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_init_test.go +++ b/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_init_test.go @@ -10,7 +10,7 @@ import ( edgeSite "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site" "testing" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_proxy.go b/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_proxy.go index 648447fb6..3ff4089c9 100644 --- a/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_proxy.go +++ b/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_proxy.go @@ -8,7 +8,7 @@ import ( rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go index 64cee7cfa..505309b7d 100644 --- a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go +++ b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllPhones(ctx context.Context, sdkConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go index c01d7e3ed..2508a0424 100644 --- a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go +++ b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go @@ -17,7 +17,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourcePhoneBasic(t *testing.T) { diff --git a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go index 7545851fe..3b3f8492c 100644 --- a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go +++ b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type PhoneConfig struct { diff --git a/genesyscloud/telephony_providers_edges_phonebasesettings/data_source_genesyscloud_telephony_providers_edges_phonebasesettings.go b/genesyscloud/telephony_providers_edges_phonebasesettings/data_source_genesyscloud_telephony_providers_edges_phonebasesettings.go index ddbafa09b..89d87eee5 100644 --- a/genesyscloud/telephony_providers_edges_phonebasesettings/data_source_genesyscloud_telephony_providers_edges_phonebasesettings.go +++ b/genesyscloud/telephony_providers_edges_phonebasesettings/data_source_genesyscloud_telephony_providers_edges_phonebasesettings.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourcePhoneBaseSettingsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { diff --git a/genesyscloud/telephony_providers_edges_phonebasesettings/genesyscloud_telephony_providers_edges_phonebasesettings_proxy.go b/genesyscloud/telephony_providers_edges_phonebasesettings/genesyscloud_telephony_providers_edges_phonebasesettings_proxy.go index 47093078c..7fe288706 100644 --- a/genesyscloud/telephony_providers_edges_phonebasesettings/genesyscloud_telephony_providers_edges_phonebasesettings_proxy.go +++ b/genesyscloud/telephony_providers_edges_phonebasesettings/genesyscloud_telephony_providers_edges_phonebasesettings_proxy.go @@ -3,7 +3,7 @@ package telephony_providers_edges_phonebasesettings import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *phoneBaseProxy diff --git a/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings.go b/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings.go index 3ac3ed4dd..65e682d22 100644 --- a/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings.go +++ b/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func createPhoneBaseSettings(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { diff --git a/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_test.go b/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_test.go index 864dc06f4..b3c0eb40d 100644 --- a/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_test.go +++ b/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_test.go @@ -11,7 +11,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourcePhoneBaseSettings(t *testing.T) { diff --git a/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_utils.go b/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_utils.go index 9cd0bc6be..7cd2824ac 100644 --- a/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_utils.go +++ b/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_utils.go @@ -7,7 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func generatePhoneBaseSettingsDataSource( diff --git a/genesyscloud/telephony_providers_edges_site/data_source_genesyscloud_telephony_providers_edges_site_test.go b/genesyscloud/telephony_providers_edges_site/data_source_genesyscloud_telephony_providers_edges_site_test.go index 1ca6a3319..de32d841f 100644 --- a/genesyscloud/telephony_providers_edges_site/data_source_genesyscloud_telephony_providers_edges_site_test.go +++ b/genesyscloud/telephony_providers_edges_site/data_source_genesyscloud_telephony_providers_edges_site_test.go @@ -7,7 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "testing" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" gcloud "terraform-provider-genesyscloud/genesyscloud" diff --git a/genesyscloud/telephony_providers_edges_site/genesyscloud_telephony_providers_edges_site_proxy.go b/genesyscloud/telephony_providers_edges_site/genesyscloud_telephony_providers_edges_site_proxy.go index bd7b487ee..12ec0e4d8 100644 --- a/genesyscloud/telephony_providers_edges_site/genesyscloud_telephony_providers_edges_site_proxy.go +++ b/genesyscloud/telephony_providers_edges_site/genesyscloud_telephony_providers_edges_site_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site.go b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site.go index 5297248fe..23208cad9 100644 --- a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site.go +++ b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllSites(ctx context.Context, sdkConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_schema.go b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_schema.go index db12e288d..55b4e51b1 100644 --- a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_schema.go +++ b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_schema.go @@ -2,13 +2,14 @@ package telephony_providers_edges_site import ( "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" "terraform-provider-genesyscloud/genesyscloud/validators" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_test.go b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_test.go index d601105cc..e44edd2d8 100644 --- a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_test.go +++ b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_test.go @@ -18,7 +18,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceSite(t *testing.T) { diff --git a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_utils.go b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_utils.go index 4cfd92d46..2fbbae030 100644 --- a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_utils.go +++ b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_utils.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/leekchan/timeutil" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_init_test.go b/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_init_test.go index dfa9e4042..9f07f2aa9 100644 --- a/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_init_test.go +++ b/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_init_test.go @@ -1,8 +1,6 @@ package telephony_providers_edges_site_outbound_route import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "sync" gcloud "terraform-provider-genesyscloud/genesyscloud" @@ -10,6 +8,9 @@ import ( "terraform-provider-genesyscloud/genesyscloud/telephony" "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site" "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_proxy.go b/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_proxy.go index d9ff5d76c..14cf01d7d 100644 --- a/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_proxy.go +++ b/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_proxy.go @@ -2,9 +2,10 @@ package telephony_providers_edges_site_outbound_route import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" telephonyProvidersEdgesSite "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route.go b/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route.go index bcbab805e..24643c857 100644 --- a/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route.go +++ b/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route.go @@ -3,10 +3,6 @@ package telephony_providers_edges_site_outbound_route import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -17,6 +13,11 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/lists" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllSitesOutboundRoutes(ctx context.Context, sdkConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_utils.go b/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_utils.go index ababd9fe0..32875f56e 100644 --- a/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_utils.go +++ b/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_utils.go @@ -1,9 +1,10 @@ package telephony_providers_edges_site_outbound_route import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func buildOutboundRoutes(outboundRoutes *schema.Set) *[]platformclientv2.Outboundroutebase { diff --git a/genesyscloud/telephony_providers_edges_trunk/data_source_genesyscloud_telephony_providers_edges_trunk.go b/genesyscloud/telephony_providers_edges_trunk/data_source_genesyscloud_telephony_providers_edges_trunk.go index de61a6741..194790fe9 100644 --- a/genesyscloud/telephony_providers_edges_trunk/data_source_genesyscloud_telephony_providers_edges_trunk.go +++ b/genesyscloud/telephony_providers_edges_trunk/data_source_genesyscloud_telephony_providers_edges_trunk.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceTrunkRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { diff --git a/genesyscloud/telephony_providers_edges_trunk/genesyscloud_telephony_providers_edges_trunk_proxy.go b/genesyscloud/telephony_providers_edges_trunk/genesyscloud_telephony_providers_edges_trunk_proxy.go index 4f2138191..df99c6690 100644 --- a/genesyscloud/telephony_providers_edges_trunk/genesyscloud_telephony_providers_edges_trunk_proxy.go +++ b/genesyscloud/telephony_providers_edges_trunk/genesyscloud_telephony_providers_edges_trunk_proxy.go @@ -3,7 +3,7 @@ package telephony_providers_edges_trunk import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) //generate a proxy for telephony_providers_edges_trunk diff --git a/genesyscloud/telephony_providers_edges_trunk/resource_genesyscloud_telephony_providers_edges_trunk.go b/genesyscloud/telephony_providers_edges_trunk/resource_genesyscloud_telephony_providers_edges_trunk.go index af15ea366..b0791dc9c 100644 --- a/genesyscloud/telephony_providers_edges_trunk/resource_genesyscloud_telephony_providers_edges_trunk.go +++ b/genesyscloud/telephony_providers_edges_trunk/resource_genesyscloud_telephony_providers_edges_trunk.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func createTrunk(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { diff --git a/genesyscloud/tfexporter/genesyscloud_resource_exporter.go b/genesyscloud/tfexporter/genesyscloud_resource_exporter.go index abf75169a..2688a77ac 100644 --- a/genesyscloud/tfexporter/genesyscloud_resource_exporter.go +++ b/genesyscloud/tfexporter/genesyscloud_resource_exporter.go @@ -33,7 +33,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/mohae/deepcopy" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/tfexporter/genesyscloud_resource_exporter_test.go b/genesyscloud/tfexporter/genesyscloud_resource_exporter_test.go index 1f85ff1ff..2c393142f 100644 --- a/genesyscloud/tfexporter/genesyscloud_resource_exporter_test.go +++ b/genesyscloud/tfexporter/genesyscloud_resource_exporter_test.go @@ -3,13 +3,14 @@ package tfexporter import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "reflect" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" "terraform-provider-genesyscloud/genesyscloud/util" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/stretchr/testify/assert" diff --git a/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go b/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go index 4b91ebe6d..98febed09 100644 --- a/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go +++ b/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go @@ -25,7 +25,7 @@ import ( "testing" "time" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/testrunner" diff --git a/genesyscloud/user_roles/genesyscloud_user_roles_proxy.go b/genesyscloud/user_roles/genesyscloud_user_roles_proxy.go index 348ca624b..2ed1c9ea0 100644 --- a/genesyscloud/user_roles/genesyscloud_user_roles_proxy.go +++ b/genesyscloud/user_roles/genesyscloud_user_roles_proxy.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *userRolesProxy diff --git a/genesyscloud/user_roles/resource_genesyscloud_user_roles_utils.go b/genesyscloud/user_roles/resource_genesyscloud_user_roles_utils.go index 9f58a8e8a..aa50ef59a 100644 --- a/genesyscloud/user_roles/resource_genesyscloud_user_roles_utils.go +++ b/genesyscloud/user_roles/resource_genesyscloud_user_roles_utils.go @@ -7,7 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func flattenSubjectRoles(d *schema.ResourceData, p *userRolesProxy) (*schema.Set, *platformclientv2.APIResponse, error) { diff --git a/genesyscloud/util/resourcedata/resourcedata.go b/genesyscloud/util/resourcedata/resourcedata.go index 066abcfc9..37e647084 100644 --- a/genesyscloud/util/resourcedata/resourcedata.go +++ b/genesyscloud/util/resourcedata/resourcedata.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/leekchan/timeutil" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) const ( diff --git a/genesyscloud/util/util_basesetting_properties.go b/genesyscloud/util/util_basesetting_properties.go index 44c0ea6de..8e169e43c 100644 --- a/genesyscloud/util/util_basesetting_properties.go +++ b/genesyscloud/util/util_basesetting_properties.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func BuildTelephonyProperties(d *schema.ResourceData) *map[string]interface{} { diff --git a/genesyscloud/util/util_diagnostic_unit_test.go b/genesyscloud/util/util_diagnostic_unit_test.go index ec9fb4b9f..f5e930874 100644 --- a/genesyscloud/util/util_diagnostic_unit_test.go +++ b/genesyscloud/util/util_diagnostic_unit_test.go @@ -2,12 +2,13 @@ package util import ( "encoding/json" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" - "github.com/stretchr/testify/assert" "net/http" "net/url" "strings" "testing" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" + "github.com/stretchr/testify/assert" ) func TestUnitTestAPIResponseDiagWithGoodApiResponse(t *testing.T) { diff --git a/genesyscloud/util/util_diagnostics.go b/genesyscloud/util/util_diagnostics.go index 7a707a3f0..f0de6a808 100644 --- a/genesyscloud/util/util_diagnostics.go +++ b/genesyscloud/util/util_diagnostics.go @@ -4,8 +4,9 @@ import ( "encoding/json" "errors" "fmt" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type detailedDiagnosticInfo struct { diff --git a/genesyscloud/util/util_divisions.go b/genesyscloud/util/util_divisions.go index 91f269645..0cf72dcf9 100644 --- a/genesyscloud/util/util_divisions.go +++ b/genesyscloud/util/util_divisions.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type JsonMap map[string]interface{} diff --git a/genesyscloud/util/util_domainentities.go b/genesyscloud/util/util_domainentities.go index a72921b5b..08c6b05e6 100644 --- a/genesyscloud/util/util_domainentities.go +++ b/genesyscloud/util/util_domainentities.go @@ -4,7 +4,7 @@ import ( lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func BuildSdkDomainEntityRef(d *schema.ResourceData, idAttr string) *platformclientv2.Domainentityref { diff --git a/genesyscloud/util/util_retries.go b/genesyscloud/util/util_retries.go index 8c819c434..038eb302f 100644 --- a/genesyscloud/util/util_retries.go +++ b/genesyscloud/util/util_retries.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func WithRetries(ctx context.Context, timeout time.Duration, method func() *retry.RetryError) diag.Diagnostics { diff --git a/genesyscloud/webdeployments_configuration/genesyscloud_webdeployments_configuration_proxy.go b/genesyscloud/webdeployments_configuration/genesyscloud_webdeployments_configuration_proxy.go index ea0671576..15094c1b3 100644 --- a/genesyscloud/webdeployments_configuration/genesyscloud_webdeployments_configuration_proxy.go +++ b/genesyscloud/webdeployments_configuration/genesyscloud_webdeployments_configuration_proxy.go @@ -9,7 +9,7 @@ import ( "time" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *webDeploymentsConfigurationProxy diff --git a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration.go b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration.go index ea88bc60a..c6155b6d1 100644 --- a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration.go +++ b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllWebDeploymentConfigurations(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_test.go b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_test.go index 59984641e..2c6c79297 100644 --- a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_test.go +++ b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type scCustomMessageConfig struct { diff --git a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_journey.go b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_journey.go index 09edc3979..5eca98263 100644 --- a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_journey.go +++ b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_journey.go @@ -4,7 +4,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func buildSelectorEventTriggers(triggers []interface{}) *[]platformclientv2.Selectoreventtrigger { diff --git a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_messenger.go b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_messenger.go index e12d1ae40..7ef740fc6 100644 --- a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_messenger.go +++ b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_messenger.go @@ -1,9 +1,10 @@ package webdeployments_configuration_utils import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/lists" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func buildAppConversations(conversations []interface{}) *platformclientv2.Conversationappsettings { diff --git a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_support_center.go b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_support_center.go index f29d7605d..635fe2fbf 100644 --- a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_support_center.go +++ b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_support_center.go @@ -4,7 +4,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func buildSupportCenterHeroStyle(styles []interface{}) *platformclientv2.Supportcenterherostyle { diff --git a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_utils.go b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_utils.go index b12770c46..73db3dbdc 100644 --- a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_utils.go +++ b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_utils.go @@ -7,7 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func buildCobrowseSettings(d *schema.ResourceData) *platformclientv2.Cobrowsesettings { diff --git a/genesyscloud/webdeployments_deployment/genesyscloud_webdeployments_deployment_proxy.go b/genesyscloud/webdeployments_deployment/genesyscloud_webdeployments_deployment_proxy.go index 5dfb49182..52a06d5cc 100644 --- a/genesyscloud/webdeployments_deployment/genesyscloud_webdeployments_deployment_proxy.go +++ b/genesyscloud/webdeployments_deployment/genesyscloud_webdeployments_deployment_proxy.go @@ -3,14 +3,15 @@ package webdeployments_deployment import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "log" "strconv" "terraform-provider-genesyscloud/genesyscloud/util" "time" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *webDeploymentsProxy diff --git a/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment.go b/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment.go index d8ce2bff2..d3eacdd4c 100644 --- a/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment.go +++ b/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllWebDeployments(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_test.go b/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_test.go index 0f223d80d..6582e2602 100644 --- a/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_test.go +++ b/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceWebDeploymentsDeployment(t *testing.T) { diff --git a/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_utils.go b/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_utils.go index 358560e1e..964adbcf1 100644 --- a/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_utils.go +++ b/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_utils.go @@ -4,7 +4,7 @@ import ( "errors" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func alwaysDifferent(k, old, new string, d *schema.ResourceData) bool { diff --git a/go.mod b/go.mod index 641f4f37c..e1c1b31e1 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 github.com/leekchan/timeutil v0.0.0-20150802142658-28917288c48d github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 - github.com/mypurecloud/platform-client-sdk-go/v131 v131.0.0 + github.com/mypurecloud/platform-client-sdk-go/v133 v133.0.0 github.com/nyaruka/phonenumbers v1.3.6 github.com/rjNemo/underscore v0.6.1 github.com/zclconf/go-cty v1.14.4 diff --git a/go.sum b/go.sum index ed2d47cac..ad41a8428 100644 --- a/go.sum +++ b/go.sum @@ -257,8 +257,8 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mypurecloud/platform-client-sdk-go/v131 v131.0.0 h1:2YkBK/2pSoaehuSTqhFDXb806nxmHIrz7RxKsQSqM/0= -github.com/mypurecloud/platform-client-sdk-go/v131 v131.0.0/go.mod h1:pWn1ub6TxkdOiI1mgZED+fICo/JiqujY4h+wfgYbOi4= +github.com/mypurecloud/platform-client-sdk-go/v133 v133.0.0 h1:QXLhk65lm4ObgEZLm49bJauEtigMLV/Xo61wF3t3eDE= +github.com/mypurecloud/platform-client-sdk-go/v133 v133.0.0/go.mod h1:xzHvr5pv/axk+ieUu4gpvZEvMcqFTFcR53IzPxz55OU= github.com/nyaruka/phonenumbers v1.3.6 h1:33owXWp4d1U+Tyaj9fpci6PbvaQZcXBUO2FybeKeLwQ= github.com/nyaruka/phonenumbers v1.3.6/go.mod h1:Ut+eFwikULbmCenH6InMKL9csUNLyxHuBLyfkpum11s= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= From 2a3b411f93d7b7cabb36570190e1d608c5a86a9c Mon Sep 17 00:00:00 2001 From: Ivan Mikhalchenko Date: Wed, 26 Jun 2024 17:27:49 +0200 Subject: [PATCH 33/62] feat/COBROWSE-2427 pause field added (#1121) * updated version to 133 * pause_criteria changes done * reveted back go.mod * changed description * changed description * one more change * merged dev * crazy merge conflicts * made changes based on review * go.mod changed * more changes after review --------- Co-authored-by: ivan --- .../resources/webdeployments_configuration.md | 14 ++++++++++ .../resource.tf | 4 +++ ...oud_webdeployments_configuration_schema.go | 20 ++++++++++++++ ...cloud_webdeployments_configuration_test.go | 27 +++++++++++++++++-- ...loud_webdeployments_configuration_utils.go | 15 +++++++++++ go.sum | 22 +++++++++++++++ 6 files changed, 100 insertions(+), 2 deletions(-) diff --git a/docs/resources/webdeployments_configuration.md b/docs/resources/webdeployments_configuration.md index cb3d040f9..f3d258b66 100644 --- a/docs/resources/webdeployments_configuration.md +++ b/docs/resources/webdeployments_configuration.md @@ -100,6 +100,10 @@ resource "genesyscloud_webdeployments_configuration" "exampleConfiguration" { channels = ["Webmessaging", "Voice"] mask_selectors = [".my-class", "#my-id"] readonly_selectors = [".my-class", "#my-id"] + pause_criteria = { + url_fragment = "/sensitive" + condition = "includes" + } } journey_events { enabled = true @@ -213,8 +217,18 @@ Optional: - `channels` (List of String) List of channels through which cobrowse is available (for now only Webmessaging and Voice) - `enabled` (Boolean) Whether or not cobrowse is enabled - `mask_selectors` (List of String) List of CSS selectors which should be masked when screen sharing is active +- `pause_criteria` (Block List) Pause criteria that will pause cobrowse if some of them are met in the user's URL (see [below for nested schema](#nestedblock--cobrowse--pause_criteria)) - `readonly_selectors` (List of String) List of CSS selectors which should be read-only when screen sharing is active + +### Nested Schema for `cobrowse.pause_criteria` + +Required: + +- `condition` (String) The condition to be applied to the `url_fragment`. Conditions are 'includes', 'does_not_include', 'starts_with', 'ends_with', 'equals' +- `url_fragment` (String) A string representing a part of the URL that, when matched according to the specified condition, will trigger a pause in the cobrowse session + + ### Nested Schema for `custom_i18n_labels` diff --git a/examples/resources/genesyscloud_webdeployments_configuration/resource.tf b/examples/resources/genesyscloud_webdeployments_configuration/resource.tf index ff8944c76..982c2b1fc 100644 --- a/examples/resources/genesyscloud_webdeployments_configuration/resource.tf +++ b/examples/resources/genesyscloud_webdeployments_configuration/resource.tf @@ -75,6 +75,10 @@ resource "genesyscloud_webdeployments_configuration" "exampleConfiguration" { channels = ["Webmessaging", "Voice"] mask_selectors = [".my-class", "#my-id"] readonly_selectors = [".my-class", "#my-id"] + pause_criteria = { + url_fragment = "/sensitive" + condition = "includes" + } } journey_events { enabled = true diff --git a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_schema.go b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_schema.go index 8cb13177c..22d1939be 100644 --- a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_schema.go +++ b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_schema.go @@ -356,6 +356,26 @@ var ( Optional: true, Elem: &schema.Schema{Type: schema.TypeString}, }, + "pause_criteria": { + Description: "Pause criteria that will pause cobrowse if some of them are met in the user's URL", + Type: schema.TypeList, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "url_fragment": { + Description: "A string representing a part of the URL that, when matched according to the specified condition, will trigger a pause in the cobrowse session", + Type: schema.TypeString, + Required: true, + }, + "condition": { + Description: "The condition to be applied to the `url_fragment`. Conditions are 'includes', 'does_not_include', 'starts_with', 'ends_with', 'equals'", + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice([]string{"includes", "does_not_include", "starts_with", "ends_with", "equals"}, false), + }, + }, + }, + }, }, } diff --git a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_test.go b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_test.go index 2c6c79297..8e4abe831 100644 --- a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_test.go +++ b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_test.go @@ -187,6 +187,8 @@ func TestAccResourceWebDeploymentsConfigurationComplex(t *testing.T) { channels, []string{strconv.Quote("selector-one")}, []string{strconv.Quote("selector-one")}, + generatePauseCriteria("/sensitive", "includes"), + generatePauseCriteria("/login", "equals"), ), ), Check: resource.ComposeTestCheckFunc( @@ -257,6 +259,11 @@ func TestAccResourceWebDeploymentsConfigurationComplex(t *testing.T) { resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.mask_selectors.0", "selector-one"), resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.readonly_selectors.#", "1"), resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.readonly_selectors.0", "selector-one"), + resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.pause_criteria.#", "2"), + resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.pause_criteria.0.url_fragment", "/sensitive"), + resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.pause_criteria.0.condition", "includes"), + resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.pause_criteria.1.url_fragment", "/login"), + resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.pause_criteria.1.condition", "equals"), resource.TestCheckResourceAttr(fullResourceName, "journey_events.#", "1"), resource.TestCheckResourceAttr(fullResourceName, "journey_events.0.enabled", util.TrueValue), @@ -312,6 +319,8 @@ func TestAccResourceWebDeploymentsConfigurationComplex(t *testing.T) { channelsUpdate, []string{strconv.Quote("selector-one"), strconv.Quote("selector-two")}, []string{strconv.Quote("selector-one"), strconv.Quote("selector-two")}, + generatePauseCriteria("/sensitive", "includes"), + generatePauseCriteria("/login", "equals"), ), ), Check: resource.ComposeTestCheckFunc( @@ -345,6 +354,11 @@ func TestAccResourceWebDeploymentsConfigurationComplex(t *testing.T) { resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.readonly_selectors.#", "2"), util.ValidateStringInArray(fullResourceName, "cobrowse.0.readonly_selectors", "selector-one"), util.ValidateStringInArray(fullResourceName, "cobrowse.0.readonly_selectors", "selector-two"), + resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.pause_criteria.#", "2"), + resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.pause_criteria.0.url_fragment", "/sensitive"), + resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.pause_criteria.0.condition", "includes"), + resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.pause_criteria.1.url_fragment", "/login"), + resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.pause_criteria.1.condition", "equals"), resource.TestCheckResourceAttr(fullResourceName, "journey_events.#", "1"), resource.TestCheckResourceAttr(fullResourceName, "journey_events.0.enabled", util.TrueValue), resource.TestCheckResourceAttr(fullResourceName, "journey_events.0.excluded_query_parameters.#", "1"), @@ -1034,7 +1048,8 @@ func complexConfigurationResource(name, description, kbId string, nestedBlocks . `, name, description, kbId, strings.Join(nestedBlocks, "\n")) } -func generateWebDeploymentConfigCobrowseSettings(cbEnabled, cbAllowAgentControl string, cbAllowAgentNavigation string, cbChannels []string, cbMaskSelectors []string, cbReadonlySelectors []string) string { +func generateWebDeploymentConfigCobrowseSettings(cbEnabled, cbAllowAgentControl string, cbAllowAgentNavigation string, cbChannels []string, cbMaskSelectors []string, cbReadonlySelectors []string, pauseCriteriaBlocks ...string,) string { + return fmt.Sprintf(` cobrowse { enabled = %s @@ -1043,8 +1058,16 @@ func generateWebDeploymentConfigCobrowseSettings(cbEnabled, cbAllowAgentControl channels = [ %s ] mask_selectors = [ %s ] readonly_selectors = [ %s ] + %s } -`, cbEnabled, cbAllowAgentControl, cbAllowAgentNavigation, strings.Join(cbChannels, ", "), strings.Join(cbMaskSelectors, ", "), strings.Join(cbReadonlySelectors, ", ")) +`, cbEnabled, cbAllowAgentControl, cbAllowAgentNavigation, strings.Join(cbChannels, ", "), strings.Join(cbMaskSelectors, ", "), strings.Join(cbReadonlySelectors, ", "), strings.Join(pauseCriteriaBlocks, "\n")) +} + +func generatePauseCriteria(urlFragment, condition string) string { + return fmt.Sprintf(`pause_criteria { + url_fragment = "%s" + condition = "%s" +}`, urlFragment, condition) } func generateSupportCenterSettings(supportCenter scConfig) string { diff --git a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_utils.go b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_utils.go index 73db3dbdc..2d304c293 100644 --- a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_utils.go +++ b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_utils.go @@ -30,6 +30,20 @@ func buildCobrowseSettings(d *schema.ResourceData) *platformclientv2.Cobrowseset maskSelectors := lists.InterfaceListToStrings(cfg["mask_selectors"].([]interface{})) readonlySelectors := lists.InterfaceListToStrings(cfg["readonly_selectors"].([]interface{})) + var pauseCriteria []platformclientv2.Pausecriteria + if v, ok := cfg["pause_criteria"]; ok { + for _, pc := range v.([]interface{}) { + pcMap := pc.(map[string]interface{}) + urlFragment := pcMap["url_fragment"].(string) + condition := pcMap["condition"].(string) + pauseCriteria = append(pauseCriteria, platformclientv2.Pausecriteria{ + UrlFragment: &urlFragment, + Condition: &condition, + }) + } + } + + return &platformclientv2.Cobrowsesettings{ Enabled: &enabled, AllowAgentControl: &allowAgentControl, @@ -37,6 +51,7 @@ func buildCobrowseSettings(d *schema.ResourceData) *platformclientv2.Cobrowseset Channels: &channels, MaskSelectors: &maskSelectors, ReadonlySelectors: &readonlySelectors, + PauseCriteria: &pauseCriteria, } } diff --git a/go.sum b/go.sum index ad41a8428..458556a79 100644 --- a/go.sum +++ b/go.sum @@ -11,6 +11,7 @@ cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqCl cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= +dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= @@ -25,6 +26,7 @@ github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYr github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/ProtonMail/go-crypto v1.1.0-alpha.2 h1:bkyFVUP+ROOARdgCiJzNQo2V2kiB97LyUpzH9P6Hrlg= github.com/ProtonMail/go-crypto v1.1.0-alpha.2/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= @@ -48,6 +50,7 @@ github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJm github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I= github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= +github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= @@ -58,24 +61,30 @@ github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= +github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= +github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= +github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= +github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys= +github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= @@ -88,6 +97,7 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -197,7 +207,9 @@ github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= @@ -205,15 +217,18 @@ github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7 github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= +github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leekchan/timeutil v0.0.0-20150802142658-28917288c48d h1:2puqoOQwi3Ai1oznMOsFIbifm6kIfJaLLyYzWD4IzTs= github.com/leekchan/timeutil v0.0.0-20150802142658-28917288c48d/go.mod h1:hO90vCP2x3exaSH58BIAowSKvV+0OsY21TtzuFGHON4= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= @@ -268,6 +283,7 @@ github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FI github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= +github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -289,14 +305,17 @@ github.com/rjNemo/underscore v0.6.1/go.mod h1:PwVP2XGRgIpWUkPbb8huhJ9xNWk+0xv9gM github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= +github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/skeema/knownhosts v1.2.2 h1:Iug2P4fLmDw9f41PB6thxUkNUkJzB5i+1/exaj40L3A= +github.com/skeema/knownhosts v1.2.2/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= @@ -338,6 +357,7 @@ github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21 github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= +github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/goldmark v1.7.1 h1:3bajkSilaCbjdKVsKdZjZCLBNPL9pYzrCakKaf4U49U= @@ -347,6 +367,7 @@ github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBv github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8= github.com/zclconf/go-cty v1.14.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6ZMSMNJFMOjqrGHynW3DIBuR2H9j0ug+Mo= +github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940/go.mod h1:CmBdvvj3nqzfzJ6nTCIwDTPZ56aVGvDrmztiO5g3qrM= go.abhg.dev/goldmark/frontmatter v0.2.0 h1:P8kPG0YkL12+aYk2yU3xHv4tcXzeVnN+gU0tJ5JnxRw= go.abhg.dev/goldmark/frontmatter v0.2.0/go.mod h1:XqrEkZuM57djk7zrlRUB02x8I5J0px76YjkOzhB4YlU= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= @@ -523,6 +544,7 @@ gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From a490ebe4b2ba57edc540a14fd926a05e3baff34f Mon Sep 17 00:00:00 2001 From: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Date: Thu, 27 Jun 2024 14:06:31 +0100 Subject: [PATCH 34/62] go mod tidy (#1126) --- go.sum | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/go.sum b/go.sum index 458556a79..ad41a8428 100644 --- a/go.sum +++ b/go.sum @@ -11,7 +11,6 @@ cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqCl cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= -dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= @@ -26,7 +25,6 @@ github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYr github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= -github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/ProtonMail/go-crypto v1.1.0-alpha.2 h1:bkyFVUP+ROOARdgCiJzNQo2V2kiB97LyUpzH9P6Hrlg= github.com/ProtonMail/go-crypto v1.1.0-alpha.2/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= @@ -50,7 +48,6 @@ github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJm github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I= github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= -github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= @@ -61,30 +58,24 @@ github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= -github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= -github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= -github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= -github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= -github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys= -github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= @@ -97,7 +88,6 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -207,9 +197,7 @@ github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= -github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= @@ -217,18 +205,15 @@ github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7 github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= -github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leekchan/timeutil v0.0.0-20150802142658-28917288c48d h1:2puqoOQwi3Ai1oznMOsFIbifm6kIfJaLLyYzWD4IzTs= github.com/leekchan/timeutil v0.0.0-20150802142658-28917288c48d/go.mod h1:hO90vCP2x3exaSH58BIAowSKvV+0OsY21TtzuFGHON4= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= @@ -283,7 +268,6 @@ github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FI github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= -github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -305,17 +289,14 @@ github.com/rjNemo/underscore v0.6.1/go.mod h1:PwVP2XGRgIpWUkPbb8huhJ9xNWk+0xv9gM github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= -github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/skeema/knownhosts v1.2.2 h1:Iug2P4fLmDw9f41PB6thxUkNUkJzB5i+1/exaj40L3A= -github.com/skeema/knownhosts v1.2.2/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= @@ -357,7 +338,6 @@ github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21 github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= -github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/goldmark v1.7.1 h1:3bajkSilaCbjdKVsKdZjZCLBNPL9pYzrCakKaf4U49U= @@ -367,7 +347,6 @@ github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBv github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8= github.com/zclconf/go-cty v1.14.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6ZMSMNJFMOjqrGHynW3DIBuR2H9j0ug+Mo= -github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940/go.mod h1:CmBdvvj3nqzfzJ6nTCIwDTPZ56aVGvDrmztiO5g3qrM= go.abhg.dev/goldmark/frontmatter v0.2.0 h1:P8kPG0YkL12+aYk2yU3xHv4tcXzeVnN+gU0tJ5JnxRw= go.abhg.dev/goldmark/frontmatter v0.2.0/go.mod h1:XqrEkZuM57djk7zrlRUB02x8I5J0px76YjkOzhB4YlU= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= @@ -544,7 +523,6 @@ gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From 83762bb32ed2808d61a3f1607ef65b18d1ed68f5 Mon Sep 17 00:00:00 2001 From: shrutisuryawanshigenesys Date: Thu, 27 Jun 2024 09:08:59 -0400 Subject: [PATCH 35/62] added validation for ja-JP (#1127) --- genesyscloud/resource_genesyscloud_knowledge_knowledgebase.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/genesyscloud/resource_genesyscloud_knowledge_knowledgebase.go b/genesyscloud/resource_genesyscloud_knowledge_knowledgebase.go index 891d6e33d..82ff753e9 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_knowledgebase.go +++ b/genesyscloud/resource_genesyscloud_knowledge_knowledgebase.go @@ -115,7 +115,7 @@ func ResourceKnowledgeKnowledgebase() *schema.Resource { Description: "Core language for knowledge base in which initial content must be created, language codes [en-US, en-UK, en-AU, de-DE] are supported currently, however the new DX knowledge will support all these language codes", Type: schema.TypeString, Required: true, - ValidateFunc: validation.StringInSlice([]string{"en-US", "en-UK", "en-AU", "de-DE", "es-US", "es-ES", "fr-FR", "pt-BR", "nl-NL", "it-IT", "fr-CA"}, false), + ValidateFunc: validation.StringInSlice([]string{"en-US", "en-UK", "en-AU", "de-DE", "es-US", "es-ES", "fr-FR", "pt-BR", "nl-NL", "it-IT", "fr-CA", "ja-JP"}, false), }, "published": { Description: "Flag that indicates the knowledge base is published", From 23ffa1d4066b639045a41573be01ce290e8dbfe3 Mon Sep 17 00:00:00 2001 From: tsantos-genesys <154342374+tsantos-genesys@users.noreply.github.com> Date: Mon, 1 Jul 2024 09:45:26 +0100 Subject: [PATCH 36/62] Cleanup/Use sdk to deal with utilization instead of direct public-api calls (#1123) --- genesyscloud/resource_genesyscloud_user.go | 2 +- .../genesyscloud_routing_utilization_proxy.go | 49 ++----------- ...source_genesyscloud_routing_utilization.go | 37 +++------- .../resource_routing_utilization_utils.go | 71 +++++++++++++++++-- 4 files changed, 84 insertions(+), 75 deletions(-) diff --git a/genesyscloud/resource_genesyscloud_user.go b/genesyscloud/resource_genesyscloud_user.go index 256eaa3cc..76deef3bf 100644 --- a/genesyscloud/resource_genesyscloud_user.go +++ b/genesyscloud/resource_genesyscloud_user.go @@ -1088,7 +1088,7 @@ func readUserRoutingUtilization(d *schema.ResourceData, sdkConfig *platformclien originalLabelUtilizations := originalSettings["label_utilizations"].([]interface{}) // Only add to the state the configured labels, in the configured order, but not any extras, to help terraform with matching new and old state. - filteredLabelUtilizations := routingUtilization.FilterAndFlattenLabelUtilizations(agentUtilization.LabelUtilizations, originalLabelUtilizations) + filteredLabelUtilizations := routingUtilization.FilterAndFlattenLabelUtilizationsInternal(agentUtilization.LabelUtilizations, originalLabelUtilizations) allSettings["label_utilizations"] = filteredLabelUtilizations } else { diff --git a/genesyscloud/routing_utilization/genesyscloud_routing_utilization_proxy.go b/genesyscloud/routing_utilization/genesyscloud_routing_utilization_proxy.go index 305a941ef..401e954ef 100644 --- a/genesyscloud/routing_utilization/genesyscloud_routing_utilization_proxy.go +++ b/genesyscloud/routing_utilization/genesyscloud_routing_utilization_proxy.go @@ -2,28 +2,22 @@ package routing_utilization import ( "context" - "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *routingUtilizationProxy -type getRoutingUtilizationFunc func(ctx context.Context, p *routingUtilizationProxy) (*platformclientv2.APIResponse, error) +type getRoutingUtilizationFunc func(ctx context.Context, p *routingUtilizationProxy) (*platformclientv2.Utilizationresponse, *platformclientv2.APIResponse, error) type updateRoutingUtilizationFunc func(ctx context.Context, p *routingUtilizationProxy, request *platformclientv2.Utilizationrequest) (*platformclientv2.Utilizationresponse, *platformclientv2.APIResponse, error) type deleteRoutingUtilizationFunc func(ctx context.Context, p *routingUtilizationProxy) (*platformclientv2.APIResponse, error) -type updateDirectlyFunc func(ctx context.Context, p *routingUtilizationProxy, d *schema.ResourceData, utilizationRequest []interface{}) (*platformclientv2.APIResponse, error) - type routingUtilizationProxy struct { clientConfig *platformclientv2.Configuration routingApi *platformclientv2.RoutingApi getRoutingUtilizationAttr getRoutingUtilizationFunc updateRoutingUtilizationAttr updateRoutingUtilizationFunc deleteRoutingUtilizationAttr deleteRoutingUtilizationFunc - - updateDirectlyAttr updateDirectlyFunc } func newRoutingUtilizationProxy(clientConfig *platformclientv2.Configuration) *routingUtilizationProxy { @@ -34,8 +28,6 @@ func newRoutingUtilizationProxy(clientConfig *platformclientv2.Configuration) *r getRoutingUtilizationAttr: getRoutingUtilizationFn, updateRoutingUtilizationAttr: updateRoutingUtilizationFn, deleteRoutingUtilizationAttr: deleteRoutingUtilizationFn, - - updateDirectlyAttr: updateDirectlyFn, } } @@ -46,31 +38,20 @@ func getRoutingUtilizationProxy(clientConfig *platformclientv2.Configuration) *r return internalProxy } -func (p *routingUtilizationProxy) getRoutingUtilization(ctx context.Context) (*platformclientv2.APIResponse, error) { +func (p *routingUtilizationProxy) getRoutingUtilization(ctx context.Context) (*platformclientv2.Utilizationresponse, *platformclientv2.APIResponse, error) { return p.getRoutingUtilizationAttr(ctx, p) } + func (p *routingUtilizationProxy) updateRoutingUtilization(ctx context.Context, request *platformclientv2.Utilizationrequest) (*platformclientv2.Utilizationresponse, *platformclientv2.APIResponse, error) { return p.updateRoutingUtilizationAttr(ctx, p, request) } + func (p *routingUtilizationProxy) deleteRoutingUtilization(ctx context.Context) (*platformclientv2.APIResponse, error) { return p.deleteRoutingUtilizationAttr(ctx, p) } -func (p *routingUtilizationProxy) updateDirectly(ctx context.Context, d *schema.ResourceData, utilizationRequest []interface{}) (*platformclientv2.APIResponse, error) { - return p.updateDirectlyAttr(ctx, p, d, utilizationRequest) -} - -// Calling the Utilization API directly while the label feature is not available. -// Once it is, this code can go back to using platformclientv2's RoutingApi to make the call. -func getRoutingUtilizationFn(ctx context.Context, p *routingUtilizationProxy) (*platformclientv2.APIResponse, error) { - apiClient := &p.routingApi.Configuration.APIClient - path := fmt.Sprintf("%s/api/v2/routing/utilization", p.routingApi.Configuration.BasePath) - headerParams := buildHeaderParams(p.routingApi) - resp, err := apiClient.CallAPI(path, "GET", nil, headerParams, nil, nil, "", nil) - if err != nil { - return resp, fmt.Errorf("failed to get routing utilization %s ", err) - } - return resp, nil +func getRoutingUtilizationFn(ctx context.Context, p *routingUtilizationProxy) (*platformclientv2.Utilizationresponse, *platformclientv2.APIResponse, error) { + return p.routingApi.GetRoutingUtilization() } func updateRoutingUtilizationFn(ctx context.Context, p *routingUtilizationProxy, utilizationRequest *platformclientv2.Utilizationrequest) (*platformclientv2.Utilizationresponse, *platformclientv2.APIResponse, error) { @@ -80,21 +61,3 @@ func updateRoutingUtilizationFn(ctx context.Context, p *routingUtilizationProxy, func deleteRoutingUtilizationFn(ctx context.Context, p *routingUtilizationProxy) (*platformclientv2.APIResponse, error) { return p.routingApi.DeleteRoutingUtilization() } - -// If the resource has label(s), calls the Utilization API directly. -// This code can go back to using platformclientv2's RoutingApi to make the call once label utilization is available in platformclientv2's RoutingApi -func updateDirectlyFn(ctx context.Context, p *routingUtilizationProxy, d *schema.ResourceData, utilizationRequest []interface{}) (*platformclientv2.APIResponse, error) { - apiClient := &p.routingApi.Configuration.APIClient - - path := fmt.Sprintf("%s/api/v2/routing/utilization", p.routingApi.Configuration.BasePath) - headerParams := buildHeaderParams(p.routingApi) - requestPayload := make(map[string]interface{}) - requestPayload["utilization"] = buildSdkMediaUtilizations(d) - requestPayload["labelUtilizations"] = BuildLabelUtilizationsRequest(utilizationRequest) - - resp, err := apiClient.CallAPI(path, "PUT", requestPayload, headerParams, nil, nil, "", nil) - if err != nil { - return resp, fmt.Errorf("error updating directly %s", err) - } - return resp, nil -} diff --git a/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization.go b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization.go index 20e417b56..5ead69955 100644 --- a/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization.go +++ b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization.go @@ -2,7 +2,6 @@ package routing_utilization import ( "context" - "encoding/json" "fmt" "log" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -34,17 +33,14 @@ func createRoutingUtilization(ctx context.Context, d *schema.ResourceData, meta } func readRoutingUtilization(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - // Calling the Utilization API directly while the label feature is not available. - // Once it is, this code can go back to using platformclientv2's RoutingApi to make the call. sdkConfig := meta.(*provider.ProviderMeta).ClientConfig proxy := getRoutingUtilizationProxy(sdkConfig) cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceRoutingUtilization(), constants.DefaultConsistencyChecks, resourceName) - orgUtilization := &OrgUtilizationWithLabels{} log.Printf("Reading Routing Utilization") return util.WithRetriesForRead(ctx, d, func() *retry.RetryError { - resp, err := proxy.getRoutingUtilization(ctx) + orgUtilization, resp, err := proxy.getRoutingUtilization(ctx) if err != nil { if util.IsStatus404(resp) { return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read Routing Utilization: %s", err), resp)) @@ -52,12 +48,10 @@ func readRoutingUtilization(ctx context.Context, d *schema.ResourceData, meta in return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read Routing Utilization: %s", err), resp)) } - err = json.Unmarshal(resp.RawBody, &orgUtilization) - if orgUtilization.Utilization != nil { for sdkType, schemaType := range UtilizationMediaTypes { - if mediaSettings, ok := orgUtilization.Utilization[sdkType]; ok { - _ = d.Set(schemaType, FlattenUtilizationSetting(mediaSettings)) + if mediaSettings, ok := (*orgUtilization.Utilization)[sdkType]; ok { + _ = d.Set(schemaType, FlattenMediaUtilization(mediaSettings)) } else { _ = d.Set(schemaType, nil) } @@ -66,8 +60,8 @@ func readRoutingUtilization(ctx context.Context, d *schema.ResourceData, meta in if orgUtilization.LabelUtilizations != nil { originalLabelUtilizations := d.Get("label_utilizations").([]interface{}) - // Only add to the state the configured labels, in the configured order, but not any extras, to help terraform with matching new and old state. - flattenedLabelUtilizations := FilterAndFlattenLabelUtilizations(orgUtilization.LabelUtilizations, originalLabelUtilizations) + // Only add the configured labels to the state, in the configured order, but not any extras, to help terraform with matching new and old state. + flattenedLabelUtilizations := FilterAndFlattenLabelUtilizations(*orgUtilization.LabelUtilizations, originalLabelUtilizations) _ = d.Set("label_utilizations", flattenedLabelUtilizations) } @@ -80,32 +74,21 @@ func updateRoutingUtilization(ctx context.Context, d *schema.ResourceData, meta sdkConfig := meta.(*provider.ProviderMeta).ClientConfig proxy := getRoutingUtilizationProxy(sdkConfig) - labelUtilizations := d.Get("label_utilizations").([]interface{}) - var resp *platformclientv2.APIResponse - var err error - log.Printf("Updating Routing Utilization") // Retrying on 409s because if a label is created immediately before the utilization update, it can lead to a conflict while the utilization is being updated to handle the new label. diagErr := util.RetryWhen(util.IsStatus409, func() (*platformclientv2.APIResponse, diag.Diagnostics) { - // If the resource has label(s), calls the Utilization API directly. - // This code can go back to using platformclientv2's RoutingApi to make the call once label utilization is available in platformclientv2's RoutingApi. - if labelUtilizations != nil && len(labelUtilizations) > 0 { - resp, err := proxy.updateDirectly(ctx, d, labelUtilizations) - if err != nil { - return resp, util.BuildAPIDiagnosticError(resourceName, "Failed to update routing utilization directly", resp) - } - } else { - _, resp, err = proxy.updateRoutingUtilization(ctx, &platformclientv2.Utilizationrequest{ - Utilization: buildSdkMediaUtilizations(d), - }) - } + _, resp, err := proxy.updateRoutingUtilization(ctx, &platformclientv2.Utilizationrequest{ + Utilization: BuildSdkMediaUtilizations(d), + LabelUtilizations: BuildSdkLabelUtilizations(d), + }) if err != nil { return resp, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to update Routing Utilization %s error: %s", d.Id(), err), resp) } return resp, nil }) + if diagErr != nil { return diagErr } diff --git a/genesyscloud/routing_utilization/resource_routing_utilization_utils.go b/genesyscloud/routing_utilization/resource_routing_utilization_utils.go index 4c6757afa..287bb85b1 100644 --- a/genesyscloud/routing_utilization/resource_routing_utilization_utils.go +++ b/genesyscloud/routing_utilization/resource_routing_utilization_utils.go @@ -10,7 +10,7 @@ import ( "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) -func buildSdkMediaUtilizations(d *schema.ResourceData) *map[string]platformclientv2.Mediautilization { +func BuildSdkMediaUtilizations(d *schema.ResourceData) *map[string]platformclientv2.Mediautilization { settings := make(map[string]platformclientv2.Mediautilization) for sdkType, schemaType := range UtilizationMediaTypes { @@ -42,6 +42,24 @@ func BuildSdkMediaUtilization(settings []interface{}) platformclientv2.Mediautil } } +func BuildSdkLabelUtilizations(d *schema.ResourceData) *map[string]platformclientv2.Labelutilizationrequest { + labelUtilizations := d.Get("label_utilizations").([]interface{}) + request := make(map[string]platformclientv2.Labelutilizationrequest) + + for _, labelUtilization := range labelUtilizations { + labelUtilizationMap := labelUtilization.(map[string]interface{}) + maxCapacity := labelUtilizationMap["maximum_capacity"].(int) + interruptingLabelIds := lists.SetToStringList(labelUtilizationMap["interrupting_label_ids"].(*schema.Set)) + + request[labelUtilizationMap["label_id"].(string)] = platformclientv2.Labelutilizationrequest{ + MaximumCapacity: &maxCapacity, + InterruptingLabelIds: interruptingLabelIds, + } + } + + return &request +} + func BuildLabelUtilizationsRequest(labelUtilizations []interface{}) map[string]LabelUtilization { request := make(map[string]LabelUtilization) for _, labelUtilization := range labelUtilizations { @@ -56,6 +74,49 @@ func BuildLabelUtilizationsRequest(labelUtilizations []interface{}) map[string]L return request } +func FlattenMediaUtilization(mediaUtilization platformclientv2.Mediautilization) []interface{} { + settingsMap := make(map[string]interface{}) + + settingsMap["maximum_capacity"] = mediaUtilization.MaximumCapacity + settingsMap["include_non_acd"] = mediaUtilization.IncludeNonAcd + if mediaUtilization.InterruptableMediaTypes != nil { + settingsMap["interruptible_media_types"] = lists.StringListToSet(*mediaUtilization.InterruptableMediaTypes) + } + + return []interface{}{settingsMap} +} + +func FilterAndFlattenLabelUtilizations(labelUtilizations map[string]platformclientv2.Labelutilizationresponse, originalLabelUtilizations []interface{}) []interface{} { + flattenedLabelUtilizations := make([]interface{}, 0) + + for _, originalLabelUtilization := range originalLabelUtilizations { + originalLabelId := (originalLabelUtilization.(map[string]interface{}))["label_id"].(string) + + for currentLabelId, currentLabelUtilization := range labelUtilizations { + if currentLabelId == originalLabelId { + flattenedLabelUtilizations = append(flattenedLabelUtilizations, flattenLabelUtilization(currentLabelId, currentLabelUtilization)) + delete(labelUtilizations, currentLabelId) + break + } + } + } + + return flattenedLabelUtilizations +} + +func flattenLabelUtilization(labelId string, labelUtilization platformclientv2.Labelutilizationresponse) map[string]interface{} { + utilizationMap := make(map[string]interface{}) + + utilizationMap["label_id"] = labelId + utilizationMap["maximum_capacity"] = labelUtilization.MaximumCapacity + if labelUtilization.InterruptingLabelIds != nil { + utilizationMap["interrupting_label_ids"] = lists.StringListToSet(*labelUtilization.InterruptingLabelIds) + } + + return utilizationMap +} + +// To be removed once resource_user is refactored to use FlattenMediaUtilization instead func FlattenUtilizationSetting(settings MediaUtilization) []interface{} { settingsMap := make(map[string]interface{}) @@ -68,7 +129,8 @@ func FlattenUtilizationSetting(settings MediaUtilization) []interface{} { return []interface{}{settingsMap} } -func FilterAndFlattenLabelUtilizations(labelUtilizations map[string]LabelUtilization, originalLabelUtilizations []interface{}) []interface{} { +// To be removed once resource_user is refactored to use FilterAndFlattenLabelUtilizations instead +func FilterAndFlattenLabelUtilizationsInternal(labelUtilizations map[string]LabelUtilization, originalLabelUtilizations []interface{}) []interface{} { flattenedLabelUtilizations := make([]interface{}, 0) for _, originalLabelUtilization := range originalLabelUtilizations { @@ -76,7 +138,7 @@ func FilterAndFlattenLabelUtilizations(labelUtilizations map[string]LabelUtiliza for currentLabelId, currentLabelUtilization := range labelUtilizations { if currentLabelId == originalLabelId { - flattenedLabelUtilizations = append(flattenedLabelUtilizations, flattenLabelUtilization(currentLabelId, currentLabelUtilization)) + flattenedLabelUtilizations = append(flattenedLabelUtilizations, flattenLabelUtilizationInternal(currentLabelId, currentLabelUtilization)) delete(labelUtilizations, currentLabelId) break } @@ -86,7 +148,8 @@ func FilterAndFlattenLabelUtilizations(labelUtilizations map[string]LabelUtiliza return flattenedLabelUtilizations } -func flattenLabelUtilization(labelId string, labelUtilization LabelUtilization) map[string]interface{} { +// To be removed once resource_user is refactored to use flattenLabelUtilization instead +func flattenLabelUtilizationInternal(labelId string, labelUtilization LabelUtilization) map[string]interface{} { utilizationMap := make(map[string]interface{}) utilizationMap["label_id"] = labelId From 9da5440ae720217f00df12b3520d5f189ed717cb Mon Sep 17 00:00:00 2001 From: Brian Goad Date: Mon, 1 Jul 2024 05:15:35 -0400 Subject: [PATCH 37/62] Fixes DEVTOOLING-674 by allowing the sanitizeMap function to continue processing as sanitizeE164Number and sanitizeRrule functions could return empty strings. If they do, we want to filter them out (further down the sanitizeMap function) unless they are explicitly marked to be kept by the AllowForZeroValues config to be set (#1128) --- genesyscloud/tfexporter/genesyscloud_resource_exporter.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/genesyscloud/tfexporter/genesyscloud_resource_exporter.go b/genesyscloud/tfexporter/genesyscloud_resource_exporter.go index 2688a77ac..c4bb43660 100644 --- a/genesyscloud/tfexporter/genesyscloud_resource_exporter.go +++ b/genesyscloud/tfexporter/genesyscloud_resource_exporter.go @@ -1231,19 +1231,17 @@ func (g *GenesysCloudResourceExporter) sanitizeConfigMap( } if exporter.IsAttributeE164(currAttr) { - if phoneNumber, ok := configMap[key].(string); !ok || phoneNumber == "" { + if _, ok := configMap[key].(string); !ok { continue } configMap[key] = sanitizeE164Number(configMap[key].(string)) - continue } if exporter.IsAttributeRrule(currAttr) { - if rrule, ok := configMap[key].(string); !ok || rrule == "" { + if _, ok := configMap[key].(string); !ok { continue } configMap[key] = sanitizeRrule(configMap[key].(string)) - continue } switch val.(type) { From 5d3d7578658f8644ed0857b7fa1e7ab946e2c874 Mon Sep 17 00:00:00 2001 From: Brian Goad Date: Mon, 1 Jul 2024 06:24:32 -0400 Subject: [PATCH 38/62] Add `make` command for generating docs (#1134) --- GNUmakefile | 5 ++++- README.md | 32 +++++++++++++++++--------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 3dbb0308d..4b9cf8322 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,6 +1,6 @@ default: build -.PHONY: testacc clean build sideload +.PHONY: testacc clean build docs sideload DIST_DIR=./dist BIN_NAME=terraform-provider-genesyscloud @@ -29,6 +29,9 @@ testacc: testunit: TF_UNIT=1 go test ./... -run TestUnit -cover -count=1 -coverprofile=coverage_unit.out +# Generate docs +docs: + go generate coverageacc: go tool cover -func coverage.out | grep "total:" | \ diff --git a/README.md b/README.md index 919101ea1..1260c7fed 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,13 @@ ![tests](https://github.com/MyPureCloud/terraform-provider-genesyscloud/workflows/Tests/badge.svg?branch=main) + # Genesys Cloud Terraform Provider + Terraform Logo ## Requirements -- [Terraform](https://www.terraform.io/downloads.html) >= 1.0.x -- [Go](https://golang.org/doc/install) >= 1.18 +- [Terraform](https://www.terraform.io/downloads.html) >= 1.0.x +- [Go](https://golang.org/doc/install) >= 1.18 ## Building The Provider @@ -45,9 +47,9 @@ GENESYSCLOUD_ACCESS_TOKEN GENESYSCLOUD_REGION ``` -*Note:* If `GENESYSCLOUD_ACCESS_TOKEN` is set, the Oauth client will use the access token instead of client credentials to make requests. +_Note:_ If `GENESYSCLOUD_ACCESS_TOKEN` is set, the Oauth client will use the access token instead of client credentials to make requests. -*Note:* The provider makes Public API calls to perform all of the CRUD operations necessary to manage Genesys Cloud resources. All of these API calls require specific permissions and OAuth scopes. Therefore it is important that you verify your OAuth Client is authorized for all necessary scopes and is assigned an admin role capable of creating, reading, updating, and deleting all resources that your Terraform configuration will manage. +_Note:_ The provider makes Public API calls to perform all of the CRUD operations necessary to manage Genesys Cloud resources. All of these API calls require specific permissions and OAuth scopes. Therefore it is important that you verify your OAuth Client is authorized for all necessary scopes and is assigned an admin role capable of creating, reading, updating, and deleting all resources that your Terraform configuration will manage. For any issues, questions, or suggestions for the provider, visit the [Genesys Cloud Developer Forum](https://developer.mypurecloud.com/forum/) @@ -61,11 +63,11 @@ port - Port of the Proxy server host - Host Ip or DNS of the proxy server protocol - Protocol required to connect to the Proxy (http or https) -The 'proxy' has another section which is an optional section. +The 'proxy' has another section which is an optional section. If the proxy requires authentication to connect to 'auth' needs to be mentioned under the 'Proxy'. -An example of the provider configuration with the proxy: +An example of the provider configuration with the proxy: ```hcl provider "genesyscloud" { @@ -73,7 +75,7 @@ provider "genesyscloud" { oauthclient_secret = "" aws_region = "" - proxy { + proxy { host = "example.com" port = "8443" protocol = "https" @@ -100,11 +102,13 @@ GENESYSCLOUD_PROXY_AUTH_PASSWORD ### Data Sources There may be cases where you want to reference existing resources in a Terraform configuration file but do not want those resources to be managed by Terraform. This provider supports several data source types that can act as a read-only resource for existing objects in your org. To include one in your configuration, add a `data` block to your configuration file with one of the supported data source types: + ```hcl data "genesyscloud_auth_role" "employee" { name = "employee" } ``` + The example above will attempt to find a role named "employee" which can be referenced elsewhere in the config. By default, all data sources will allow you to access the `id` attribute which is useful for setting reference attributes that require IDs. Additional attributes may be added to data sources as needs arise. ## Developing the Provider @@ -121,32 +125,30 @@ In order to run the full suite of Acceptance tests, run `make testacc`. You can $ make testacc TESTARGS="-run TestAccResourceUserBasic" ``` -All new resources must have passing acceptance tests and docs in order to be merged. Most of the docs are generated automatically from the schema and examples folder by running `go generate`. - +All new resources must have passing acceptance tests and docs in order to be merged. Most of the docs are generated automatically from the schema and examples folder by running `make docs`. To run all of the unit tests: + ```sh $make testunit ``` - - ### Adding a new resource type -1. Create new package inside `genesyscloud` with the following files. The package name should match the name of the resource (minus, the genesyscloud_ prefix). +1. Create new package inside `genesyscloud` with the following files. The package name should match the name of the resource (minus, the genesyscloud\_ prefix). - `resource_genesyscloud_{resource_name}_schema.go` - The file containing the schema definition for the resource, data source, and exporter. It also contains a constant variable which defines the resource name, and a public function called `SetRegistrar`, which will be called from outside the package to register the resource with the provider. The schema should closely match Public API schemas, but there are some Terraform schema limitations that may require some deviation from the API. - `resource_genesyscloud_{resource_name}.go` - Contains the create, read, update and delete functions for the resource (the methods for the resource's `CreateContext`, `ReadContext`, `UpdateContext`, and `DeleteContext` attributes.) It also contains the getAll function to be used by the exporter. If you have a few helper functions present in this file, that is fine, but if there are more than 1-2 helper functions you should create a `resource_genesyscloud_{resource_name}_utils.go` to contain the business logic. - - `resource_genesyscloud_{resource_name}_test.go` - Contains the resource tests. Write acceptance test cases that cover all of the attributes and CRUD operations for the resource. Acceptance tests modify real resources in a test org and require an OAuth Client authorized to create, update, and delete the resource type in the org. See existing tests for examples and [Terraform Acceptance Test documentation](https://www.terraform.io/docs/extend/testing/acceptance-tests/index.html) for more details. Unit tests are also encouraged where applicable (for helper functions etc.) + - `resource_genesyscloud_{resource_name}_test.go` - Contains the resource tests. Write acceptance test cases that cover all of the attributes and CRUD operations for the resource. Acceptance tests modify real resources in a test org and require an OAuth Client authorized to create, update, and delete the resource type in the org. See existing tests for examples and [Terraform Acceptance Test documentation](https://www.terraform.io/docs/extend/testing/acceptance-tests/index.html) for more details. Unit tests are also encouraged where applicable (for helper functions etc.) - `data_source_genesyscloud_{resource_name}.go` - This file contains all of the data source logic for a resource. The data source should call any Genesys Cloud APIs through its API proxy class. All functions and variables in this class should be private. - `data_source_genesyscloud_{resource_name}_test.go` - Contains the data source tests. - `genesyscloud_{resource_name}_proxy.go` - This contains all of the API logic for interacting with the Genesys Cloud APIs. This is meant to be an isolated layer from Terraform, so know Terraform objects should be passed back and forth to this code. All functions and variables in this class should be private. - `genesyscloud_{resource_name}_init_test.go` - This file contains all of the logic needed to initialize a test case for your resource. All functions and variables in this class should be private. -2. Add a new folder for the resource and data source under the `/examples` folder. An example `resource.tf` file for the resource should be added to the folder along with an `apis.md` file listing all of the APIs the resource uses. To generate the documentation, run `go generate`. __Note:__ Everything inside the `docs` directory is generated based off schema data and the content inside `examples`. Do not manually edit anything inside `docs`. +2. Add a new folder for the resource and data source under the `/examples` folder. An example `resource.tf` file for the resource should be added to the folder along with an `apis.md` file listing all of the APIs the resource uses. To generate the documentation, run `go generate`. **Note:** Everything inside the `docs` directory is generated based off schema data and the content inside `examples`. Do not manually edit anything inside `docs`. 3. Import your package to `main.go` at the root of the project and, from the `registerResources` function, call the SetRegistrar function passing in the `regInstance` variable. If you want to go off of an example, we recommend using the [external contacts](https://github.com/MyPureCloud/terraform-provider-genesyscloud/tree/main/genesyscloud/external_contacts) package. -### Cx As Code Resource Generator +### Cx As Code Resource Generator [The Cx as Code Resource Generator](https://github.com/MyPureCloud/cxascode-resource-generator) is a tool that can help generate resources for Cx as Code and speed up development. The resource generator will generate resources using the package structure mentioned above. The project can be found [here](https://github.com/MyPureCloud/cxascode-resource-generator) and all usage is documented in the README. Please note that the resource generator is not perfect, it is a tool to help with development and the generated code will require review and the package will still need to be registered manually in `main.go`. From fb72a00529de62ba35c9b305df081b89a2e35a25 Mon Sep 17 00:00:00 2001 From: Brian Goad Date: Tue, 2 Jul 2024 06:16:07 -0400 Subject: [PATCH 39/62] Update latest language codes (#1130) * Pull in latest language codes from the API schema. See values available in dropdown for language field in API Explorer https://apicentral.genesys.cloud/api-explorer\#post-api-v2-knowledge-knowledgebases and https://apicentral.genesys.cloud/api-explorer\#post-api-v2-knowledge-knowledgebases--knowledgeBaseId--languages--languageCode--categories * Pull the language code logic out into its own validator function --- ...ta_source_genesyscloud_knowledge_knowledgebase.go | 10 +++++----- .../resource_genesyscloud_knowledge_knowledgebase.go | 10 +++++----- .../resource_genesyscloud_knowledge_v1_category.go | 10 +++++----- .../resource_genesyscloud_knowledge_v1_document.go | 9 +++++---- genesyscloud/validators/validators.go | 12 ++++++++++++ 5 files changed, 32 insertions(+), 19 deletions(-) diff --git a/genesyscloud/data_source_genesyscloud_knowledge_knowledgebase.go b/genesyscloud/data_source_genesyscloud_knowledge_knowledgebase.go index 24d258401..94cea4a68 100644 --- a/genesyscloud/data_source_genesyscloud_knowledge_knowledgebase.go +++ b/genesyscloud/data_source_genesyscloud_knowledge_knowledgebase.go @@ -5,13 +5,13 @@ import ( "fmt" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" + "terraform-provider-genesyscloud/genesyscloud/validators" "time" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) @@ -26,10 +26,10 @@ func dataSourceKnowledgeKnowledgebase() *schema.Resource { Required: true, }, "core_language": { - Description: "Core language for knowledge base in which initial content must be created, language codes [en-US, en-UK, en-AU, de-DE] are supported currently, however the new DX knowledge will support all these language codes", - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{"en-US", "en-UK", "en-AU", "de-DE", "es-US", "es-ES", "fr-FR", "pt-BR", "nl-NL", "it-IT", "fr-CA"}, false), + Description: "Core language for knowledge base in which initial content must be created, language codes [en-US, en-UK, en-AU, de-DE] are supported currently, however the new DX knowledge will support all these language codes", + Type: schema.TypeString, + Required: true, + ValidateDiagFunc: validators.ValidateLanguageCode, }, }, } diff --git a/genesyscloud/resource_genesyscloud_knowledge_knowledgebase.go b/genesyscloud/resource_genesyscloud_knowledge_knowledgebase.go index 82ff753e9..ebf318da6 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_knowledgebase.go +++ b/genesyscloud/resource_genesyscloud_knowledge_knowledgebase.go @@ -9,6 +9,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/constants" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + "terraform-provider-genesyscloud/genesyscloud/validators" "time" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" @@ -17,7 +18,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) @@ -112,10 +112,10 @@ func ResourceKnowledgeKnowledgebase() *schema.Resource { Optional: true, }, "core_language": { - Description: "Core language for knowledge base in which initial content must be created, language codes [en-US, en-UK, en-AU, de-DE] are supported currently, however the new DX knowledge will support all these language codes", - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{"en-US", "en-UK", "en-AU", "de-DE", "es-US", "es-ES", "fr-FR", "pt-BR", "nl-NL", "it-IT", "fr-CA", "ja-JP"}, false), + Description: "Core language for knowledge base in which initial content must be created, language codes [en-US, en-UK, en-AU, de-DE] are supported currently, however the new DX knowledge will support all these language codes", + Type: schema.TypeString, + Required: true, + ValidateDiagFunc: validators.ValidateLanguageCode, }, "published": { Description: "Flag that indicates the knowledge base is published", diff --git a/genesyscloud/resource_genesyscloud_knowledge_v1_category.go b/genesyscloud/resource_genesyscloud_knowledge_v1_category.go index 816f1d615..ebe0aad6e 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_v1_category.go +++ b/genesyscloud/resource_genesyscloud_knowledge_v1_category.go @@ -8,6 +8,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/constants" + "terraform-provider-genesyscloud/genesyscloud/validators" "time" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" @@ -18,7 +19,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) @@ -144,10 +144,10 @@ func ResourceKnowledgeCategoryV1() *schema.Resource { Required: true, }, "language_code": { - Description: "language code of the category", - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{"en-US", "en-UK", "en-AU", "de-DE", "es-US", "es-ES", "fr-FR", "pt-BR", "nl-NL", "it-IT", "fr-CA"}, false), + Description: "language code of the category", + Type: schema.TypeString, + Required: true, + ValidateDiagFunc: validators.ValidateLanguageCode, }, "knowledge_category": { Description: "Knowledge category parent id", diff --git a/genesyscloud/resource_genesyscloud_knowledge_v1_document.go b/genesyscloud/resource_genesyscloud_knowledge_v1_document.go index 0649a0804..44ac81ff3 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_v1_document.go +++ b/genesyscloud/resource_genesyscloud_knowledge_v1_document.go @@ -8,6 +8,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/constants" + "terraform-provider-genesyscloud/genesyscloud/validators" "time" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" @@ -208,10 +209,10 @@ func ResourceKnowledgeDocumentV1() *schema.Resource { Required: true, }, "language_code": { - Description: "Language code", - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{"en-US", "en-UK", "en-AU", "de-DE", "es-US", "es-ES", "fr-FR", "pt-BR", "nl-NL", "it-IT", "fr-CA"}, false), + Description: "Language code", + Type: schema.TypeString, + Required: true, + ValidateDiagFunc: validators.ValidateLanguageCode, }, "knowledge_document": { Description: "Knowledge document request body", diff --git a/genesyscloud/validators/validators.go b/genesyscloud/validators/validators.go index a375e6bd6..66f89f83a 100644 --- a/genesyscloud/validators/validators.go +++ b/genesyscloud/validators/validators.go @@ -264,3 +264,15 @@ func ValidateHexColor(color interface{}, _ cty.Path) diag.Diagnostics { } return diag.Errorf("Color %v is not a string", color) } + +// ValidateLanguageCode validates that a valid language code that Genesys Cloud supports is passed. +func ValidateLanguageCode(lang interface{}, _ cty.Path) diag.Diagnostics { + langCodeList := []string{"en-US", "en-UK", "en-AU", "en-CA", "en-HK", "en-IN", "en-IE", "en-NZ", "en-PH", "en-SG", "en-ZA", "de-DE", "de-AT", "de-CH", "es-AR", "es-CO", "es-MX", "es-US", "es-ES", "fr-FR", "fr-BE", "fr-CA", "fr-CH", "pt-BR", "pt-PT", "nl-NL", "nl-BE", "it-IT", "ca-ES", "tr-TR", "sv-SE", "fi-FI", "nb-NO", "da-DK", "ja-JP", "ar-AE", "zh-CN", "zh-TW", "zh-HK", "ko-KR", "pl-PL", "hi-IN", "th-TH", "hu-HU", "vi-VN", "uk-UA"} + if langCode, ok := lang.(string); ok { + if lists.ItemInSlice(langCode, langCodeList) { + return nil + } + return diag.Errorf("Language code %s not found in language code list %v", langCode, langCodeList) + } + return diag.Errorf("Language code %v is not a string", lang) +} From 28159387fe3382f2591aa05cd36e0db2a7c7d590 Mon Sep 17 00:00:00 2001 From: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Date: Tue, 2 Jul 2024 12:01:55 +0100 Subject: [PATCH 40/62] Fixed export for teams (#1140) --- genesyscloud/team/genesyscloud_team_proxy.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/genesyscloud/team/genesyscloud_team_proxy.go b/genesyscloud/team/genesyscloud_team_proxy.go index c33c27eab..7feba34d9 100644 --- a/genesyscloud/team/genesyscloud_team_proxy.go +++ b/genesyscloud/team/genesyscloud_team_proxy.go @@ -129,6 +129,7 @@ func createTeamFn(ctx context.Context, p *teamProxy, team *platformclientv2.Team func getAllTeamFn(ctx context.Context, p *teamProxy, name string) (*[]platformclientv2.Team, *platformclientv2.APIResponse, error) { var ( after string + err error allTeams []platformclientv2.Team response *platformclientv2.APIResponse ) @@ -152,7 +153,7 @@ func getAllTeamFn(ctx context.Context, p *teamProxy, name string) (*[]platformcl break } - after, err := util.GetQueryParamValueFromUri(*teams.NextUri, "after") + after, err = util.GetQueryParamValueFromUri(*teams.NextUri, "after") if err != nil { return nil, resp, fmt.Errorf("unable to parse after cursor from teams next uri: %v", err) } From d32d17a85df7702cb267cd8740e6c0f7eccc262c Mon Sep 17 00:00:00 2001 From: tsantos-genesys <154342374+tsantos-genesys@users.noreply.github.com> Date: Tue, 2 Jul 2024 14:59:02 +0100 Subject: [PATCH 41/62] Cleanup/Use sdk instead of direct calls to user utilization (#1136) --- genesyscloud/resource_genesyscloud_user.go | 73 ++++++------------ .../resource_genesyscloud_user_test.go | 2 +- ...source_genesyscloud_routing_utilization.go | 2 +- ...genesyscloud_routing_utilization_schema.go | 16 ---- .../resource_routing_utilization_utils.go | 77 +------------------ 5 files changed, 25 insertions(+), 145 deletions(-) diff --git a/genesyscloud/resource_genesyscloud_user.go b/genesyscloud/resource_genesyscloud_user.go index 76deef3bf..0276edaae 100644 --- a/genesyscloud/resource_genesyscloud_user.go +++ b/genesyscloud/resource_genesyscloud_user.go @@ -2,7 +2,6 @@ package genesyscloud import ( "context" - "encoding/json" "fmt" "log" "strings" @@ -28,12 +27,6 @@ import ( "github.com/nyaruka/phonenumbers" ) -type AgentUtilizationWithLabels struct { - Utilization map[string]routingUtilization.MediaUtilization `json:"utilization"` - LabelUtilizations map[string]routingUtilization.LabelUtilization `json:"labelUtilizations"` - Level string `json:"level"` -} - var ( contactTypeEmail = "EMAIL" @@ -531,7 +524,7 @@ func createUser(ctx context.Context, d *schema.ResourceData, meta interface{}) d return diagErr } - diagErr = updateUserRoutingUtilization(d, usersAPI, sdkConfig) + diagErr = updateUserRoutingUtilization(d, usersAPI) if diagErr != nil { return diagErr } @@ -602,7 +595,7 @@ func readUser(ctx context.Context, d *schema.ResourceData, meta interface{}) dia d.Set("certifications", flattenUserCertifications(currentUser.Certifications)) d.Set("employer_info", flattenUserEmployerInfo(currentUser.EmployerInfo)) - if diagErr := readUserRoutingUtilization(d, sdkConfig); diagErr != nil { + if diagErr := readUserRoutingUtilization(d, usersAPI); diagErr != nil { return retry.NonRetryableError(fmt.Errorf("%v", diagErr)) } @@ -677,7 +670,7 @@ func updateUser(ctx context.Context, d *schema.ResourceData, meta interface{}) d return diagErr } - diagErr = updateUserRoutingUtilization(d, usersAPI, sdkConfig) + diagErr = updateUserRoutingUtilization(d, usersAPI) if diagErr != nil { return diagErr } @@ -1044,30 +1037,21 @@ func flattenUserEmployerInfo(empInfo *platformclientv2.Employerinfo) []interface }} } -func readUserRoutingUtilization(d *schema.ResourceData, sdkConfig *platformclientv2.Configuration) diag.Diagnostics { +func readUserRoutingUtilization(d *schema.ResourceData, usersAPI *platformclientv2.UsersApi) diag.Diagnostics { log.Printf("Getting user utilization") - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - apiClient := &routingAPI.Configuration.APIClient - - path := fmt.Sprintf("%s/api/v2/routing/users/%s/utilization", routingAPI.Configuration.BasePath, d.Id()) - headerParams := BuildHeaderParams(routingAPI) - response, err := apiClient.CallAPI(path, "GET", nil, headerParams, nil, nil, "", nil) - - if err != nil { - if util.IsStatus404(response) { + agentUtilization, resp, getErr := usersAPI.GetRoutingUserUtilization(d.Id()) + if getErr != nil { + if util.IsStatus404(resp) { d.SetId("") // User doesn't exist return nil } - return util.BuildAPIDiagnosticError("genesyscloud_user", fmt.Sprintf("Failed to read routing utilization for user %s error: %s", d.Id(), err), response) + return diag.Errorf("Failed to read Routing Utilization for user %s: %s", d.Id(), getErr) } - agentUtilization := &AgentUtilizationWithLabels{} - json.Unmarshal(response.RawBody, &agentUtilization) - if agentUtilization == nil { d.Set("routing_utilization", nil) - } else if agentUtilization.Level == "Organization" { + } else if *agentUtilization.Level == "Organization" { // If the settings are org-wide, set to empty to indicate no settings on the user d.Set("routing_utilization", []interface{}{}) } else { @@ -1075,8 +1059,8 @@ func readUserRoutingUtilization(d *schema.ResourceData, sdkConfig *platformclien if agentUtilization.Utilization != nil { for sdkType, schemaType := range routingUtilization.UtilizationMediaTypes { - if mediaSettings, ok := agentUtilization.Utilization[sdkType]; ok { - allSettings[schemaType] = routingUtilization.FlattenUtilizationSetting(mediaSettings) + if mediaSettings, ok := (*agentUtilization.Utilization)[sdkType]; ok { + allSettings[schemaType] = routingUtilization.FlattenMediaUtilization(mediaSettings) } } } @@ -1088,7 +1072,7 @@ func readUserRoutingUtilization(d *schema.ResourceData, sdkConfig *platformclien originalLabelUtilizations := originalSettings["label_utilizations"].([]interface{}) // Only add to the state the configured labels, in the configured order, but not any extras, to help terraform with matching new and old state. - filteredLabelUtilizations := routingUtilization.FilterAndFlattenLabelUtilizationsInternal(agentUtilization.LabelUtilizations, originalLabelUtilizations) + filteredLabelUtilizations := routingUtilization.FilterAndFlattenLabelUtilizations(*agentUtilization.LabelUtilizations, originalLabelUtilizations) allSettings["label_utilizations"] = filteredLabelUtilizations } else { @@ -1277,10 +1261,9 @@ func updateUserProfileSkills(d *schema.ResourceData, usersAPI *platformclientv2. return nil } -func updateUserRoutingUtilization(d *schema.ResourceData, usersAPI *platformclientv2.UsersApi, sdkConfig *platformclientv2.Configuration) diag.Diagnostics { +func updateUserRoutingUtilization(d *schema.ResourceData, usersAPI *platformclientv2.UsersApi) diag.Diagnostics { if d.HasChange("routing_utilization") { if utilConfig := d.Get("routing_utilization").([]interface{}); utilConfig != nil { - var err error log.Printf("Updating user utilization for user %s", d.Id()) @@ -1289,30 +1272,18 @@ func updateUserRoutingUtilization(d *schema.ResourceData, usersAPI *platformclie allSettings := utilConfig[0].(map[string]interface{}) labelUtilizations := allSettings["label_utilizations"].([]interface{}) - if labelUtilizations != nil && len(labelUtilizations) > 0 { - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - apiClient := &routingAPI.Configuration.APIClient - - path := fmt.Sprintf("%s/api/v2/routing/users/%s/utilization", routingAPI.Configuration.BasePath, d.Id()) - headerParams := BuildHeaderParams(routingAPI) - requestPayload := make(map[string]interface{}) - requestPayload["utilization"] = buildMediaTypeUtilizations(allSettings) - - requestPayload["labelUtilizations"] = routingUtilization.BuildLabelUtilizationsRequest(labelUtilizations) - _, err = apiClient.CallAPI(path, "PUT", requestPayload, headerParams, nil, nil, "", nil) - } else { - sdkSettings := make(map[string]platformclientv2.Mediautilization) - for sdkType, schemaType := range routingUtilization.UtilizationMediaTypes { - if mediaSettings, ok := allSettings[schemaType]; ok && len(mediaSettings.([]interface{})) > 0 { - sdkSettings[sdkType] = routingUtilization.BuildSdkMediaUtilization(mediaSettings.([]interface{})) - } + sdkSettings := make(map[string]platformclientv2.Mediautilization) + for sdkType, schemaType := range routingUtilization.UtilizationMediaTypes { + if mediaSettings, ok := allSettings[schemaType]; ok && len(mediaSettings.([]interface{})) > 0 { + sdkSettings[sdkType] = routingUtilization.BuildSdkMediaUtilization(mediaSettings.([]interface{})) } - - _, _, err = usersAPI.PutRoutingUserUtilization(d.Id(), platformclientv2.Utilizationrequest{ - Utilization: &sdkSettings, - }) } + _, _, err := usersAPI.PutRoutingUserUtilization(d.Id(), platformclientv2.Utilizationrequest{ + Utilization: &sdkSettings, + LabelUtilizations: routingUtilization.BuildSdkLabelUtilizations(labelUtilizations), + }) + if err != nil { return util.BuildDiagnosticError("genesyscloud_user", fmt.Sprintf("Failed to update Routing Utilization for user %s", d.Id()), err) } diff --git a/genesyscloud/resource_genesyscloud_user_test.go b/genesyscloud/resource_genesyscloud_user_test.go index e3f37ddb9..4dd536e5f 100644 --- a/genesyscloud/resource_genesyscloud_user_test.go +++ b/genesyscloud/resource_genesyscloud_user_test.go @@ -709,7 +709,7 @@ func TestAccResourceUserEmployerInfo(t *testing.T) { }) } -func TestAccResourceUserroutingUtil(t *testing.T) { +func TestAccResourceUserroutingUtilBasic(t *testing.T) { t.Parallel() var ( userResource1 = "test-user-util" diff --git a/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization.go b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization.go index 5ead69955..5c3a56c49 100644 --- a/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization.go +++ b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization.go @@ -80,7 +80,7 @@ func updateRoutingUtilization(ctx context.Context, d *schema.ResourceData, meta diagErr := util.RetryWhen(util.IsStatus409, func() (*platformclientv2.APIResponse, diag.Diagnostics) { _, resp, err := proxy.updateRoutingUtilization(ctx, &platformclientv2.Utilizationrequest{ Utilization: BuildSdkMediaUtilizations(d), - LabelUtilizations: BuildSdkLabelUtilizations(d), + LabelUtilizations: BuildSdkLabelUtilizations(d.Get("label_utilizations").([]interface{})), }) if err != nil { diff --git a/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_schema.go b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_schema.go index 6c0a47f6e..f956e6216 100644 --- a/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_schema.go +++ b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_schema.go @@ -20,22 +20,6 @@ func SetRegistrar(regInstance registrar.Registrar) { regInstance.RegisterExporter(resourceName, RoutingUtilizationExporter()) } -type MediaUtilization struct { - MaximumCapacity int32 `json:"maximumCapacity"` - InterruptableMediaTypes []string `json:"interruptableMediaTypes"` - IncludeNonAcd bool `json:"includeNonAcd"` -} - -type LabelUtilization struct { - MaximumCapacity int32 `json:"maximumCapacity"` - InterruptingLabelIds []string `json:"interruptingLabelIds"` -} - -type OrgUtilizationWithLabels struct { - Utilization map[string]MediaUtilization `json:"utilization"` - LabelUtilizations map[string]LabelUtilization `json:"labelUtilizations"` -} - var ( // Map of SDK media type name to schema media type name UtilizationMediaTypes = map[string]string{ diff --git a/genesyscloud/routing_utilization/resource_routing_utilization_utils.go b/genesyscloud/routing_utilization/resource_routing_utilization_utils.go index 287bb85b1..4bd91ef27 100644 --- a/genesyscloud/routing_utilization/resource_routing_utilization_utils.go +++ b/genesyscloud/routing_utilization/resource_routing_utilization_utils.go @@ -42,8 +42,7 @@ func BuildSdkMediaUtilization(settings []interface{}) platformclientv2.Mediautil } } -func BuildSdkLabelUtilizations(d *schema.ResourceData) *map[string]platformclientv2.Labelutilizationrequest { - labelUtilizations := d.Get("label_utilizations").([]interface{}) +func BuildSdkLabelUtilizations(labelUtilizations []interface{}) *map[string]platformclientv2.Labelutilizationrequest { request := make(map[string]platformclientv2.Labelutilizationrequest) for _, labelUtilization := range labelUtilizations { @@ -60,20 +59,6 @@ func BuildSdkLabelUtilizations(d *schema.ResourceData) *map[string]platformclien return &request } -func BuildLabelUtilizationsRequest(labelUtilizations []interface{}) map[string]LabelUtilization { - request := make(map[string]LabelUtilization) - for _, labelUtilization := range labelUtilizations { - labelUtilizationMap := labelUtilization.(map[string]interface{}) - interruptingLabelIds := lists.SetToStringList(labelUtilizationMap["interrupting_label_ids"].(*schema.Set)) - - request[labelUtilizationMap["label_id"].(string)] = LabelUtilization{ - MaximumCapacity: int32(labelUtilizationMap["maximum_capacity"].(int)), - InterruptingLabelIds: *interruptingLabelIds, - } - } - return request -} - func FlattenMediaUtilization(mediaUtilization platformclientv2.Mediautilization) []interface{} { settingsMap := make(map[string]interface{}) @@ -116,51 +101,6 @@ func flattenLabelUtilization(labelId string, labelUtilization platformclientv2.L return utilizationMap } -// To be removed once resource_user is refactored to use FlattenMediaUtilization instead -func FlattenUtilizationSetting(settings MediaUtilization) []interface{} { - settingsMap := make(map[string]interface{}) - - settingsMap["maximum_capacity"] = settings.MaximumCapacity - settingsMap["include_non_acd"] = settings.IncludeNonAcd - if settings.InterruptableMediaTypes != nil { - settingsMap["interruptible_media_types"] = lists.StringListToSet(settings.InterruptableMediaTypes) - } - - return []interface{}{settingsMap} -} - -// To be removed once resource_user is refactored to use FilterAndFlattenLabelUtilizations instead -func FilterAndFlattenLabelUtilizationsInternal(labelUtilizations map[string]LabelUtilization, originalLabelUtilizations []interface{}) []interface{} { - flattenedLabelUtilizations := make([]interface{}, 0) - - for _, originalLabelUtilization := range originalLabelUtilizations { - originalLabelId := (originalLabelUtilization.(map[string]interface{}))["label_id"].(string) - - for currentLabelId, currentLabelUtilization := range labelUtilizations { - if currentLabelId == originalLabelId { - flattenedLabelUtilizations = append(flattenedLabelUtilizations, flattenLabelUtilizationInternal(currentLabelId, currentLabelUtilization)) - delete(labelUtilizations, currentLabelId) - break - } - } - } - - return flattenedLabelUtilizations -} - -// To be removed once resource_user is refactored to use flattenLabelUtilization instead -func flattenLabelUtilizationInternal(labelId string, labelUtilization LabelUtilization) map[string]interface{} { - utilizationMap := make(map[string]interface{}) - - utilizationMap["label_id"] = labelId - utilizationMap["maximum_capacity"] = labelUtilization.MaximumCapacity - if labelUtilization.InterruptingLabelIds != nil { - utilizationMap["interrupting_label_ids"] = lists.StringListToSet(labelUtilization.InterruptingLabelIds) - } - - return utilizationMap -} - func GenerateRoutingUtilMediaType( mediaType string, maxCapacity string, @@ -182,18 +122,3 @@ func getSdkUtilizationTypes() []string { sort.Strings(types) return types } - -// TODO: remove when routing skill group is refactored -func buildHeaderParams(routingAPI *platformclientv2.RoutingApi) map[string]string { - headerParams := make(map[string]string) - - for key := range routingAPI.Configuration.DefaultHeader { - headerParams[key] = routingAPI.Configuration.DefaultHeader[key] - } - - headerParams["Authorization"] = "Bearer " + routingAPI.Configuration.AccessToken - headerParams["Content-Type"] = "application/json" - headerParams["Accept"] = "application/json" - - return headerParams -} From a8e863aa26b5926cbb3f9d0b9547343158272af2 Mon Sep 17 00:00:00 2001 From: shrutisuryawanshigenesys Date: Tue, 2 Jul 2024 10:00:12 -0400 Subject: [PATCH 42/62] Refactor/devtooling 161 refactor idp_onelogin (#1125) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Merge Dev to Main for Release v1.41.0 (#1118) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 (#1008) * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.1 to 0.19.2. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.1...v0.19.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * ran go generate --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * DEVTOOLING-352 - provider oauth credential rate limit exceeded (#1004) * Testing something * Adding retry * Fixed retry * Moved functionality to retries package * Fixed inport cycle * Extending sleep * Added retry to AuthorizeSdk * Using with retries * Remving old function * Feat/devtooling 461 - WithRetries errors include improved logging (#1012) * calling diag func * Changed retryable functions to call Diagnostic function * Converted all withRetries errors to have improved wrapper * Made requested Changes * fixing unit test * Bump golang.org/x/net from 0.23.0 to 0.25.0 (#1017) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.25.0. - [Commits](https://github.com/golang/net/compare/v0.23.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix for issue 993 : Changed message_column to optional and add verification logic (#1013) * Changed message_column to optional and add verification logic * applied safer nil value handling * go generate (#1018) * bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1015) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Revert "bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1…" (#1019) This reverts commit 3ff66d472071905b18b4f66f6ee4b3d3725600e7. * bug/devtooling 560 - CX as Code crash when creating phones (#1020) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Made requested Change * feat/devtooling 579 - Improved Logging for Non-API errors (#1021) * Adding improved non-api diag errors * Pulling Merged PR * Added improved error * Added more logging * Ran go vet * Updated docs * Bump hashicorp/setup-terraform from 3.1.0 to 3.1.1 (#1024) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bug/devtooling 362 - Evaluation forms incorrectly assigning published attribute (#1022) * Correctly sets published feature * Added functionality to set published field correctly * Fixed docs * Bug/devtooling 444: Custom resolver function for outbound campaign script_id (#1014) * Resolving campaign script_id to default outbound script data source when appropriate * Created constants package * editing scripts proxy so that the datasource catches Default scripts * Finished writing tests for new campaign field custom resolver * Fixed linting errors in campaigns package * implemented caching for campaigns exporter * minor changes to a comment * Add deleteCacheItem func + some refactoring work * Refactoring call to resolveToDataSource function and added unit test * Fixing script data source test * Bump github.com/nyaruka/phonenumbers from 1.3.4 to 1.3.5 (#1026) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.4 to 1.3.5. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.4...v1.3.5) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Devtooling-162: Refactored idp salesforce (#999) * Refactored idp salesforce * Fixing docs * Changed function name * Removed original file * Changed Build Function Call to fix type difference (#1029) * fixing test for published attribute (#1030) * No jira: fixing up a few acceptance tests (#1031) * fixed journey segment update * Adding check to journey segment tests to validate is feature is supported * preventing panic in export helper function * Adding sleep to milestone data source test * Cleaning up fmt.Print statements appearing in export tests * undoing changes to segment resource file * Fix routing queue (#1028) * README update (#1025) * Pre-verify if the tfState is in sync with the exporter (#1027) * Add state comapartors * Upddate review comments * Devtooling-591: Consistency Checker Refactor (#1032) * Moved where consistency checker is created in resources * Cleaned up consitency checker file * Added resource name to message * Conditionally adding name * Made requested changes * Feature/devtooling 589 1 (#1035) * update doc * fix reviews * Fix acceptance tests - TCA and Prod (#1033) * Fix edge,export,script test,Jenkin to run tca&prod * Fix export & integration tests * Fix auth tests Fix auth tests * fix tests * resolve conflicts * move assignregion func, remove commented function modify to return empty string - assignregion func return default region --------- Co-authored-by: Monisha Padmavathi Ragavan * Bug/devtooling 597 - Routing email route test failing (#1039) * Added call to cleanup function * linter * adding hotfix to pr labeler config file (#1042) * bug/DEVTOOLING-436 - Added cleanup function for webdeployments resources (#1038) * Added cleanup function for webdeployments resources * fixing conflict * Made requested changes * Made requested changes * Bump github.com/hashicorp/terraform-plugin-sdk/v2 from 2.33.0 to 2.34.0 (#1047) Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.33.0 to 2.34.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.33.0...v2.34.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bug/devtooling 287 temp disable cchecker (#1037) * removed consistency checker * changed DID number * phoneUpdated * Merging dev to main for v1.38.0 (#1036) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routin… * refactoring of idp onelogin * updated docs * merge conflicts * changed return type for deleteFn --------- Signed-off-by: dependabot[bot] Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: Charlie Conneely Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> Co-authored-by: sureshperiyappan <61573777+sureshperiyappan@users.noreply.github.com> Co-authored-by: willjeuniaux-genesys <153622483+willjeuniaux-genesys@users.noreply.github.com> Co-authored-by: Will <37446330+williamjeuniaux@users.noreply.github.com> Co-authored-by: Ivan Mikhalchenko Co-authored-by: ivan Co-authored-by: HemanthDogiparthi12 Co-authored-by: Majharul Islam Rafat Co-authored-by: Mohammed Islam Co-authored-by: tsantos-genesys <154342374+tsantos-genesys@users.noreply.github.com> Co-authored-by: Brian Goad --- docs/resources/idp_onelogin.md | 6 +- .../genesyscloud_idp_onelogin_proxy.go | 88 ++++++++ .../resource_genesyscloud_idp_onelogin.go | 157 ++++++++++++++ ...rce_genesyscloud_idp_onelogin_init_test.go | 46 ++++ ...source_genesyscloud_idp_onelogin_schema.go | 103 +++++++++ ...resource_genesyscloud_idp_onelogin_test.go | 67 +++++- .../resource_genesyscloud_idp_onelogin.go | 199 ------------------ genesyscloud/resource_genesyscloud_init.go | 2 - .../resource_genesyscloud_init_test.go | 1 - .../tfexporter/tf_exporter_resource_test.go | 5 +- main.go | 2 + 11 files changed, 465 insertions(+), 211 deletions(-) create mode 100644 genesyscloud/idp_onelogin/genesyscloud_idp_onelogin_proxy.go create mode 100644 genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin.go create mode 100644 genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin_init_test.go create mode 100644 genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin_schema.go rename genesyscloud/{ => idp_onelogin}/resource_genesyscloud_idp_onelogin_test.go (63%) delete mode 100644 genesyscloud/resource_genesyscloud_idp_onelogin.go diff --git a/docs/resources/idp_onelogin.md b/docs/resources/idp_onelogin.md index 6f6c7beb4..21dd3de9f 100644 --- a/docs/resources/idp_onelogin.md +++ b/docs/resources/idp_onelogin.md @@ -30,12 +30,16 @@ resource "genesyscloud_idp_onelogin" "onelogin" { ### Required -- `certificates` (List of String) PEM or DER encoded public X.509 certificates for SAML signature validation. - `issuer_uri` (String) Issuer URI provided by OneLogin. ### Optional +- `certificates` (List of String) PEM or DER encoded public X.509 certificates for SAML signature validation. - `disabled` (Boolean) True if OneLogin is disabled. Defaults to `false`. +- `name` (String) IDP OneLogin resource name +- `relying_party_identifier` (String) String used to identify Genesys Cloud to OneLogin. +- `slo_binding` (String) Valid values: HTTP Redirect, HTTP Post +- `slo_uri` (String) Provided by OneLogin on app creation - `target_uri` (String) Target URI provided by OneLogin. - `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) diff --git a/genesyscloud/idp_onelogin/genesyscloud_idp_onelogin_proxy.go b/genesyscloud/idp_onelogin/genesyscloud_idp_onelogin_proxy.go new file mode 100644 index 000000000..25e1c8f96 --- /dev/null +++ b/genesyscloud/idp_onelogin/genesyscloud_idp_onelogin_proxy.go @@ -0,0 +1,88 @@ +package idp_onelogin + +import ( + "context" + "fmt" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" +) + +/* +The genesyscloud_idp_onelogin_proxy.go file contains the proxy structures and methods that interact +with the Genesys Cloud SDK. We use composition here for each function on the proxy so individual functions can be stubbed +out during testing. +*/ + +// internalProxy holds a proxy instance that can be used throughout the package +var internalProxy *idpOneloginProxy + +// Type definitions for each func on our proxy so we can easily mock them out later +type getIdpOneloginFunc func(ctx context.Context, p *idpOneloginProxy) (*platformclientv2.Onelogin, *platformclientv2.APIResponse, error) +type updateIdpOneloginFunc func(ctx context.Context, p *idpOneloginProxy, id string, oneLogin *platformclientv2.Onelogin) (*platformclientv2.Identityprovider, *platformclientv2.APIResponse, error) +type deleteIdpOneloginFunc func(ctx context.Context, p *idpOneloginProxy, id string) (response *platformclientv2.APIResponse, err error) + +// idpOneloginProxy contains all of the methods that call genesys cloud APIs. +type idpOneloginProxy struct { + clientConfig *platformclientv2.Configuration + identityProviderApi *platformclientv2.IdentityProviderApi + getIdpOneloginAttr getIdpOneloginFunc + updateIdpOneloginAttr updateIdpOneloginFunc + deleteIdpOneloginAttr deleteIdpOneloginFunc +} + +// newIdpOneloginProxy initializes the idp onelogin proxy with all of the data needed to communicate with Genesys Cloud +func newIdpOneloginProxy(clientConfig *platformclientv2.Configuration) *idpOneloginProxy { + api := platformclientv2.NewIdentityProviderApiWithConfig(clientConfig) + return &idpOneloginProxy{ + clientConfig: clientConfig, + identityProviderApi: api, + getIdpOneloginAttr: getIdpOneloginFn, + updateIdpOneloginAttr: updateIdpOneloginFn, + deleteIdpOneloginAttr: deleteIdpOneloginFn, + } +} + +// getIdpOneloginProxy acts as a singleton to for the internalProxy. It also ensures +// that we can still proxy our tests by directly setting internalProxy package variable +func getIdpOneloginProxy(clientConfig *platformclientv2.Configuration) *idpOneloginProxy { + if internalProxy == nil { + internalProxy = newIdpOneloginProxy(clientConfig) + } + + return internalProxy +} + +// getIdpOnelogin retrieves all Genesys Cloud idp onelogin +func (p *idpOneloginProxy) getIdpOnelogin(ctx context.Context) (*platformclientv2.Onelogin, *platformclientv2.APIResponse, error) { + return p.getIdpOneloginAttr(ctx, p) +} + +// updateIdpOnelogin updates a Genesys Cloud idp onelogin +func (p *idpOneloginProxy) updateIdpOnelogin(ctx context.Context, id string, idpOnelogin *platformclientv2.Onelogin) (*platformclientv2.Identityprovider, *platformclientv2.APIResponse, error) { + return p.updateIdpOneloginAttr(ctx, p, id, idpOnelogin) +} + +// deleteIdpOnelogin deletes a Genesys Cloud idp onelogin by Id +func (p *idpOneloginProxy) deleteIdpOnelogin(ctx context.Context, id string) (response *platformclientv2.APIResponse, err error) { + return p.deleteIdpOneloginAttr(ctx, p, id) +} + +// getAllIdpOneloginFn is the implementation for retrieving all idp onelogin in Genesys Cloud +func getIdpOneloginFn(ctx context.Context, p *idpOneloginProxy) (*platformclientv2.Onelogin, *platformclientv2.APIResponse, error) { + return p.identityProviderApi.GetIdentityprovidersOnelogin() +} + +// updateIdpOneloginFn is an implementation of the function to update a Genesys Cloud idp onelogin +func updateIdpOneloginFn(ctx context.Context, p *idpOneloginProxy, id string, idpOnelogin *platformclientv2.Onelogin) (*platformclientv2.Identityprovider, *platformclientv2.APIResponse, error) { + return p.identityProviderApi.PutIdentityprovidersOnelogin(*idpOnelogin) +} + +// deleteIdpOneloginFn is an implementation function for deleting a Genesys Cloud idp onelogin +func deleteIdpOneloginFn(ctx context.Context, p *idpOneloginProxy, id string) (response *platformclientv2.APIResponse, err error) { + _, resp, err := p.identityProviderApi.DeleteIdentityprovidersOnelogin() + if err != nil { + return resp, fmt.Errorf("Failed to delete idp onelogin: %s", err) + } + + return resp, err +} diff --git a/genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin.go b/genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin.go new file mode 100644 index 000000000..c7de09046 --- /dev/null +++ b/genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin.go @@ -0,0 +1,157 @@ +package idp_onelogin + +import ( + "context" + "fmt" + "log" + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + "terraform-provider-genesyscloud/genesyscloud/util" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" + + "terraform-provider-genesyscloud/genesyscloud/consistency_checker" + + "terraform-provider-genesyscloud/genesyscloud/util/constants" + "terraform-provider-genesyscloud/genesyscloud/util/lists" + "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" +) + +/* +The resource_genesyscloud_idp_onelogin.go contains all of the methods that perform the core logic for a resource. +*/ + +// getAllAuthIdpOnelogin retrieves all of the idp onelogin via Terraform in the Genesys Cloud and is used for the exporter +func getAllAuthIdpOnelogins(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { + proxy := getIdpOneloginProxy(clientConfig) + resources := make(resourceExporter.ResourceIDMetaMap) + + _, resp, err := proxy.getIdpOnelogin(ctx) + if err != nil { + if util.IsStatus404(resp) { + // Don't export if config doesn't exist + return resources, nil + } + return nil, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to get IDP Onelogin error: %s", err), resp) + } + + resources["0"] = &resourceExporter.ResourceMeta{Name: "onelogin"} + return resources, nil +} + +// createIdpOnelogin is used by the idp_onelogin resource to create Genesys cloud idp onelogin +func createIdpOnelogin(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + log.Printf("Creating IDP Onelogin") + d.SetId("onelogin") + return updateIdpOnelogin(ctx, d, meta) +} + +// readIdpOnelogin is used by the idp_onelogin resource to read an idp onelogin from genesys cloud +func readIdpOnelogin(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getIdpOneloginProxy(sdkConfig) + + log.Printf("Reading idp onelogin") + + return util.WithRetriesForReadCustomTimeout(ctx, d.Timeout(schema.TimeoutRead), d, func() *retry.RetryError { + oneLogin, resp, getErr := proxy.getIdpOnelogin(ctx) + if getErr != nil { + if util.IsStatus404(resp) { + createIdpOnelogin(ctx, d, meta) + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read IDP Onelogin: %s", getErr), resp)) + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read IDP Onelogin: %s", getErr), resp)) + } + + cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceIdpOnelogin(), constants.DefaultConsistencyChecks, resourceName) + + if oneLogin.Certificate != nil { + d.Set("certificates", lists.StringListToInterfaceList([]string{*oneLogin.Certificate})) + } else if oneLogin.Certificates != nil { + d.Set("certificates", lists.StringListToInterfaceList(*oneLogin.Certificates)) + } else { + d.Set("certificates", nil) + } + + resourcedata.SetNillableValue(d, "name", oneLogin.Name) + resourcedata.SetNillableValue(d, "disabled", oneLogin.Disabled) + resourcedata.SetNillableValue(d, "issuer_uri", oneLogin.IssuerURI) + resourcedata.SetNillableValue(d, "target_uri", oneLogin.SsoTargetURI) + resourcedata.SetNillableValue(d, "slo_uri", oneLogin.SloURI) + resourcedata.SetNillableValue(d, "slo_binding", oneLogin.SloBinding) + resourcedata.SetNillableValue(d, "relying_party_identifier", oneLogin.RelyingPartyIdentifier) + + log.Printf("Read idp onelogin") + return cc.CheckState(d) + }) +} + +// updateIdpOnelogin is used by the idp_onelogin resource to update an idp onelogin in Genesys Cloud +func updateIdpOnelogin(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getIdpOneloginProxy(sdkConfig) + + idpOnelogin := getIdpOneloginFromResourceData(d) + + certificates := lists.BuildSdkStringListFromInterfaceArray(d, "certificates") + if certificates != nil { + if len(*certificates) == 1 { + idpOnelogin.Certificate = &(*certificates)[0] + } + idpOnelogin.Certificates = certificates + } + + log.Printf("Updating idp onelogin") + _, resp, err := proxy.updateIdpOnelogin(ctx, d.Id(), &idpOnelogin) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to update IDP Onelogin %s error: %s", d.Id(), err), resp) + } + + log.Printf("Updated idp onelogin") + return readIdpOnelogin(ctx, d, meta) +} + +// deleteIdpOnelogin is used by the idp_onelogin resource to delete an idp onelogin from Genesys cloud +func deleteIdpOnelogin(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getIdpOneloginProxy(sdkConfig) + + log.Printf("Deleting IDP Onelogin") + + resp, err := proxy.deleteIdpOnelogin(ctx, d.Id()) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to updadeletete IDP Onelogin %s error: %s", d.Id(), err), resp) + } + + return util.WithRetries(ctx, 60*time.Second, func() *retry.RetryError { + _, resp, err := proxy.getIdpOnelogin(ctx) + + if err != nil { + if util.IsStatus404(resp) { + // IDP Onelogin deleted + log.Printf("Deleted IDP Onelogin") + return nil + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Error deleting IDP Onelogin: %s", err), resp)) + } + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("IDP Onelogin still exists"), resp)) + }) +} + +// getIdpOneloginFromResourceData maps data from schema ResourceData object to a platformclientv2.Onelogin +func getIdpOneloginFromResourceData(d *schema.ResourceData) platformclientv2.Onelogin { + return platformclientv2.Onelogin{ + Name: platformclientv2.String(d.Get("name").(string)), + Disabled: platformclientv2.Bool(d.Get("disabled").(bool)), + IssuerURI: platformclientv2.String(d.Get("issuer_uri").(string)), + SsoTargetURI: platformclientv2.String(d.Get("target_uri").(string)), + SloURI: platformclientv2.String(d.Get("slo_uri").(string)), + SloBinding: platformclientv2.String(d.Get("slo_binding").(string)), + RelyingPartyIdentifier: platformclientv2.String(d.Get("relying_party_identifier").(string)), + } +} diff --git a/genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin_init_test.go b/genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin_init_test.go new file mode 100644 index 000000000..266eebab0 --- /dev/null +++ b/genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin_init_test.go @@ -0,0 +1,46 @@ +package idp_onelogin + +import ( + "sync" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +/* + The genesyscloud_idp_onelogin_init_test.go file is used to initialize the data sources and resources + used in testing the idp_onelogin resource. +*/ + +// providerResources holds a map of all registered resources +var providerResources map[string]*schema.Resource + +type registerTestInstance struct { + resourceMapMutex sync.RWMutex +} + +// registerTestResources registers all resources used in the tests +func (r *registerTestInstance) registerTestResources() { + r.resourceMapMutex.Lock() + defer r.resourceMapMutex.Unlock() + + providerResources[resourceName] = ResourceIdpOnelogin() +} + +// initTestResources initializes all test_data resources and data sources. +func initTestResources() { + providerResources = make(map[string]*schema.Resource) + + regInstance := ®isterTestInstance{} + + regInstance.registerTestResources() +} + +// TestMain is a "setup" function called by the testing framework when run the test_data +func TestMain(m *testing.M) { + // Run setup function before starting the test_data suite for the idp_onelogin package + initTestResources() + + // Run the test_data suite for the idp_onelogin package + m.Run() +} diff --git a/genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin_schema.go b/genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin_schema.go new file mode 100644 index 000000000..4cd3b9cc8 --- /dev/null +++ b/genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin_schema.go @@ -0,0 +1,103 @@ +package idp_onelogin + +import ( + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" +) + +/* +resource_genesycloud_idp_onelogin_schema.go holds four functions within it: + +1. The registration code that registers the Datasource, Resource and Exporter for the package. +2. The resource schema definitions for the idp_onelogin resource. +3. The datasource schema definitions for the idp_onelogin datasource. +4. The resource exporter configuration for the idp_onelogin exporter. +*/ +const resourceName = "genesyscloud_idp_onelogin" + +// SetRegistrar registers all of the resources, datasources and exporters in the package +func SetRegistrar(regInstance registrar.Registrar) { + regInstance.RegisterResource(resourceName, ResourceIdpOnelogin()) + regInstance.RegisterExporter(resourceName, IdpOneloginExporter()) +} + +// ResourceIdpOnelogin registers the genesyscloud_idp_onelogin resource with Terraform +func ResourceIdpOnelogin() *schema.Resource { + return &schema.Resource{ + Description: `Genesys Cloud Single Sign-on OneLogin Identity Provider. See this page for detailed configuration instructions: https://help.mypurecloud.com/articles/add-onelogin-as-single-sign-on-provider/`, + + CreateContext: provider.CreateWithPooledClient(createIdpOnelogin), + ReadContext: provider.ReadWithPooledClient(readIdpOnelogin), + UpdateContext: provider.UpdateWithPooledClient(updateIdpOnelogin), + DeleteContext: provider.DeleteWithPooledClient(deleteIdpOnelogin), + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + SchemaVersion: 1, + Timeouts: &schema.ResourceTimeout{ + Update: schema.DefaultTimeout(8 * time.Minute), + Read: schema.DefaultTimeout(8 * time.Minute), + }, + Schema: map[string]*schema.Schema{ + `name`: { + Description: `IDP OneLogin resource name`, + Optional: true, + Type: schema.TypeString, + }, + `disabled`: { + Description: `True if OneLogin is disabled.`, + Optional: true, + Type: schema.TypeBool, + Default: false, + }, + `issuer_uri`: { + Description: `Issuer URI provided by OneLogin.`, + Required: true, + Type: schema.TypeString, + }, + `target_uri`: { + Description: `Target URI provided by OneLogin.`, + Optional: true, + Type: schema.TypeString, + }, + `slo_uri`: { + Description: `Provided by OneLogin on app creation`, + Optional: true, + Type: schema.TypeString, + }, + `slo_binding`: { + Description: `Valid values: HTTP Redirect, HTTP Post`, + Optional: true, + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice([]string{`HTTP Redirect`, `HTTP Post`}, false), + }, + `relying_party_identifier`: { + Description: `String used to identify Genesys Cloud to OneLogin.`, + Optional: true, + Type: schema.TypeString, + }, + `certificates`: { + Description: `PEM or DER encoded public X.509 certificates for SAML signature validation.`, + Optional: true, + Type: schema.TypeList, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + }, + } +} + +// IdpOneloginExporter returns the resourceExporter object used to hold the genesyscloud_idp_onelogin exporter's config +func IdpOneloginExporter() *resourceExporter.ResourceExporter { + return &resourceExporter.ResourceExporter{ + GetResourcesFunc: provider.GetAllWithPooledClient(getAllAuthIdpOnelogins), + RefAttrs: map[string]*resourceExporter.RefAttrSettings{ + // TODO: Add any reference attributes here + }, + } +} diff --git a/genesyscloud/resource_genesyscloud_idp_onelogin_test.go b/genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin_test.go similarity index 63% rename from genesyscloud/resource_genesyscloud_idp_onelogin_test.go rename to genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin_test.go index 62d340cc2..f3e0d5c90 100644 --- a/genesyscloud/resource_genesyscloud_idp_onelogin_test.go +++ b/genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin_test.go @@ -1,4 +1,4 @@ -package genesyscloud +package idp_onelogin import ( "fmt" @@ -7,6 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "testing" + "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" @@ -14,91 +15,137 @@ import ( func TestAccResourceIdpOnelogin(t *testing.T) { var ( - uri1 = "https://test.com/1" - uri2 = "https://test.com/2" + name1 = "Test onelogin " + uuid.NewString() + uri1 = "https://test.com/1" + uri2 = "https://test.com/2" + relyingPartyID1 = "test-id1" + relyingPartyID2 = "test-id2" + uri3 = "https://example.com" + slo_binding1 = "HTTP Redirect" + slo_binding2 = "HTTP Post" ) resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) }, - ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + ProviderFactories: provider.GetProviderFactories(providerResources, nil), Steps: []resource.TestStep{ { // Create Config: generateIdpOneloginResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1)), uri1, uri2, util.NullValue, // Not disabled + util.NullValue, // No relying party ID + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "name", name1), util.ValidateStringInArray("genesyscloud_idp_onelogin.onelogin", "certificates", util.TestCert1), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "issuer_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "target_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "relying_party_identifier", ""), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "slo_binding", slo_binding1), ), }, { // Update with new values Config: generateIdpOneloginResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert2)), uri2, uri1, util.TrueValue, // disabled + strconv.Quote(relyingPartyID1), + uri3, + slo_binding2, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "name", name1), util.ValidateStringInArray("genesyscloud_idp_onelogin.onelogin", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "disabled", util.TrueValue), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "relying_party_identifier", relyingPartyID1), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "slo_binding", slo_binding2), ), }, { // Update with multiple certs Config: generateIdpOneloginResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1), strconv.Quote(util.TestCert2)), uri2, uri1, util.FalseValue, // disabled + strconv.Quote(relyingPartyID2), + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "name", name1), util.ValidateStringInArray("genesyscloud_idp_onelogin.onelogin", "certificates", util.TestCert1), util.ValidateStringInArray("genesyscloud_idp_onelogin.onelogin", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "relying_party_identifier", relyingPartyID2), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "slo_binding", slo_binding1), ), }, { // Update to one cert in array Config: generateIdpOneloginResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1)), uri2, uri1, util.FalseValue, // disabled + strconv.Quote(relyingPartyID2), + uri3, + slo_binding2, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "name", name1), util.ValidateStringInArray("genesyscloud_idp_onelogin.onelogin", "certificates", util.TestCert1), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "certificates.#", "1"), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "relying_party_identifier", relyingPartyID2), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "slo_binding", slo_binding2), ), }, { // Update back to two certs in array Config: generateIdpOneloginResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1), strconv.Quote(util.TestCert2)), uri2, uri1, util.FalseValue, // disabled + strconv.Quote(relyingPartyID2), + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "name", name1), util.ValidateStringInArray("genesyscloud_idp_onelogin.onelogin", "certificates", util.TestCert1), util.ValidateStringInArray("genesyscloud_idp_onelogin.onelogin", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "certificates.#", "2"), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "relying_party_identifier", relyingPartyID2), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "slo_binding", slo_binding1), ), }, { @@ -113,17 +160,25 @@ func TestAccResourceIdpOnelogin(t *testing.T) { } func generateIdpOneloginResource( + name string, certs string, issuerURI string, targetURI string, - disabled string) string { + disabled string, + partyID string, + sloURI string, + sloBinding string) string { return fmt.Sprintf(`resource "genesyscloud_idp_onelogin" "onelogin" { + name = "%s" certificates = %s issuer_uri = "%s" target_uri = "%s" disabled = %s + relying_party_identifier = %s + slo_uri = "%s" + slo_binding = "%s" } - `, certs, issuerURI, targetURI, disabled) + `, name, certs, issuerURI, targetURI, disabled, partyID, sloURI, sloBinding) } func testVerifyIdpOneloginDestroyed(state *terraform.State) error { diff --git a/genesyscloud/resource_genesyscloud_idp_onelogin.go b/genesyscloud/resource_genesyscloud_idp_onelogin.go deleted file mode 100644 index 1b6f2abf8..000000000 --- a/genesyscloud/resource_genesyscloud_idp_onelogin.go +++ /dev/null @@ -1,199 +0,0 @@ -package genesyscloud - -import ( - "context" - "fmt" - "log" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" - "terraform-provider-genesyscloud/genesyscloud/util/constants" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - - "terraform-provider-genesyscloud/genesyscloud/consistency_checker" - - resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" - lists "terraform-provider-genesyscloud/genesyscloud/util/lists" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" -) - -func getAllIdpOnelogin(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(clientConfig) - resources := make(resourceExporter.ResourceIDMetaMap) - - _, resp, getErr := idpAPI.GetIdentityprovidersOnelogin() - if getErr != nil { - if util.IsStatus404(resp) { - // Don't export if config doesn't exist - return resources, nil - } - return nil, util.BuildAPIDiagnosticError("genesyscloud_idp_onelogin", fmt.Sprintf("Failed to get IDP Onelogin error: %s", getErr), resp) - } - - resources["0"] = &resourceExporter.ResourceMeta{Name: "onelogin"} - return resources, nil -} - -func IdpOneloginExporter() *resourceExporter.ResourceExporter { - return &resourceExporter.ResourceExporter{ - GetResourcesFunc: provider.GetAllWithPooledClient(getAllIdpOnelogin), - RefAttrs: map[string]*resourceExporter.RefAttrSettings{}, // No references - } -} - -func ResourceIdpOnelogin() *schema.Resource { - return &schema.Resource{ - Description: "Genesys Cloud Single Sign-on OneLogin Identity Provider. See this page for detailed configuration instructions: https://help.mypurecloud.com/articles/add-onelogin-as-single-sign-on-provider/", - - CreateContext: provider.CreateWithPooledClient(createIdpOnelogin), - ReadContext: provider.ReadWithPooledClient(readIdpOnelogin), - UpdateContext: provider.UpdateWithPooledClient(updateIdpOnelogin), - DeleteContext: provider.DeleteWithPooledClient(deleteIdpOnelogin), - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - SchemaVersion: 1, - Timeouts: &schema.ResourceTimeout{ - Update: schema.DefaultTimeout(8 * time.Minute), - Read: schema.DefaultTimeout(8 * time.Minute), - }, - Schema: map[string]*schema.Schema{ - "certificates": { - Description: "PEM or DER encoded public X.509 certificates for SAML signature validation.", - Type: schema.TypeList, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "issuer_uri": { - Description: "Issuer URI provided by OneLogin.", - Type: schema.TypeString, - Required: true, - }, - "target_uri": { - Description: "Target URI provided by OneLogin.", - Type: schema.TypeString, - Optional: true, - }, - "disabled": { - Description: "True if OneLogin is disabled.", - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - }, - } -} - -func createIdpOnelogin(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - log.Printf("Creating IDP Onelogin") - d.SetId("onelogin") - return updateIdpOnelogin(ctx, d, meta) -} - -func readIdpOnelogin(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(sdkConfig) - cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceIdpOnelogin(), constants.DefaultConsistencyChecks, "genesyscloud_idp_onelogin") - - log.Printf("Reading IDP Onelogin") - - return util.WithRetriesForReadCustomTimeout(ctx, d.Timeout(schema.TimeoutRead), d, func() *retry.RetryError { - onelogin, resp, getErr := idpAPI.GetIdentityprovidersOnelogin() - if getErr != nil { - if util.IsStatus404(resp) { - createIdpOnelogin(ctx, d, meta) - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_onelogin", fmt.Sprintf("Failed to read IDP Onelogin: %s", getErr), resp)) - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_onelogin", fmt.Sprintf("Failed to read IDP Onelogin: %s", getErr), resp)) - } - - if onelogin.Certificate != nil { - d.Set("certificates", lists.StringListToInterfaceList([]string{*onelogin.Certificate})) - } else if onelogin.Certificates != nil { - d.Set("certificates", lists.StringListToInterfaceList(*onelogin.Certificates)) - } else { - d.Set("certificates", nil) - } - - if onelogin.IssuerURI != nil { - d.Set("issuer_uri", *onelogin.IssuerURI) - } else { - d.Set("issuer_uri", nil) - } - - if onelogin.SsoTargetURI != nil { - d.Set("target_uri", *onelogin.SsoTargetURI) - } else { - d.Set("target_uri", nil) - } - - if onelogin.Disabled != nil { - d.Set("disabled", *onelogin.Disabled) - } else { - d.Set("disabled", nil) - } - - log.Printf("Read IDP Onelogin") - return cc.CheckState(d) - }) -} - -func updateIdpOnelogin(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - issuerUri := d.Get("issuer_uri").(string) - targetUri := d.Get("target_uri").(string) - disabled := d.Get("disabled").(bool) - - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(sdkConfig) - - log.Printf("Updating IDP Onelogin") - update := platformclientv2.Onelogin{ - IssuerURI: &issuerUri, - SsoTargetURI: &targetUri, - Disabled: &disabled, - } - - certificates := lists.BuildSdkStringListFromInterfaceArray(d, "certificates") - if certificates != nil { - if len(*certificates) == 1 { - update.Certificate = &(*certificates)[0] - } - update.Certificates = certificates - } - - _, resp, err := idpAPI.PutIdentityprovidersOnelogin(update) - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_idp_onelogin", fmt.Sprintf("Failed to update IDP Onelogin %s error: %s", d.Id(), err), resp) - } - - log.Printf("Updated IDP Onelogin") - return readIdpOnelogin(ctx, d, meta) -} - -func deleteIdpOnelogin(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(sdkConfig) - - log.Printf("Deleting IDP Onelogin") - _, resp, err := idpAPI.DeleteIdentityprovidersOnelogin() - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_idp_onelogin", fmt.Sprintf("Failed to updadeletete IDP Onelogin %s error: %s", d.Id(), err), resp) - } - - return util.WithRetries(ctx, 60*time.Second, func() *retry.RetryError { - _, resp, err := idpAPI.GetIdentityprovidersOnelogin() - if err != nil { - if util.IsStatus404(resp) { - // IDP Onelogin deleted - log.Printf("Deleted IDP Onelogin") - return nil - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_onelogin", fmt.Sprintf("Error deleting IDP Onelogin: %s", err), resp)) - } - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_onelogin", fmt.Sprintf("IDP Onelogin still exists"), resp)) - }) -} diff --git a/genesyscloud/resource_genesyscloud_init.go b/genesyscloud/resource_genesyscloud_init.go index 747e3a5a2..d2a1a248f 100644 --- a/genesyscloud/resource_genesyscloud_init.go +++ b/genesyscloud/resource_genesyscloud_init.go @@ -42,7 +42,6 @@ func registerResources(l registrar.Registrar) { l.RegisterResource("genesyscloud_location", ResourceLocation()) l.RegisterResource("genesyscloud_auth_division", ResourceAuthDivision()) - l.RegisterResource("genesyscloud_idp_onelogin", ResourceIdpOnelogin()) l.RegisterResource("genesyscloud_journey_action_map", ResourceJourneyActionMap()) l.RegisterResource("genesyscloud_journey_action_template", ResourceJourneyActionTemplate()) l.RegisterResource("genesyscloud_journey_outcome", ResourceJourneyOutcome()) @@ -69,7 +68,6 @@ func registerResources(l registrar.Registrar) { func registerExporters(l registrar.Registrar) { l.RegisterExporter("genesyscloud_auth_division", AuthDivisionExporter()) - l.RegisterExporter("genesyscloud_idp_onelogin", IdpOneloginExporter()) l.RegisterExporter("genesyscloud_journey_action_map", JourneyActionMapExporter()) l.RegisterExporter("genesyscloud_journey_action_template", JourneyActionTemplateExporter()) l.RegisterExporter("genesyscloud_journey_outcome", JourneyOutcomeExporter()) diff --git a/genesyscloud/resource_genesyscloud_init_test.go b/genesyscloud/resource_genesyscloud_init_test.go index ae2ed4dae..c1d69a24d 100644 --- a/genesyscloud/resource_genesyscloud_init_test.go +++ b/genesyscloud/resource_genesyscloud_init_test.go @@ -41,7 +41,6 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_routing_queue"] = routingQueue.ResourceRoutingQueue() providerResources["genesyscloud_location"] = ResourceLocation() providerResources["genesyscloud_auth_division"] = ResourceAuthDivision() - providerResources["genesyscloud_idp_onelogin"] = ResourceIdpOnelogin() providerResources["genesyscloud_journey_action_map"] = ResourceJourneyActionMap() providerResources["genesyscloud_journey_action_template"] = ResourceJourneyActionTemplate() providerResources["genesyscloud_journey_outcome"] = ResourceJourneyOutcome() diff --git a/genesyscloud/tfexporter/tf_exporter_resource_test.go b/genesyscloud/tfexporter/tf_exporter_resource_test.go index 5f3873c2e..a0e4d44aa 100644 --- a/genesyscloud/tfexporter/tf_exporter_resource_test.go +++ b/genesyscloud/tfexporter/tf_exporter_resource_test.go @@ -22,6 +22,7 @@ import ( idpGeneric "terraform-provider-genesyscloud/genesyscloud/idp_generic" idpGsuite "terraform-provider-genesyscloud/genesyscloud/idp_gsuite" idpOkta "terraform-provider-genesyscloud/genesyscloud/idp_okta" + idpOneLogin "terraform-provider-genesyscloud/genesyscloud/idp_onelogin" idpPing "terraform-provider-genesyscloud/genesyscloud/idp_ping" idpSalesforce "terraform-provider-genesyscloud/genesyscloud/idp_salesforce" integration "terraform-provider-genesyscloud/genesyscloud/integration" @@ -127,7 +128,7 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_idp_generic"] = idpGeneric.ResourceIdpGeneric() providerResources["genesyscloud_idp_gsuite"] = idpGsuite.ResourceIdpGsuite() providerResources["genesyscloud_idp_okta"] = idpOkta.ResourceIdpOkta() - providerResources["genesyscloud_idp_onelogin"] = gcloud.ResourceIdpOnelogin() + providerResources["genesyscloud_idp_onelogin"] = idpOneLogin.ResourceIdpOnelogin() providerResources["genesyscloud_idp_ping"] = idpPing.ResourceIdpPing() providerResources["genesyscloud_idp_salesforce"] = idpSalesforce.ResourceIdpSalesforce() providerResources["genesyscloud_integration"] = integration.ResourceIntegration() @@ -227,7 +228,7 @@ func (r *registerTestInstance) registerTestExporters() { RegisterExporter("genesyscloud_idp_generic", idpGeneric.IdpGenericExporter()) RegisterExporter("genesyscloud_idp_gsuite", idpGsuite.IdpGsuiteExporter()) RegisterExporter("genesyscloud_idp_okta", idpOkta.IdpOktaExporter()) - RegisterExporter("genesyscloud_idp_onelogin", gcloud.IdpOneloginExporter()) + RegisterExporter("genesyscloud_idp_onelogin", idpOneLogin.IdpOneloginExporter()) RegisterExporter("genesyscloud_idp_ping", idpPing.IdpPingExporter()) RegisterExporter("genesyscloud_idp_salesforce", idpSalesforce.IdpSalesforceExporter()) RegisterExporter("genesyscloud_integration", integration.IntegrationExporter()) diff --git a/main.go b/main.go index 9c07f19fc..ad44a2841 100644 --- a/main.go +++ b/main.go @@ -27,6 +27,7 @@ import ( idpGeneric "terraform-provider-genesyscloud/genesyscloud/idp_generic" idpGsuite "terraform-provider-genesyscloud/genesyscloud/idp_gsuite" idpOkta "terraform-provider-genesyscloud/genesyscloud/idp_okta" + idpOneLogin "terraform-provider-genesyscloud/genesyscloud/idp_onelogin" idpPing "terraform-provider-genesyscloud/genesyscloud/idp_ping" idpSalesforce "terraform-provider-genesyscloud/genesyscloud/idp_salesforce" "terraform-provider-genesyscloud/genesyscloud/integration" @@ -194,6 +195,7 @@ func registerResources() { idpAdfs.SetRegistrar(regInstance) //Registering idp adfs idpSalesforce.SetRegistrar(regInstance) //Registering idp salesforce idpOkta.SetRegistrar(regInstance) //Registering idp okta + idpOneLogin.SetRegistrar(regInstance) //Registering idp onelogin idpGeneric.SetRegistrar(regInstance) //Registering idp generic idpPing.SetRegistrar(regInstance) //Registering idp ping idpGsuite.SetRegistrar(regInstance) //Registering idp gsuite From 35c11f701817d92653fa036597d76fe987656276 Mon Sep 17 00:00:00 2001 From: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Date: Tue, 2 Jul 2024 11:13:25 -0400 Subject: [PATCH 43/62] feature/devtooling 608 (#1124) * added schema * added line properties * updated and flatten function * changed to station remote address * pushing changes * regenerated docs * added remote if statement for remote address * line and remote address are mutually exclusive * fixed nil pointer deref on error * synced documents * added continue statement to prevent deref of nil pointer --- .../telephony_providers_edges_phone.md | 11 +- .../data_source_genesyscloud_station_test.go | 1 - ...ud_telephony_providers_edges_phone_test.go | 1 - ...yscloud_telephony_providers_edges_phone.go | 2 +- ..._telephony_providers_edges_phone_schema.go | 32 ++- ...ud_telephony_providers_edges_phone_test.go | 129 +++++++++- ...d_telephony_providers_edges_phone_utils.go | 237 ++++++++++++------ 7 files changed, 308 insertions(+), 105 deletions(-) diff --git a/docs/resources/telephony_providers_edges_phone.md b/docs/resources/telephony_providers_edges_phone.md index 5bcbb1b76..5d7c15349 100644 --- a/docs/resources/telephony_providers_edges_phone.md +++ b/docs/resources/telephony_providers_edges_phone.md @@ -56,8 +56,8 @@ resource "genesyscloud_telephony_providers_edges_phone" "example_phone" { ### Optional - `capabilities` (Block List, Max: 1) Phone Capabilities. (see [below for nested schema](#nestedblock--capabilities)) -- `line_addresses` (List of String) Ordered list of Line DIDs for standalone phones. Each phone number must be in an E.164 phone number format. - `line_base_settings_id` (String) Line Base Settings ID. +- `line_properties` (Block List, Max: 1) line properties (see [below for nested schema](#nestedblock--line_properties)) - `phone_meta_base_id` (String) Phone Meta Base ID. - `properties` (String) phone properties - `state` (String) Indicates if the resource is active, inactive, or deleted. Valid values: active, inactive, deleted. Defaults to `active`. @@ -82,3 +82,12 @@ Optional: - `provisions` (Boolean) Provisions - `registers` (Boolean) Registers + + +### Nested Schema for `line_properties` + +Optional: + +- `line_address` (List of String) DID for standalone phones. Each phone number must be in an E.164 phone number format. +- `remote_address` (List of String) Station remote property for phones. No validation is provided + diff --git a/genesyscloud/station/data_source_genesyscloud_station_test.go b/genesyscloud/station/data_source_genesyscloud_station_test.go index 7ec255d4c..981c82bf6 100644 --- a/genesyscloud/station/data_source_genesyscloud_station_test.go +++ b/genesyscloud/station/data_source_genesyscloud_station_test.go @@ -62,7 +62,6 @@ func TestAccDataSourceStation(t *testing.T) { State: stateActive, SiteId: fmt.Sprintf("\"%s\"", defaultSiteId), PhoneBaseSettingsId: "genesyscloud_telephony_providers_edges_phonebasesettings." + phoneBaseSettingsRes + ".id", - LineAddresses: nil, // no line addresses WebRtcUserId: "genesyscloud_user." + userRes1 + ".id", DependsOn: "", // no depends on }, diff --git a/genesyscloud/telephony_providers_edges_phone/data_source_genesyscloud_telephony_providers_edges_phone_test.go b/genesyscloud/telephony_providers_edges_phone/data_source_genesyscloud_telephony_providers_edges_phone_test.go index 1d3ed67b6..9d3bb4dc6 100644 --- a/genesyscloud/telephony_providers_edges_phone/data_source_genesyscloud_telephony_providers_edges_phone_test.go +++ b/genesyscloud/telephony_providers_edges_phone/data_source_genesyscloud_telephony_providers_edges_phone_test.go @@ -66,7 +66,6 @@ func TestAccDataSourcePhone(t *testing.T) { stateActive, fmt.Sprintf("\"%s\"", defaultSiteId), "genesyscloud_telephony_providers_edges_phonebasesettings." + phoneBaseSettingsRes + ".id", - nil, // no line addresses "genesyscloud_user." + userRes1 + ".id", "", // no depends on }, diff --git a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go index 505309b7d..e989f2b5d 100644 --- a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go +++ b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go @@ -110,7 +110,7 @@ func readPhone(ctx context.Context, d *schema.ResourceData, meta interface{}) di } if currentPhone.Lines != nil { - _ = d.Set("line_addresses", flattenPhoneLines(currentPhone.Lines)) + resourcedata.SetNillableValueWithInterfaceArrayWithFunc(d, "line_properties", currentPhone.Lines, flattenLines) } _ = d.Set("properties", nil) diff --git a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_schema.go b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_schema.go index 489a269b7..7caff939d 100644 --- a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_schema.go +++ b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_schema.go @@ -30,6 +30,24 @@ func SetRegistrar(l registrar.Registrar) { // ResourcePhone registers the genesyscloud_telephony_providers_edges_phone resource with Terraform func ResourcePhone() *schema.Resource { + lineProperties := &schema.Resource{ + Schema: map[string]*schema.Schema{ + `line_address`: { + Description: `DID for standalone phones. Each phone number must be in an E.164 phone number format.`, + Optional: true, + Computed: true, + Type: schema.TypeList, + Elem: &schema.Schema{Type: schema.TypeString, ValidateDiagFunc: validators.ValidatePhoneNumber}, + }, + `remote_address`: { + Description: `Station remote property for phones. No validation is provided`, + Optional: true, + Type: schema.TypeList, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validation.StringIsNotEmpty}, + }, + }, + } + phoneCapabilities := &schema.Resource{ Schema: map[string]*schema.Schema{ "provisions": { @@ -135,13 +153,6 @@ func ResourcePhone() *schema.Resource { Type: schema.TypeString, Optional: true, }, - "line_addresses": { - Description: "Ordered list of Line DIDs for standalone phones. Each phone number must be in an E.164 phone number format.", - Type: schema.TypeList, - Optional: true, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateDiagFunc: validators.ValidatePhoneNumber}, - }, "properties": { Description: "phone properties", Type: schema.TypeString, @@ -149,6 +160,13 @@ func ResourcePhone() *schema.Resource { Computed: true, DiffSuppressFunc: util.SuppressEquivalentJsonDiffs, }, + "line_properties": { + Description: "line properties", + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: lineProperties, + }, "capabilities": { Description: "Phone Capabilities.", Type: schema.TypeList, diff --git a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go index 2508a0424..f9955feea 100644 --- a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go +++ b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go @@ -89,7 +89,6 @@ func TestAccResourcePhoneBasic(t *testing.T) { stateActive, fmt.Sprintf("\"%s\"", siteId), "genesyscloud_telephony_providers_edges_phonebasesettings." + phoneBaseSettingsRes + ".id", - nil, // no line addresses "genesyscloud_user." + userRes1 + ".id", "", // no depends on }, @@ -120,7 +119,6 @@ func TestAccResourcePhoneBasic(t *testing.T) { stateActive, fmt.Sprintf("\"%s\"", siteId), "genesyscloud_telephony_providers_edges_phonebasesettings." + phoneBaseSettingsRes2 + ".id", - nil, // no line addresses "genesyscloud_user." + userRes2 + ".id", "", // no depends_on }, @@ -187,10 +185,9 @@ func TestAccResourcePhoneBasic(t *testing.T) { } func TestAccResourcePhoneStandalone(t *testing.T) { - number := "+12005538112" - deleteDidPoolWithNumber(number) + lineAddresses := "+12005538112" + deleteDidPoolWithNumber(lineAddresses) didPoolResource1 := "test-didpool1" - lineAddresses := []string{number} phoneRes := "phone_standalone1234" name1 := "test-phone-standalone_" + uuid.NewString() stateActive := "active" @@ -257,8 +254,8 @@ func TestAccResourcePhoneStandalone(t *testing.T) { }, Config: didPool.GenerateDidPoolResource(&didPool.DidPoolStruct{ ResourceID: didPoolResource1, - StartPhoneNumber: lineAddresses[0], - EndPhoneNumber: lineAddresses[0], + StartPhoneNumber: lineAddresses, + EndPhoneNumber: lineAddresses, Description: util.NullValue, // No description Comments: util.NullValue, // No comments PoolProvider: util.NullValue, // No provider @@ -273,17 +270,16 @@ func TestAccResourcePhoneStandalone(t *testing.T) { stateActive, "genesyscloud_telephony_providers_edges_site." + siteRes + ".id", "genesyscloud_telephony_providers_edges_phonebasesettings." + phoneBaseSettingsRes + ".id", - lineAddresses, "", // no web rtc user "genesyscloud_telephony_providers_edges_did_pool." + didPoolResource1, - }, capabilities, generatePhoneProperties(uuid.NewString())), + }, capabilities, generateLineProperties(strconv.Quote(lineAddresses), ""), generatePhoneProperties(uuid.NewString())), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "name", name1), resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "state", stateActive), resource.TestCheckResourceAttrPair("genesyscloud_telephony_providers_edges_phone."+phoneRes, "site_id", "genesyscloud_telephony_providers_edges_site."+siteRes, "id"), resource.TestCheckResourceAttrPair("genesyscloud_telephony_providers_edges_phone."+phoneRes, "line_base_settings_id", "genesyscloud_telephony_providers_edges_phonebasesettings."+phoneBaseSettingsRes, "line_base_settings_id"), resource.TestCheckResourceAttrPair("genesyscloud_telephony_providers_edges_phone."+phoneRes, "phone_base_settings_id", "genesyscloud_telephony_providers_edges_phonebasesettings."+phoneBaseSettingsRes, "id"), - resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "line_addresses.0", lineAddresses[0]), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "line_properties.0.line_address.0", lineAddresses), resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.provisions", util.FalseValue), resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.registers", util.TrueValue), resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.dual_registers", util.TrueValue), @@ -388,7 +384,6 @@ func TestAccResourceHardPhoneStandalone(t *testing.T) { stateActive, "genesyscloud_telephony_providers_edges_site." + siteRes + ".id", "genesyscloud_telephony_providers_edges_phonebasesettings." + phoneBaseSettingsRes + ".id", - []string{}, "", // no web rtc user "", // no Depends On }, capabilities, generatePhoneProperties(phoneMac)) @@ -400,7 +395,6 @@ func TestAccResourceHardPhoneStandalone(t *testing.T) { stateActive, "genesyscloud_telephony_providers_edges_site." + siteRes + ".id", "genesyscloud_telephony_providers_edges_phonebasesettings." + phoneBaseSettingsRes + ".id", - []string{}, "", // no web rtc user "", // no Depends On }, capabilities, generatePhoneProperties(phoneMacUpdated)) @@ -444,6 +438,117 @@ func TestAccResourceHardPhoneStandalone(t *testing.T) { CheckDestroy: TestVerifyWebRtcPhoneDestroyed, }) } + +func TestAccResourcePhoneStandaloneRemoteStation(t *testing.T) { + remoteStationAddress := "+11005538454" + phoneRes := "phone_standalone1234" + name1 := "test-phone-Kstandalone_" + uuid.NewString() + stateActive := "active" + phoneBaseSettingsRes := "phoneBaseSettings1234" + phoneBaseSettingsName := "phoneBaseSettings " + uuid.NewString() + + locationRes := "test-location" + + emergencyNumber := "+13173114164" + if err := edgeSite.DeleteLocationWithNumber(emergencyNumber, sdkConfig); err != nil { + t.Skipf("failed to delete location with number %s: %v", emergencyNumber, err) + } + + locationConfig := gcloud.GenerateLocationResource( + locationRes, + "TerraformLocationRemote"+uuid.NewString(), + "HQ1", + []string{}, + gcloud.GenerateLocationEmergencyNum( + emergencyNumber, + util.NullValue, // Default number type + ), gcloud.GenerateLocationAddress( + "0176 Interactive Way", + "Indianapolis", + "IN", + "US", + "46279", + )) + + siteRes := "test-site" + siteConfig := edgeSite.GenerateSiteResourceWithCustomAttrs( + siteRes, + "tf site "+uuid.NewString(), + "test site description", + "genesyscloud_location."+locationRes+".id", + "Premises", + false, + `["us-east-1"]`, + util.NullValue, + util.NullValue, + "primary_sites = []", + "secondary_sites = []", + ) + + capabilities := generatePhoneCapabilities( + false, + true, + true, + true, + true, + false, + true, + "mac", + []string{}, + ) + + config := phoneBaseSettings.GeneratePhoneBaseSettingsResourceWithCustomAttrs( + phoneBaseSettingsRes, + phoneBaseSettingsName, + "phoneBaseSettings description", + "generic_sip.json", + ) + GeneratePhoneResourceWithCustomAttrs(&PhoneConfig{ + phoneRes, + name1, + stateActive, + "genesyscloud_telephony_providers_edges_site." + siteRes + ".id", + "genesyscloud_telephony_providers_edges_phonebasesettings." + phoneBaseSettingsRes + ".id", + "", // no web rtc user + "", // no depends on + }, capabilities, generateLineProperties("", strconv.Quote(remoteStationAddress)), generatePhoneProperties(uuid.NewString())) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { util.TestAccPreCheck(t) }, + ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + Steps: []resource.TestStep{ + { + PreConfig: func() { + time.Sleep(30 * time.Second) + }, + Config: locationConfig + siteConfig + config, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "name", name1), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "state", stateActive), + resource.TestCheckResourceAttrPair("genesyscloud_telephony_providers_edges_phone."+phoneRes, "site_id", "genesyscloud_telephony_providers_edges_site."+siteRes, "id"), + resource.TestCheckResourceAttrPair("genesyscloud_telephony_providers_edges_phone."+phoneRes, "line_base_settings_id", "genesyscloud_telephony_providers_edges_phonebasesettings."+phoneBaseSettingsRes, "line_base_settings_id"), + resource.TestCheckResourceAttrPair("genesyscloud_telephony_providers_edges_phone."+phoneRes, "phone_base_settings_id", "genesyscloud_telephony_providers_edges_phonebasesettings."+phoneBaseSettingsRes, "id"), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "line_properties.0.remote_address.0", remoteStationAddress), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.provisions", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.registers", util.TrueValue), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.dual_registers", util.TrueValue), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.allow_reboot", util.TrueValue), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.no_rebalance", util.TrueValue), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.no_cloud_provisioning", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.cdm", util.TrueValue), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.hardware_id_type", "mac"), + ), + }, + { + // Import/Read + ResourceName: "genesyscloud_telephony_providers_edges_phone." + phoneRes, + ImportState: true, + ImportStateVerify: true, + }, + }, + CheckDestroy: TestVerifyWebRtcPhoneDestroyed, + }) +} + func generatePhoneCapabilities( provisions, registers, diff --git a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go index 3b3f8492c..98432d047 100644 --- a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go +++ b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go @@ -13,7 +13,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -27,7 +26,6 @@ type PhoneConfig struct { State string SiteId string PhoneBaseSettingsId string - LineAddresses []string WebRtcUserId string DependsOn string } @@ -50,18 +48,21 @@ func getPhoneFromResourceData(ctx context.Context, pp *phoneProxy, d *schema.Res if lineBaseSettingsID == "" { lineBaseSettingsID, err = getLineBaseSettingsID(ctx, pp, *phoneConfig.PhoneBaseSettings.Id) if err != nil { - return nil, fmt.Errorf("failed to get line base settings for %s: %s", *phoneConfig.Name, err) + return phoneConfig, fmt.Errorf("failed to get line base settings for %s: %s", *phoneConfig.Name, err) } } lineBaseSettings := &platformclientv2.Domainentityref{Id: &lineBaseSettingsID} - lines, isStandalone := buildSdkLines(ctx, pp, d, lineBaseSettings) + lines, isStandalone, lineError := buildSdkLines(ctx, pp, d, lineBaseSettings) + if lineError != nil { + return phoneConfig, fmt.Errorf("failed to create lines for %s: %s", *phoneConfig.Name, lineError) + } phoneConfig.LineBaseSettings = lineBaseSettings phoneConfig.Lines = lines // phone meta base phoneMetaBaseId, err := getPhoneMetaBaseId(ctx, pp, *phoneConfig.PhoneBaseSettings.Id) if err != nil { - return nil, fmt.Errorf("failed to get phone meta base for %s: %s", *phoneConfig.Name, err) + return phoneConfig, fmt.Errorf("failed to get phone meta base for %s: %s", *phoneConfig.Name, err) } phoneMetaBase := &platformclientv2.Domainentityref{ Id: &phoneMetaBaseId, @@ -165,34 +166,6 @@ func getPhoneMetaBaseId(ctx context.Context, pp *phoneProxy, phoneBaseSettingsId return *phoneBase.PhoneMetaBase.Id, nil } -func flattenPhoneLines(lines *[]platformclientv2.Line) []string { - if lines == nil { - return nil - } - - lineAddressList := []string{} - for i := 0; i < len(*lines); i++ { - line := (*lines)[i] - did := "" - if line.Properties == nil { - continue - } - if k := (*line.Properties)["station_identity_address"]; k != nil { - didI := k.(map[string]interface{})["value"].(map[string]interface{})["instance"] - if didI != nil { - did = didI.(string) - } - } - - if len(did) == 0 { - continue - } - lineAddressList = append(lineAddressList, did) - } - - return lineAddressList -} - func flattenPhoneCapabilities(capabilities *platformclientv2.Phonecapabilities) []interface{} { if capabilities == nil { return nil @@ -212,45 +185,99 @@ func flattenPhoneCapabilities(capabilities *platformclientv2.Phonecapabilities) return []interface{}{capabilitiesMap} } -func buildSdkLines(ctx context.Context, pp *phoneProxy, d *schema.ResourceData, lineBaseSettings *platformclientv2.Domainentityref) (linesPtr *[]platformclientv2.Line, isStandAlone bool) { +func buildSdkLines(ctx context.Context, pp *phoneProxy, d *schema.ResourceData, lineBaseSettings *platformclientv2.Domainentityref) (linesPtr *[]platformclientv2.Line, isStandAlone bool, err error) { lines := []platformclientv2.Line{} + lineAddress, remoteAddress := getLineProperties(d) + if len(*lineAddress) > 0 && len(*remoteAddress) > 0 { + return linesPtr, false, fmt.Errorf("remote stations cannot be standalone phones, line_address and remote_address cannot exist at the same time") + } + if len(*lineAddress) > 0 { + linesPtr = createStandalonePhoneLines(*lineAddress, &lines, lineBaseSettings) + isStandAlone = true + return linesPtr, isStandAlone, nil + } + if len(*remoteAddress) > 0 { + linesPtr = createNonStandalonePhoneLine(*remoteAddress, &lines, lineBaseSettings) + isStandAlone = false + return linesPtr, isStandAlone, nil + } + // If line_addresses is not provided, phone is not standalone + hasher := fnv.New32() + hasher.Write([]byte(d.Get("name").(string))) + lineName := "line_" + *lineBaseSettings.Id + fmt.Sprintf("%x", hasher.Sum32()) + line := platformclientv2.Line{ + Name: &lineName, + LineBaseSettings: lineBaseSettings, + } + // If this function is invoked on a phone create, the ID won't exist yet + if d.Id() != "" { + lineId, err := getLineIdByPhoneId(ctx, pp, d.Id()) + if err != nil { + log.Printf("Failed to retrieve ID for phone %s: %v", d.Id(), err) + } else { + line.Id = &lineId + } + } + lines = append(lines, line) + linesPtr = &lines isStandAlone = false + return linesPtr, isStandAlone, nil +} - lineAddresses, ok := d.GetOk("line_addresses") - lineStringList := lists.InterfaceListToStrings(lineAddresses.([]interface{})) +func getLineProperties(d *schema.ResourceData) (*[]interface{}, *[]interface{}) { + lineAddress := make([]interface{}, 0) + remoteAddress := make([]interface{}, 0) + linePropertiesMap := make(map[string]interface{}) + if linePropertiesObject, ok := d.Get("line_properties").([]interface{}); ok && len(linePropertiesObject) > 0 { + linePropertiesMap = linePropertiesObject[0].(map[string]interface{}) + } + if lineAddressObject, ok := linePropertiesMap["line_address"].([]interface{}); ok { + lineAddress = lineAddressObject + } + if remoteAddressObject, ok := linePropertiesMap["remote_address"].([]interface{}); ok { + remoteAddress = remoteAddressObject + } + return &lineAddress, &remoteAddress +} - // If line_addresses is not provided, phone is not standalone - if !ok || len(lineStringList) == 0 { - hasher := fnv.New32() - hasher.Write([]byte(d.Get("name").(string))) - lineName := "line_" + *lineBaseSettings.Id + fmt.Sprintf("%x", hasher.Sum32()) - line := platformclientv2.Line{ +func generatePhoneProperties(hardware_id string) string { + // A random selection of properties + return "properties = " + util.GenerateJsonEncodedProperties( + util.GenerateJsonProperty( + "phone_hardwareId", util.GenerateJsonObject( + util.GenerateJsonProperty( + "value", util.GenerateJsonObject( + util.GenerateJsonProperty("instance", strconv.Quote(hardware_id)), + )))), + ) +} +func createNonStandalonePhoneLine(remoteAddress []interface{}, linesPtr *[]platformclientv2.Line, lineBaseSettings *platformclientv2.Domainentityref) *[]platformclientv2.Line { + lines := *linesPtr + for i, eachAddress := range remoteAddress { + lineName := "line_" + *lineBaseSettings.Id + "_" + strconv.Itoa(i+1) + properties := map[string]interface{}{ + "station_remote_address": &map[string]interface{}{ + "value": &map[string]interface{}{ + "instance": eachAddress.(string), + }, + }, + } + lines = append(lines, platformclientv2.Line{ Name: &lineName, LineBaseSettings: lineBaseSettings, - } - - // If this function is invoked on a phone create, the ID won't exist yet - if d.Id() != "" { - lineId, err := getLineIdByPhoneId(ctx, pp, d.Id()) - if err != nil { - log.Printf("Failed to retrieve ID for phone %s: %v", d.Id(), err) - } else { - line.Id = &lineId - } - } - - lines = append(lines, line) - - linesPtr = &lines - return + Properties: &properties, + }) } - - for i := 0; i < len(lineStringList); i++ { + return &lines +} +func createStandalonePhoneLines(lineAddress []interface{}, linesPtr *[]platformclientv2.Line, lineBaseSettings *platformclientv2.Domainentityref) *[]platformclientv2.Line { + lines := *linesPtr + for i, eachLineAddress := range lineAddress { lineName := "line_" + *lineBaseSettings.Id + "_" + strconv.Itoa(i+1) properties := map[string]interface{}{ "station_identity_address": &map[string]interface{}{ "value": &map[string]interface{}{ - "instance": (lineStringList)[i], + "instance": eachLineAddress.(string), }, }, } @@ -260,11 +287,75 @@ func buildSdkLines(ctx context.Context, pp *phoneProxy, d *schema.ResourceData, Properties: &properties, }) } + return &lines +} - linesPtr = &lines - isStandAlone = true +func flattenLines(phoneLines *[]platformclientv2.Line) []interface{} { + if len(*phoneLines) == 0 { + return nil + } + lineAddressList := []string{} + remoteAddressList := []string{} + linePropertiesMap := make(map[string]interface{}) + + for _, phoneLine := range *phoneLines { + if phoneLine.Properties == nil { + continue + } + if idAddressKey := (*phoneLine.Properties)["station_identity_address"]; idAddressKey != nil { + didI := idAddressKey.(map[string]interface{})["value"].(map[string]interface{})["instance"] + if didI != nil && len(didI.(string)) > 0 { + did := didI.(string) + lineAddressList = append(lineAddressList, did) - return + } + } + if remoteAddressKey := (*phoneLine.Properties)["station_remote_address"]; remoteAddressKey != nil { + remoteAddress := remoteAddressKey.(map[string]interface{})["value"].(map[string]interface{})["instance"] + if remoteAddress != nil && len(remoteAddress.(string)) > 0 { + remoteAddressStr := remoteAddress.(string) + remoteAddressList = append(remoteAddressList, remoteAddressStr) + } + } + + } + + if len(lineAddressList) > 0 { + resourcedata.SetMapValueIfNotNil(linePropertiesMap, "line_address", &lineAddressList) + } + if len(remoteAddressList) > 0 { + resourcedata.SetMapValueIfNotNil(linePropertiesMap, "remote_address", &remoteAddressList) + } + if len(linePropertiesMap) > 0 { + return []interface{}{linePropertiesMap} + + } + return nil +} + +func generateLineProperties(lineAddress string, remoteAddress string) string { + if lineAddress == "" { + return fmt.Sprintf(` + line_properties { + remote_address = [%s] + } + `, remoteAddress) + } + + if remoteAddress == "" { + fmt.Sprintf(` + line_properties { + line_address = [%s] + } + `, lineAddress) + } + + return fmt.Sprintf(` + line_properties { + line_address = [%s] + remote_address = [%s] + } +`, lineAddress, remoteAddress) } func getLineIdByPhoneId(ctx context.Context, pp *phoneProxy, phoneId string) (string, error) { @@ -318,10 +409,6 @@ func buildSdkCapabilities(d *schema.ResourceData) *platformclientv2.Phonecapabil } func GeneratePhoneResourceWithCustomAttrs(config *PhoneConfig, otherAttrs ...string) string { - lineStrs := make([]string, len(config.LineAddresses)) - for i, val := range config.LineAddresses { - lineStrs[i] = fmt.Sprintf("\"%s\"", val) - } webRtcUser := "" if len(config.WebRtcUserId) != 0 { @@ -333,7 +420,6 @@ func GeneratePhoneResourceWithCustomAttrs(config *PhoneConfig, otherAttrs ...str state = "%s" site_id = %s phone_base_settings_id = %s - line_addresses = [%s] depends_on=[%s] %s %s @@ -343,7 +429,6 @@ func GeneratePhoneResourceWithCustomAttrs(config *PhoneConfig, otherAttrs ...str config.State, config.SiteId, config.PhoneBaseSettingsId, - strings.Join(lineStrs, ","), config.DependsOn, webRtcUser, strings.Join(otherAttrs, "\n"), @@ -373,15 +458,3 @@ func TestVerifyWebRtcPhoneDestroyed(state *terraform.State) error { //Success. Phone destroyed return nil } - -func generatePhoneProperties(hardware_id string) string { - // A random selection of properties - return "properties = " + util.GenerateJsonEncodedProperties( - util.GenerateJsonProperty( - "phone_hardwareId", util.GenerateJsonObject( - util.GenerateJsonProperty( - "value", util.GenerateJsonObject( - util.GenerateJsonProperty("instance", strconv.Quote(hardware_id)), - )))), - ) -} From 78ec2409e7027624a89b674a2bae444ef200f7e3 Mon Sep 17 00:00:00 2001 From: tsantos-genesys <154342374+tsantos-genesys@users.noreply.github.com> Date: Tue, 2 Jul 2024 17:26:45 +0100 Subject: [PATCH 44/62] Feat/More validation in utilization label names (#1143) --- ...scloud_routing_utilization_label_schema.go | 34 ++++++++++++++++--- ...syscloud_routing_utilization_label_test.go | 31 +++++++++++++++++ 2 files changed, 60 insertions(+), 5 deletions(-) diff --git a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_schema.go b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_schema.go index fb1c7d070..39ad5e9e8 100644 --- a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_schema.go +++ b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_schema.go @@ -1,6 +1,8 @@ package routing_utilization_label import ( + "fmt" + "strings" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" @@ -34,7 +36,12 @@ func ResourceRoutingUtilizationLabel() *schema.Resource { "name": { Description: "Label name.", Type: schema.TypeString, - Required: true, + ValidateFunc: validation.All( + validation.StringIsNotEmpty, + stringDoesNotStartOrEndWithSpaces, + validation.StringDoesNotContainAny("*"), + ), + Required: true, }, }, } @@ -46,10 +53,14 @@ func DataSourceRoutingUtilizationLabel() *schema.Resource { ReadContext: provider.ReadWithPooledClient(dataSourceRoutingUtilizationLabelRead), Schema: map[string]*schema.Schema{ "name": { - Description: "Label name.", - Type: schema.TypeString, - ValidateFunc: validation.StringDoesNotContainAny("*"), - Required: true, + Description: "Label name.", + Type: schema.TypeString, + ValidateFunc: validation.All( + validation.StringIsNotEmpty, + stringDoesNotStartOrEndWithSpaces, + validation.StringDoesNotContainAny("*"), + ), + Required: true, }, }, } @@ -60,3 +71,16 @@ func RoutingUtilizationLabelExporter() *resourceExporter.ResourceExporter { GetResourcesFunc: provider.GetAllWithPooledClient(getAllRoutingUtilizationLabels), } } + +func stringDoesNotStartOrEndWithSpaces(input interface{}, k string) ([]string, []error) { + inputAsString, ok := input.(string) + if !ok { + return nil, []error{fmt.Errorf("expected type of %q to be string", k)} + } + + if len(strings.TrimSpace(inputAsString)) != len(inputAsString) { + return nil, []error{fmt.Errorf("expected %q to not start or end with spaces", k)} + } + + return nil, nil +} diff --git a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_test.go b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_test.go index 28b1d9019..ca7b09718 100644 --- a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_test.go +++ b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_test.go @@ -2,6 +2,7 @@ package routing_utilization_label import ( "fmt" + "regexp" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "testing" @@ -56,6 +57,36 @@ func TestAccResourceRoutingUtilizationLabelBasic(t *testing.T) { }) } +func TestAccResourceRoutingUtilizationLabelInvalidNames(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { util.TestAccPreCheck(t) }, + ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + Steps: []resource.TestStep{ + { + Config: GenerateRoutingUtilizationLabelResource("resource", " abc", ""), + ExpectError: regexp.MustCompile("to not start or end with spaces"), + }, + { + Config: GenerateRoutingUtilizationLabelResource("resource", "abc ", ""), + ExpectError: regexp.MustCompile("to not start or end with spaces"), + }, + { + Config: GenerateRoutingUtilizationLabelResource("resource", " abc ", ""), + ExpectError: regexp.MustCompile("to not start or end with spaces"), + }, + { + Config: GenerateRoutingUtilizationLabelResource("resource", "abc*", ""), + ExpectError: regexp.MustCompile("expected value of name to not contain any of"), + }, + { + Config: GenerateRoutingUtilizationLabelResource("resource", "", ""), + ExpectError: regexp.MustCompile("to not be an empty string"), + }, + }, + CheckDestroy: validateTestLabelDestroyed, + }) +} + func validateTestLabelDestroyed(state *terraform.State) error { routingApi := platformclientv2.NewRoutingApi() From eac8794d365e68acb80d649a76800933af63de4d Mon Sep 17 00:00:00 2001 From: Brian Goad Date: Mon, 8 Jul 2024 07:49:21 -0400 Subject: [PATCH 45/62] Fix DEVTOOLING-703 (#1144) * Fix DEVTOOLING-703 * Add unit test for isQueueEmailAddressEmpty() --- ...ud_routing_queue_outbound_email_address.go | 2 +- ...ing_queue_outbound_email_address_schema.go | 3 +- ...ting_queue_outbound_email_address_utils.go | 25 ++++++++++++++++ ..._outbound_email_address_utils_unit_test.go | 30 +++++++++++++++++++ 4 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_utils.go create mode 100644 genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_utils_unit_test.go diff --git a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address.go b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address.go index 79d72046b..e9f412963 100644 --- a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address.go +++ b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address.go @@ -38,7 +38,7 @@ func getAllAuthRoutingQueueOutboundEmailAddress(ctx context.Context, clientConfi } for _, queue := range *queues { - if queue.OutboundEmailAddress != nil && *queue.OutboundEmailAddress != nil { + if queue.OutboundEmailAddress != nil && !isQueueEmailAddressEmpty(*queue.OutboundEmailAddress) { resources[*queue.Id] = &resourceExporter.ResourceMeta{Name: *queue.Name + "-email-address"} } } diff --git a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_schema.go b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_schema.go index f78e264c3..3a1c71f69 100644 --- a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_schema.go +++ b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_schema.go @@ -1,10 +1,11 @@ package routing_queue_outbound_email_address import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) const resourceName = "genesyscloud_routing_queue_outbound_email_address" diff --git a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_utils.go b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_utils.go new file mode 100644 index 000000000..e6c7a51e2 --- /dev/null +++ b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_utils.go @@ -0,0 +1,25 @@ +package routing_queue_outbound_email_address + +import "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" + +func isQueueEmailAddressEmpty(qea *platformclientv2.Queueemailaddress) bool { + if qea == nil { + return true + } + + // Compare relevant fields of the struct + if qea.Domain == nil || qea.Domain.Id == nil || *qea.Domain.Id == "" { + return true + } + + if qea.Route != nil && *qea.Route != nil { + routeId := (*qea.Route).Id + if routeId == nil || *routeId == "" { + return true + } + } else { + return true + } + + return false +} diff --git a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_utils_unit_test.go b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_utils_unit_test.go new file mode 100644 index 000000000..bf9230f0c --- /dev/null +++ b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_utils_unit_test.go @@ -0,0 +1,30 @@ +package routing_queue_outbound_email_address + +import ( + "testing" + + "github.com/google/uuid" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" + "github.com/stretchr/testify/assert" +) + +func TestUnitResourceRoutingQueueOutboundEmailAddressEmpty(t *testing.T) { + address := platformclientv2.Queueemailaddress{} + result := isQueueEmailAddressEmpty(&address) + assert.Equal(t, true, result) +} + +func TestUnitResourceRoutingQueueOutboundEmailAddressNotEmpty(t *testing.T) { + tDomainId := uuid.NewString() + tRouteId := uuid.NewString() + + route := &platformclientv2.Inboundroute{ + Id: &tRouteId, + } + address := platformclientv2.Queueemailaddress{ + Domain: &platformclientv2.Domainentityref{Id: &tDomainId}, + Route: &route, + } + result := isQueueEmailAddressEmpty(&address) + assert.Equal(t, false, result) +} From 21829056004d32dcf91b04c019db6a7eefb78cf0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 13:28:13 +0100 Subject: [PATCH 46/62] Bump golang.org/x/net from 0.26.0 to 0.27.0 (#1146) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.26.0 to 0.27.0. - [Commits](https://github.com/golang/net/compare/v0.26.0...v0.27.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index e1c1b31e1..debecdddd 100644 --- a/go.mod +++ b/go.mod @@ -94,10 +94,10 @@ require ( github.com/subosito/gotenv v1.2.0 // indirect github.com/tidwall/pretty v1.2.0 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect - golang.org/x/crypto v0.24.0 // indirect + golang.org/x/crypto v0.25.0 // indirect golang.org/x/mod v0.17.0 // indirect - golang.org/x/net v0.26.0 - golang.org/x/sys v0.21.0 // indirect + golang.org/x/net v0.27.0 + golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/grpc v1.63.2 // indirect diff --git a/go.sum b/go.sum index ad41a8428..7f2f226e0 100644 --- a/go.sum +++ b/go.sum @@ -362,8 +362,8 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= +golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -404,8 +404,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -442,8 +442,8 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= From 959dc004fe10dfcdbf1eb2812e3ce997a77bcbf3 Mon Sep 17 00:00:00 2001 From: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Date: Mon, 8 Jul 2024 15:47:22 +0100 Subject: [PATCH 47/62] Feat/devtooling-645: Add roles_enabled to group resource (#1145) * Added roles_enabled to group * Added rolesEnabled to test * Requested changes --- docs/resources/group.md | 1 + genesyscloud/group/resource_genesyscloud_group.go | 5 +++++ .../group/resource_genesyscloud_group_schema.go | 11 +++++++++-- .../group/resource_genesyscloud_group_test.go | 4 ++++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/docs/resources/group.md b/docs/resources/group.md index 543559487..b30335d26 100644 --- a/docs/resources/group.md +++ b/docs/resources/group.md @@ -51,6 +51,7 @@ resource "genesyscloud_group" "sample_group" { - `description` (String) Group description. - `member_ids` (Set of String) IDs of members assigned to the group. If not set, this resource will not manage group members. - `owner_ids` (List of String) IDs of owners of the group. +- `roles_enabled` (Boolean) Allow roles to be assigned to this group. Defaults to `true`. - `rules_visible` (Boolean) Are membership rules visible to the person requesting to view the group. Defaults to `true`. - `type` (String) Group type (official | social). This cannot be modified. Changing type attribute will cause the existing genesys_group object to dropped and recreated with a new ID. Defaults to `official`. - `visibility` (String) Who can view this group (public | owners | members). Defaults to `public`. diff --git a/genesyscloud/group/resource_genesyscloud_group.go b/genesyscloud/group/resource_genesyscloud_group.go index 2aa146fd4..59f47ced5 100644 --- a/genesyscloud/group/resource_genesyscloud_group.go +++ b/genesyscloud/group/resource_genesyscloud_group.go @@ -46,6 +46,7 @@ func createGroup(ctx context.Context, d *schema.ResourceData, meta interface{}) groupType := d.Get("type").(string) visibility := d.Get("visibility").(string) rulesVisible := d.Get("rules_visible").(bool) + rolesEnabled := d.Get("roles_enabled").(bool) sdkConfig := meta.(*provider.ProviderMeta).ClientConfig gp := getGroupProxy(sdkConfig) @@ -61,6 +62,7 @@ func createGroup(ctx context.Context, d *schema.ResourceData, meta interface{}) Visibility: &visibility, RulesVisible: &rulesVisible, Addresses: addresses, + RolesEnabled: &rolesEnabled, OwnerIds: lists.BuildSdkStringListFromInterfaceArray(d, "owner_ids"), } log.Printf("Creating group %s", name) @@ -111,6 +113,7 @@ func readGroup(ctx context.Context, d *schema.ResourceData, meta interface{}) di resourcedata.SetNillableValue(d, "visibility", group.Visibility) resourcedata.SetNillableValue(d, "rules_visible", group.RulesVisible) resourcedata.SetNillableValue(d, "description", group.Description) + resourcedata.SetNillableValue(d, "roles_enabled", group.RolesEnabled) resourcedata.SetNillableValueWithInterfaceArrayWithFunc(d, "owner_ids", group.Owners, flattenGroupOwners) @@ -136,6 +139,7 @@ func updateGroup(ctx context.Context, d *schema.ResourceData, meta interface{}) description := d.Get("description").(string) visibility := d.Get("visibility").(string) rulesVisible := d.Get("rules_visible").(bool) + rolesEnabled := d.Get("roles_enabled").(bool) sdkConfig := meta.(*provider.ProviderMeta).ClientConfig gp := getGroupProxy(sdkConfig) @@ -160,6 +164,7 @@ func updateGroup(ctx context.Context, d *schema.ResourceData, meta interface{}) Visibility: &visibility, RulesVisible: &rulesVisible, Addresses: addresses, + RolesEnabled: &rolesEnabled, OwnerIds: lists.BuildSdkStringListFromInterfaceArray(d, "owner_ids"), } _, resp, putErr := gp.updateGroup(ctx, d.Id(), updateGroup) diff --git a/genesyscloud/group/resource_genesyscloud_group_schema.go b/genesyscloud/group/resource_genesyscloud_group_schema.go index d4fcc109a..e26320623 100644 --- a/genesyscloud/group/resource_genesyscloud_group_schema.go +++ b/genesyscloud/group/resource_genesyscloud_group_schema.go @@ -1,12 +1,13 @@ package group import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" "terraform-provider-genesyscloud/genesyscloud/validators" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) const resourceName = "genesyscloud_group" @@ -120,6 +121,12 @@ func ResourceGroup() *schema.Resource { Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, }, + "roles_enabled": { + Description: "Allow roles to be assigned to this group.", + Type: schema.TypeBool, + Optional: true, + Default: true, + }, }, } } diff --git a/genesyscloud/group/resource_genesyscloud_group_test.go b/genesyscloud/group/resource_genesyscloud_group_test.go index 17a022b04..c889d8a4b 100644 --- a/genesyscloud/group/resource_genesyscloud_group_test.go +++ b/genesyscloud/group/resource_genesyscloud_group_test.go @@ -44,6 +44,7 @@ func TestAccResourceGroupBasic(t *testing.T) { util.NullValue, // Default type util.NullValue, // Default visibility util.NullValue, // Default rules_visible + "roles_enabled = false", GenerateGroupOwners("genesyscloud_user."+testUserResource+".id"), ), Check: resource.ComposeTestCheckFunc( @@ -52,6 +53,7 @@ func TestAccResourceGroupBasic(t *testing.T) { resource.TestCheckResourceAttr("genesyscloud_group."+groupResource1, "description", groupDesc1), resource.TestCheckResourceAttr("genesyscloud_group."+groupResource1, "visibility", visPublic), resource.TestCheckResourceAttr("genesyscloud_group."+groupResource1, "rules_visible", util.TrueValue), + resource.TestCheckResourceAttr("genesyscloud_group."+groupResource1, "roles_enabled", util.FalseValue), ), }, { @@ -63,6 +65,7 @@ func TestAccResourceGroupBasic(t *testing.T) { strconv.Quote(typeOfficial), // Cannot change type strconv.Quote(visMembers), util.FalseValue, + "roles_enabled = true", GenerateGroupOwners("genesyscloud_user."+testUserResource+".id"), ), Check: resource.ComposeTestCheckFunc( @@ -71,6 +74,7 @@ func TestAccResourceGroupBasic(t *testing.T) { resource.TestCheckResourceAttr("genesyscloud_group."+groupResource1, "description", groupDesc2), resource.TestCheckResourceAttr("genesyscloud_group."+groupResource1, "visibility", visMembers), resource.TestCheckResourceAttr("genesyscloud_group."+groupResource1, "rules_visible", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_group."+groupResource1, "roles_enabled", util.TrueValue), func(s *terraform.State) error { time.Sleep(30 * time.Second) // Wait for 30 seconds for resources to get deleted properly return nil From f1602f7e86d2f51a84b186640e0b8e92af6f2522 Mon Sep 17 00:00:00 2001 From: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Date: Mon, 8 Jul 2024 15:48:15 +0100 Subject: [PATCH 48/62] Bug/Devtooling-677: Error Migrating routes to independent resource (#1132) * Fixing conflict * Remove Duplicate imports --- ...ony_providers_edges_site_outbound_route.go | 28 +++++++++++++++++-- ...oviders_edges_site_outbound_route_utils.go | 12 ++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route.go b/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route.go index 24643c857..610d622aa 100644 --- a/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route.go +++ b/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route.go @@ -4,10 +4,12 @@ import ( "context" "fmt" "log" + "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" "terraform-provider-genesyscloud/genesyscloud/util" + "terraform-provider-genesyscloud/genesyscloud/util/constants" featureToggles "terraform-provider-genesyscloud/genesyscloud/util/feature_toggles" "terraform-provider-genesyscloud/genesyscloud/util/lists" @@ -63,10 +65,31 @@ func createSiteOutboundRoutes(ctx context.Context, d *schema.ResourceData, meta sdkConfig := meta.(*provider.ProviderMeta).ClientConfig proxy := getSiteOutboundRouteProxy(sdkConfig) siteId := d.Get("site_id").(string) + outboundRoutes := buildOutboundRoutes(d.Get("outbound_routes").(*schema.Set)) + var newRoutes []platformclientv2.Outboundroutebase + + // When creating outbound routes, routes may already exist in the site. This can lead to error `Outbound Route Already Exists` + // To prevent this, existing routes for the site are obtained and compared with the routes to be created + // ONLY non-existing routes are created for the site + + log.Printf("Retrieving existing outbound routes for side %s before creation", siteId) + + outboundRoutesAPI, resp, err := proxy.getSiteOutboundRoutes(ctx, siteId) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to get outbound routes for site %s error: %s", d.Id(), err), resp) + } + + // If the site already has routes, filter and create routes that don't exist + // Otherwise, create every route + if outboundRoutesAPI != nil && len(*outboundRoutesAPI) > 0 { + newRoutes = checkExistingRoutes(outboundRoutes, outboundRoutesAPI, siteId) + } else { + newRoutes = append(newRoutes, *outboundRoutes...) + } + log.Printf("creating outbound routes for site %s", siteId) - outboundRoutes := buildOutboundRoutes(d.Get("outbound_routes").(*schema.Set)) - for _, outboundRoute := range *outboundRoutes { + for _, outboundRoute := range newRoutes { _, resp, err := proxy.createSiteOutboundRoute(ctx, siteId, &outboundRoute) if err != nil { return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("failed to create outbound route %s for site %s: %s", *outboundRoute.Name, siteId, err), resp) @@ -127,6 +150,7 @@ func readSiteOutboundRoutes(ctx context.Context, d *schema.ResourceData, meta in _ = d.Set("outbound_routes", nil) } + log.Printf("Read outbound routes for site %s", d.Id()) return cc.CheckState(d) }) } diff --git a/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_utils.go b/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_utils.go index 32875f56e..5c9b6c29c 100644 --- a/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_utils.go +++ b/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_utils.go @@ -1,6 +1,7 @@ package telephony_providers_edges_site_outbound_route import ( + "log" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -47,3 +48,14 @@ func nameInOutboundRoutes(name string, outboundRoutes []platformclientv2.Outboun return nil, false } + +func checkExistingRoutes(definedRoutes, apiRoutes *[]platformclientv2.Outboundroutebase, siteId string) (newRoutes []platformclientv2.Outboundroutebase) { + for _, definedRoute := range *definedRoutes { + if _, present := nameInOutboundRoutes(*definedRoute.Name, *apiRoutes); present { + log.Printf("Route %s associated with site %s already exists. Creating only non-existing routes", *definedRoute.Name, siteId) + } else { + newRoutes = append(newRoutes, definedRoute) + } + } + return newRoutes +} From f5627d6af6623d92cb9605214ca88e0058cf5d3c Mon Sep 17 00:00:00 2001 From: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Date: Tue, 9 Jul 2024 11:18:05 +0100 Subject: [PATCH 49/62] adding missing return statement in utils function (#1148) --- ...source_genesyscloud_telephony_providers_edges_phone_utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go index 98432d047..3ff097d5b 100644 --- a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go +++ b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go @@ -343,7 +343,7 @@ func generateLineProperties(lineAddress string, remoteAddress string) string { } if remoteAddress == "" { - fmt.Sprintf(` + return fmt.Sprintf(` line_properties { line_address = [%s] } From 74225705d05bb1bf4a1b0b404082b9a6b4dd7285 Mon Sep 17 00:00:00 2001 From: michalk-genesys Date: Tue, 9 Jul 2024 11:18:47 +0100 Subject: [PATCH 50/62] feat/GPE-14463 add support for App stream type on Journey resources (#1147) When configuring Journey resources like segments, outcomes or action maps, it is now possible to use App stream type. Also, the documentation around supported session types was updated, to specify the allowed values. --- docs/resources/journey_action_map.md | 4 ++-- docs/resources/journey_outcome.md | 4 ++-- docs/resources/journey_segment.md | 4 ++-- genesyscloud/resource_genesyscloud_journey_action_map.go | 7 ++++--- genesyscloud/resource_genesyscloud_journey_segment.go | 8 ++++---- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/docs/resources/journey_action_map.md b/docs/resources/journey_action_map.md index 467dbed77..883fd233a 100644 --- a/docs/resources/journey_action_map.md +++ b/docs/resources/journey_action_map.md @@ -170,8 +170,8 @@ Required: Required: - `key` (String) The event key. -- `session_type` (String) The session type for which this condition can be satisfied. -- `stream_type` (String) The stream type for which this condition can be satisfied. Valid values: Web, Custom, Conversation. +- `session_type` (String) The session type for which this condition can be satisfied. Valid values: web, app. +- `stream_type` (String) The stream type for which this condition can be satisfied. Valid values: Web, App. - `values` (Set of String) The event values. Optional: diff --git a/docs/resources/journey_outcome.md b/docs/resources/journey_outcome.md index 58acec4f7..e3ac09b60 100644 --- a/docs/resources/journey_outcome.md +++ b/docs/resources/journey_outcome.md @@ -126,8 +126,8 @@ Required: - `count` (Number) The number of times the pattern must match. - `criteria` (Block Set, Min: 1) A list of one or more criteria to satisfy. (see [below for nested schema](#nestedblock--journey--patterns--criteria)) -- `session_type` (String) The session type for which this pattern can be matched on. -- `stream_type` (String) The stream type for which this pattern can be matched on.Valid values: Web, Custom, Conversation. +- `session_type` (String) The session type for which this pattern can be matched on. Valid values: web, app. +- `stream_type` (String) The stream type for which this pattern can be matched on. Valid values: Web, App. Optional: diff --git a/docs/resources/journey_segment.md b/docs/resources/journey_segment.md index 785e47715..2550f03ae 100644 --- a/docs/resources/journey_segment.md +++ b/docs/resources/journey_segment.md @@ -119,8 +119,8 @@ Required: - `count` (Number) The number of times the pattern must match. - `criteria` (Block Set, Min: 1) A list of one or more criteria to satisfy. (see [below for nested schema](#nestedblock--journey--patterns--criteria)) -- `session_type` (String) The session type for which this pattern can be matched on. -- `stream_type` (String) The stream type for which this pattern can be matched on.Valid values: Web, Custom, Conversation. +- `session_type` (String) The session type for which this pattern can be matched on. Valid values: web, app. +- `stream_type` (String) The stream type for which this pattern can be matched on. Valid values: Web, App. Optional: diff --git a/genesyscloud/resource_genesyscloud_journey_action_map.go b/genesyscloud/resource_genesyscloud_journey_action_map.go index 9519f9e52..2b9100ec4 100644 --- a/genesyscloud/resource_genesyscloud_journey_action_map.go +++ b/genesyscloud/resource_genesyscloud_journey_action_map.go @@ -134,15 +134,16 @@ var ( ValidateFunc: validation.StringInSlice([]string{"containsAll", "containsAny", "notContainsAll", "notContainsAny", "equal", "notEqual", "greaterThan", "greaterThanOrEqual", "lessThan", "lessThanOrEqual", "startsWith", "endsWith"}, false), }, "stream_type": { - Description: "The stream type for which this condition can be satisfied. Valid values: Web, Custom, Conversation.", + Description: "The stream type for which this condition can be satisfied. Valid values: Web, App.", Type: schema.TypeString, Required: true, - ValidateFunc: validation.StringInSlice([]string{"Web", "Custom", "Conversation"}, false), + ValidateFunc: validation.StringInSlice([]string{"Web", "App" /*,"Custom", "Conversation" */}, false), // Custom and Conversation seem not to be supported by the API despite the documentation (DEVENGSD-607) }, "session_type": { - Description: "The session type for which this condition can be satisfied.", + Description: "The session type for which this condition can be satisfied. Valid values: web, app.", Type: schema.TypeString, Required: true, + ValidateFunc: validation.StringInSlice([]string{"web", "app"}, false), // custom value seems not to be supported by the API despite the documentation }, "event_name": { Description: "The name of the event for which this condition can be satisfied.", diff --git a/genesyscloud/resource_genesyscloud_journey_segment.go b/genesyscloud/resource_genesyscloud_journey_segment.go index d899aa2d4..e4735692e 100644 --- a/genesyscloud/resource_genesyscloud_journey_segment.go +++ b/genesyscloud/resource_genesyscloud_journey_segment.go @@ -162,16 +162,16 @@ var ( Required: true, }, "stream_type": { - Description: "The stream type for which this pattern can be matched on.Valid values: Web, Custom, Conversation.", + Description: "The stream type for which this pattern can be matched on. Valid values: Web, App.", Type: schema.TypeString, Required: true, - ValidateFunc: validation.StringInSlice([]string{"Web" /*, "Custom", "Conversation"*/}, false), // Custom and Conversation seem not to be supported by the API despite the documentation + ValidateFunc: validation.StringInSlice([]string{"Web", "App" /*, "Custom", "Conversation"*/}, false), // Custom and Conversation seem not to be supported by the API despite the documentation (DEVENGSD-607) }, "session_type": { - Description: "The session type for which this pattern can be matched on.", + Description: "The session type for which this pattern can be matched on. Valid values: web, app.", Type: schema.TypeString, Required: true, - ValidateFunc: validation.StringInSlice([]string{"web"}, false), // custom value seems not to be supported by the API despite the documentation + ValidateFunc: validation.StringInSlice([]string{"web", "app"}, false), // custom value seems not to be supported by the API despite the documentation }, "event_name": { Description: "The name of the event for which this pattern can be matched on.", From 106fba70233e654c82e251a1975be15107d53cc3 Mon Sep 17 00:00:00 2001 From: shrutisuryawanshigenesys Date: Wed, 10 Jul 2024 12:20:49 -0400 Subject: [PATCH 51/62] Merge Dev to Main - Release v1.42.0 (#1151) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 (#1008) * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.1 to 0.19.2. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.1...v0.19.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * ran go generate --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * DEVTOOLING-352 - provider oauth credential rate limit exceeded (#1004) * Testing something * Adding retry * Fixed retry * Moved functionality to retries package * Fixed inport cycle * Extending sleep * Added retry to AuthorizeSdk * Using with retries * Remving old function * Feat/devtooling 461 - WithRetries errors include improved logging (#1012) * calling diag func * Changed retryable functions to call Diagnostic function * Converted all withRetries errors to have improved wrapper * Made requested Changes * fixing unit test * Bump golang.org/x/net from 0.23.0 to 0.25.0 (#1017) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.25.0. - [Commits](https://github.com/golang/net/compare/v0.23.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix for issue 993 : Changed message_column to optional and add verification logic (#1013) * Changed message_column to optional and add verification logic * applied safer nil value handling * go generate (#1018) * bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1015) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Revert "bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1…" (#1019) This reverts commit 3ff66d472071905b18b4f66f6ee4b3d3725600e7. * bug/devtooling 560 - CX as Code crash when creating phones (#1020) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Made requested Change * feat/devtooling 579 - Improved Logging for Non-API errors (#1021) * Adding improved non-api diag errors * Pulling Merged PR * Added improved error * Added more logging * Ran go vet * Updated docs * Bump hashicorp/setup-terraform from 3.1.0 to 3.1.1 (#1024) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bug/devtooling 362 - Evaluation forms incorrectly assigning published attribute (#1022) * Correctly sets published feature * Added functionality to set published field correctly * Fixed docs * Bug/devtooling 444: Custom resolver function for outbound campaign script_id (#1014) * Resolving campaign script_id to default outbound script data source when appropriate * Created constants package * editing scripts proxy so that the datasource catches Default scripts * Finished writing tests for new campaign field custom resolver * Fixed linting errors in campaigns package * implemented caching for campaigns exporter * minor changes to a comment * Add deleteCacheItem func + some refactoring work * Refactoring call to resolveToDataSource function and added unit test * Fixing script data source test * Bump github.com/nyaruka/phonenumbers from 1.3.4 to 1.3.5 (#1026) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.4 to 1.3.5. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.4...v1.3.5) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Devtooling-162: Refactored idp salesforce (#999) * Refactored idp salesforce * Fixing docs * Changed function name * Removed original file * Changed Build Function Call to fix type difference (#1029) * fixing test for published attribute (#1030) * No jira: fixing up a few acceptance tests (#1031) * fixed journey segment update * Adding check to journey segment tests to validate is feature is supported * preventing panic in export helper function * Adding sleep to milestone data source test * Cleaning up fmt.Print statements appearing in export tests * undoing changes to segment resource file * Fix routing queue (#1028) * README update (#1025) * Pre-verify if the tfState is in sync with the exporter (#1027) * Add state comapartors * Upddate review comments * Devtooling-591: Consistency Checker Refactor (#1032) * Moved where consistency checker is created in resources * Cleaned up consitency checker file * Added resource name to message * Conditionally adding name * Made requested changes * Feature/devtooling 589 1 (#1035) * update doc * fix reviews * Fix acceptance tests - TCA and Prod (#1033) * Fix edge,export,script test,Jenkin to run tca&prod * Fix export & integration tests * Fix auth tests Fix auth tests * fix tests * resolve conflicts * move assignregion func, remove commented function modify to return empty string - assignregion func return default region --------- Co-authored-by: Monisha Padmavathi Ragavan * Bug/devtooling 597 - Routing email route test failing (#1039) * Added call to cleanup function * linter * adding hotfix to pr labeler config file (#1042) * bug/DEVTOOLING-436 - Added cleanup function for webdeployments resources (#1038) * Added cleanup function for webdeployments resources * fixing conflict * Made requested changes * Made requested changes * Bump github.com/hashicorp/terraform-plugin-sdk/v2 from 2.33.0 to 2.34.0 (#1047) Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.33.0 to 2.34.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.33.0...v2.34.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bug/devtooling 287 temp disable cchecker (#1037) * removed consistency checker * changed DID number * phoneUpdated * Merging dev to main for v1.38.0 (#1036) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 (#1008) * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.1 to 0.19.2. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.1...v0.19.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * ran go generate --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * DEVTOOLING-352 - provider oauth credential rate limit exceeded (#1004) * Testing something * Adding retry * Fixed retry * Moved functionality to retries package * Fixed inport cycle * Extending sleep * Added retry to AuthorizeSdk * Using with retries * Remving old function * Feat/devtooling 461 - WithRetries errors include improved logging (#1012) * calling diag func * Changed retryable functions to call Diagnostic function * Converted all withRetries errors to have improved wrapper * Made requested Changes * fixing unit test * Bump golang.org/x/net from 0.23.0 to 0.25.0 (#1017) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.25.0. - [Commits](https://github.com/golang/net/compare/v0.23.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix for issue 993 : Changed message_column to optional and add verification logic (#1013) * Changed message_column to optional and add verification logic * applied safer nil value handling * go generate (#1018) * bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1015) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Revert "bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1…" (#1019) This reverts commit 3ff66d472071905b18b4f66f6ee4b3d3725600e7. * bug/devtooling 560 - CX as Code crash when creating phones (#1020) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Made requested Change * feat/devtooling 579 - Improved Logging for Non-API errors (#1021) * Adding improved non-api diag errors * Pulling Merged PR * Added improved error * Added more logging * Ran go vet * Updated docs * Bump hashicorp/setup-terraform from 3.1.0 to 3.1.1 (#1024) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bug/devtooling 362 - Evaluation forms incorrectly assigning published attribute (#1022) * Correctly sets published feature * Added functionality to set published field correctly * Fixed docs * Bug/devtooling 444: Custom resolver function for outbound campaign script_id (#1014) * Resolving campaign script_id to default outbound script data source when appropriate * Created constants package * editing scripts proxy so that the datasource catches Default scripts * Finished writing tests for new campaign field custom resolver * Fixed linting errors in campaigns package * implemented caching for campaigns exporter * minor changes to a comment * Add deleteCacheItem func + some refactoring work * Refactoring call to resolveToDataSource function and added unit test * Fixing script data source test * Bump github.com/nyaruka/phonenumbers from 1.3.4 to 1.3.5 (#1026) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.4 to 1.3.5. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.4...v1.3.5) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Devtooling-162: Refactored idp salesforce (#999) * Refactored idp salesforce * Fixing docs * Changed function name * Removed original file * Changed Build Function Call to fix type difference (#1029) * fixing test for published attribute (#1030) * No jira: fixing up a few acceptance tests (#1031) * fixed journey segment update * Adding check to journey segment tests to validate is feature is supported * preventing panic in export helper function * Adding sleep to milestone data source test * Cleaning up fmt.Print statements appearing in export tests * undoing changes to segment resource file * Fix routing queue (#1028) * README update (#1025) * Pre-verify if the tfState is in sync with the exporter (#1027) * Add state comapartors * Upddate review comments * Devtooling-591: Consistency Checker Refactor (#1032) * Moved where consistency checker is created in resources * Cleaned up consitency checker file * Added resource name to message * Conditionally adding name * Made requested changes * Feature/devtooling 589 1 (#1035) * update doc * fix reviews --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * NO-JIRA: Fixing nil pointer in consistency checker (#1041) * Fixed nil pointer in consistency checker * Fixed a few more nil pointers * Fixing nil pointer (#1045) * merged with dev --------- Signed-off-by: dependabot[bot] Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * Fixing up provider docs (#1046) * Fix Export Version problem (#1049) * Logging error in queue create/update instead of failing (#1050) * Refactor/devtooling 395 (#1044) * refactor/DEVTOOLING-395 - adding architect_schedules package * Addressed PR comments * added caching in schedules * Report Generation & testcase fix (#1051) * Report generation generate report generate report * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests * fix tests * fix tests fix tests fix tests * fix tests * fix report * fix report * fix tests fix tests * Bump github.com/hashicorp/terraform-plugin-sdk/v2 from 2.33.0 to 2.34.0 (#1047) Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.33.0 to 2.34.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.33.0...v2.34.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bug/devtooling 287 temp disable cchecker (#1037) * removed consistency checker * changed DID number * phoneUpdated * Merging dev to main for v1.38.0 (#1036) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 (#1008) * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.1 to 0.19.2. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.1...v0.19.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * ran go generate --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * DEVTOOLING-352 - provider oauth credential rate limit exceeded (#1004) * Testing something * Adding retry * Fixed retry * Moved functionality to retries package * Fixed inport cycle * Extending sleep * Added retry to AuthorizeSdk * Using with retries * Remving old function * Feat/devtooling 461 - WithRetries errors include improved logging (#1012) * calling diag func * Changed retryable functions to call Diagnostic function * Converted all withRetries errors to have improved wrapper * Made requested Changes * fixing unit test * Bump golang.org/x/net from 0.23.0 to 0.25.0 (#1017) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.25.0. - [Commits](https://github.com/golang/net/compare/v0.23.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix for issue 993 : Changed message_column to optional and add verification logic (#1013) * Changed message_column to optional and add verification logic * applied safer nil value handling * go generate (#1018) * bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1015) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Revert "bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1…" (#1019) This reverts commit 3ff66d472071905b18b4f66f6ee4b3d3725600e7. * bug/devtooling 560 - CX as Code crash when creating phones (#1020) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Made requested Change * feat/devtooling 579 - Improved Logging for Non-API errors (#1021) * Adding improved non-api diag errors * Pulling Merged PR * Added improved error * Added more logging * Ran go vet * Updated docs * Bump hashicorp/setup-terraform from 3.1.0 to 3.1.1 (#1024) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bug/devtooling 362 - Evaluation forms incorrectly assigning published attribute (#1022) * Correctly sets published feature * Added functionality to set published field correctly * Fixed docs * Bug/devtooling 444: Custom resolver function for outbound campaign script_id (#1014) * Resolving campaign script_id to default outbound script data source when appropriate * Created constants package * editing scripts proxy so that the datasource catches Default scripts * Finished writing tests for new campaign field custom resolver * Fixed linting errors in campaigns package * implemented caching for campaigns exporter * minor changes to a comment * Add deleteCacheItem func + some refactoring work * Refactoring call to resolveToDataSource function and added unit test * Fixing script data source test * Bump github.com/nyaruka/phonenumbers from 1.3.4 to 1.3.5 (#1026) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.4 to 1.3.5. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.4...v1.3.5) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Devtooling-162: Refactored idp salesforce (#999) * Refactored idp salesforce * Fixing docs * Changed function name * Removed original file * Changed Build Function Call to fix type difference (#1029) * fixing test for published attribute (#1030) * No jira: fixing up a few acceptance tests (#1031) * fixed journey segment update * Adding check to journey segment tests to validate is feature is supported * preventing panic in export helper function * Adding sleep to milestone data source test * Cleaning up fmt.Print statements appearing in export tests * undoing changes to segment resource file * Fix routing queue (#1028) * README update (#1025) * Pre-verify if the tfState is in sync with the exporter (#1027) * Add state comapartors * Upddate review comments * Devtooling-591: Consistency Checker Refactor (#1032) * Moved where consistency checker is created in resources * Cleaned up consitency checker file * Added resource name to message * Conditionally adding name * Made requested changes * Feature/devtooling 589 1 (#1035) * update doc * fix reviews --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * NO-JIRA: Fixing nil pointer in consistency checker (#1041) * Fixed nil pointer in consistency checker * Fixed a few more nil pointers * Fixing nil pointer (#1045) * merged with dev --------- Signed-off-by: dependabot[bot] Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * Fixing up provider docs (#1046) * fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests --------- Signed-off-by: dependabot[bot] Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * Add extra check for dependency resolution (#1052) * Devtooling 604: Infinite loop retrieving knowledge documents (#1053) * DEVTOOLING-282 * Adding log message indicating we're hitting the specific scenario for which the integration no longer exist * working around cycling dependencies per charliecon recommendation * adding implementation function getIntegrationByIdFn * Export integration credential only if it matches the expected format - DEVTOOLING-310 * infite loop bugfix --------- Co-authored-by: Will <37446330+williamjeuniaux@users.noreply.github.com> * Feat/COBROWSE-2404 add cobrowse config field (#1054) * made changes similar to what Mateusz did for other fields * updated version * mod and sum fix --------- Co-authored-by: ivan * No jira: Fixing dev with go generate & go mod tidy (#1057) * Fixed go.mod + removed refs to old sdk version * Small refactoring + go generate * DEVTOOLING-592: Changed team members logic (#1055) * Changed team members logic * moved function * Updated docs * Updated docs * Updated docs * Updated docs * Rand go generate * Bump github.com/nyaruka/phonenumbers from 1.3.5 to 1.3.6 (#1056) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.5 to 1.3.6. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.5...v1.3.6) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Feat/devtooling-477: Site Outbound Routes Resource (#1048) * Moving outbound routes to own package * Continued with outbound routes * Finished outboudn routes resource * Ran linter and added exporter * Added api to doc * Added caching * Fixed small bug * Made requested changes * Fixed go version * No jira: fix dev (#1059) * removed ref to old sdk * logging outbound route export error instead of failing * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.2 to 0.19.3 (#1062) Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.2 to 0.19.3. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.2...v0.19.3) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Cache for Data Sources (#1064) * Cache for Data Sources * fix context issue during actual run * DEVTOOLING-603: Media recording poilicies missing from export (#1063) * Caling api manually instead of using sdk * Small change to data source * Bump golang.org/x/net from 0.25.0 to 0.26.0 (#1072) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.25.0 to 0.26.0. - [Commits](https://github.com/golang/net/compare/v0.25.0...v0.26.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.3 to 0.19.4 (#1073) Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.3 to 0.19.4. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.3...v0.19.4) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Feat/devtooling 610 (#1065) * added data source for routing email route * added data source files * changes for name to pattern * updated docs * conflicts resolved * comments resolved for feat/DEVTOOLING-610 * Fixing Tests By removing unsupported arguments (#1070) * Fixing test (#1074) * Refactor/devtooling 156 (#1060) * idp_adfs refactoring * made changes for the getalladfs func * error handling changes * changes done according to unrefractor resource * changes return type * did changes for test idp_adfs * bug fixes * resolved comments * resolved comments * resolved comments * Bug/devtooling 584 (#1071) * Cache for Data Sources * fix context issue during actual run * pushing changes * removed debugging logger * addressed PR changes * updated note * resolved merge conflicts --------- Co-authored-by: HemanthDogiparthi12 Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * fix api call strategy (#1075) * [JM-1457]: Add resource for journey views (#1067) * Merging dev to main for v1.39.0 (#1061) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 (#1008) * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.1 to 0.19.2. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.1...v0.19.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * ran go generate --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * DEVTOOLING-352 - provider oauth credential rate limit exceeded (#1004) * Testing something * Adding retry * Fixed retry * Moved functionality to retries package * Fixed inport cycle * Extending sleep * Added retry to AuthorizeSdk * Using with retries * Remving old function * Feat/devtooling 461 - WithRetries errors include improved logging (#1012) * calling diag func * Changed retryable functions to call Diagnostic function * Converted all withRetries errors to have improved wrapper * Made requested Changes * fixing unit test * Bump golang.org/x/net from 0.23.0 to 0.25.0 (#1017) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.25.0. - [Commits](https://github.com/golang/net/compare/v0.23.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix for issue 993 : Changed message_column to optional and add verification logic (#1013) * Changed message_column to optional and add verification logic * applied safer nil value handling * go generate (#1018) * bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1015) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Revert "bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1…" (#1019) This reverts commit 3ff66d472071905b18b4f66f6ee4b3d3725600e7. * bug/devtooling 560 - CX as Code crash when creating phones (#1020) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Made requested Change * feat/devtooling 579 - Improved Logging for Non-API errors (#1021) * Adding improved non-api diag errors * Pulling Merged PR * Added improved error * Added more logging * Ran go vet * Updated docs * Bump hashicorp/setup-terraform from 3.1.0 to 3.1.1 (#1024) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bug/devtooling 362 - Evaluation forms incorrectly assigning published attribute (#1022) * Correctly sets published feature * Added functionality to set published field correctly * Fixed docs * Bug/devtooling 444: Custom resolver function for outbound campaign script_id (#1014) * Resolving campaign script_id to default outbound script data source when appropriate * Created constants package * editing scripts proxy so that the datasource catches Default scripts * Finished writing tests for new campaign field custom resolver * Fixed linting errors in campaigns package * implemented caching for campaigns exporter * minor changes to a comment * Add deleteCacheItem func + some refactoring work * Refactoring call to resolveToDataSource function and added unit test * Fixing script data source test * Bump github.com/nyaruka/phonenumbers from 1.3.4 to 1.3.5 (#1026) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.4 to 1.3.5. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.4...v1.3.5) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Devtooling-162: Refactored idp salesforce (#999) * Refactored idp salesforce * Fixing docs * Changed function name * Removed original file * Changed Build Function Call to fix type difference (#1029) * fixing test for published attribute (#1030) * No jira: fixing up a few acceptance tests (#1031) * fixed journey segment update * Adding check to journey segment tests to validate is feature is supported * preventing panic in export helper function * Adding sleep to milestone data source test * Cleaning up fmt.Print statements appearing in export tests * undoing changes to segment resource file * Fix routing queue (#1028) * README update (#1025) * Pre-verify if the tfState is in sync with the exporter (#1027) * Add state comapartors * Upddate review comments * Devtooling-591: Consistency Checker Refactor (#1032) * Moved where consistency checker is created in resources * Cleaned up consitency checker file * Added resource name to message * Conditionally adding name * Made requested changes * Feature/devtooling 589 1 (#1035) * update doc * fix reviews * Fix acceptance tests - TCA and Prod (#1033) * Fix edge,export,script test,Jenkin to run tca&prod * Fix export & integration tests * Fix auth tests Fix auth tests * fix tests * resolve conflicts * move assignregion func, remove commented function modify to return empty string - assignregion func return default region --------- Co-authored-by: Monisha Padmavathi Ragavan * Bug/devtooling 597 - Routing email route test failing (#1039) * Added call to cleanup function * linter * adding hotfix to pr labeler config file (#1042) * bug/DEVTOOLING-436 - Added cleanup function for webdeployments resources (#1038) * Added cleanup function for webdeployments resources * fixing conflict * Made requested changes * Made requested changes * Bump github.com/hashicorp/terraform-plugin-sdk/v2 from 2.33.0 to 2.34.0 (#1047) Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.33.0 to 2.34.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.33.0...v2.34.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bug/devtooling 287 temp disable cchecker (#1037) * removed consistency checker * changed DID number * phoneUpdated * Merging dev to main for v1.38.0 (#1036) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to rou… * Fixes #1078 (#1079) * Coverage Report and fixing tests (#1080) * Report generation generate report generate report * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests * fix tests * fix tests fix tests fix tests * fix tests * fix report * fix report * fix tests fix tests * Bump github.com/hashicorp/terraform-plugin-sdk/v2 from 2.33.0 to 2.34.0 (#1047) Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.33.0 to 2.34.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.33.0...v2.34.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bug/devtooling 287 temp disable cchecker (#1037) * removed consistency checker * changed DID number * phoneUpdated * Merging dev to main for v1.38.0 (#1036) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 (#1008) * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.1 to 0.19.2. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.1...v0.19.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * ran go generate --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * DEVTOOLING-352 - provider oauth credential rate limit exceeded (#1004) * Testing something * Adding retry * Fixed retry * Moved functionality to retries package * Fixed inport cycle * Extending sleep * Added retry to AuthorizeSdk * Using with retries * Remving old function * Feat/devtooling 461 - WithRetries errors include improved logging (#1012) * calling diag func * Changed retryable functions to call Diagnostic function * Converted all withRetries errors to have improved wrapper * Made requested Changes * fixing unit test * Bump golang.org/x/net from 0.23.0 to 0.25.0 (#1017) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.25.0. - [Commits](https://github.com/golang/net/compare/v0.23.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix for issue 993 : Changed message_column to optional and add verification logic (#1013) * Changed message_column to optional and add verification logic * applied safer nil value handling * go generate (#1018) * bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1015) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Revert "bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1…" (#1019) This reverts commit 3ff66d472071905b18b4f66f6ee4b3d3725600e7. * bug/devtooling 560 - CX as Code crash when creating phones (#1020) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Made requested Change * feat/devtooling 579 - Improved Logging for Non-API errors (#1021) * Adding improved non-api diag errors * Pulling Merged PR * Added improved error * Added more logging * Ran go vet * Updated docs * Bump hashicorp/setup-terraform from 3.1.0 to 3.1.1 (#1024) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bug/devtooling 362 - Evaluation forms incorrectly assigning published attribute (#1022) * Correctly sets published feature * Added functionality to set published field correctly * Fixed docs * Bug/devtooling 444: Custom resolver function for outbound campaign script_id (#1014) * Resolving campaign script_id to default outbound script data source when appropriate * Created constants package * editing scripts proxy so that the datasource catches Default scripts * Finished writing tests for new campaign field custom resolver * Fixed linting errors in campaigns package * implemented caching for campaigns exporter * minor changes to a comment * Add deleteCacheItem func + some refactoring work * Refactoring call to resolveToDataSource function and added unit test * Fixing script data source test * Bump github.com/nyaruka/phonenumbers from 1.3.4 to 1.3.5 (#1026) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.4 to 1.3.5. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.4...v1.3.5) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Devtooling-162: Refactored idp salesforce (#999) * Refactored idp salesforce * Fixing docs * Changed function name * Removed original file * Changed Build Function Call to fix type difference (#1029) * fixing test for published attribute (#1030) * No jira: fixing up a few acceptance tests (#1031) * fixed journey segment update * Adding check to journey segment tests to validate is feature is supported * preventing panic in export helper function * Adding sleep to milestone data source test * Cleaning up fmt.Print statements appearing in export tests * undoing changes to segment resource file * Fix routing queue (#1028) * README update (#1025) * Pre-verify if the tfState is in sync with the exporter (#1027) * Add state comapartors * Upddate review comments * Devtooling-591: Consistency Checker Refactor (#1032) * Moved where consistency checker is created in resources * Cleaned up consitency checker file * Added resource name to message * Conditionally adding name * Made requested changes * Feature/devtooling 589 1 (#1035) * update doc * fix reviews --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * NO-JIRA: Fixing nil pointer in consistency checker (#1041) * Fixed nil pointer in consistency checker * Fixed a few more nil pointers * Fixing nil pointer (#1045) * merged with dev --------- Signed-off-by: dependabot[bot] Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * Fixing up provider docs (#1046) * fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * Package wise coverage report * Package wise coverage report * fix tests * fix tests * fix tests * fix tests * fix tests * fix tests * Modify coverage report to list all data * Display coverage report, data in same page * fix newly added tests * fix newly added tests * fix user tests * fix failing tests * Cache for Data Sources (#1064) * Cache for Data Sources * fix context issue during actual run * fix tests Fix failing tests fix tests * Add didpool for phoneresource * fix tests * fix tests * modify logging modify logging modify logging modify logging --------- Signed-off-by: dependabot[bot] Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> * fixing go vet warnings/errors (#1081) * refactored idp_okta resource (#1069) * refactored idp_okta resource * updated the docs * comments resolved * comments resolved * ran go generate * updated docs and bug fix * fix update issues for workType (#1076) * fix update issues for workType * Delete genesyscloud/task_management_worktype/WorkType.go * Fix caching issue (#1082) * Fix caching issue * fix docs * Feature/fix unit tests (#1090) * Update worktype * fix test case * fix exporter crash (#1101) * fix exporter crash problem * review comment * added caching capabilities (#1088) * Update Description (#1104) * [JM-1466]: Upgrade the platform client version (#1100) * [JM-1457]: Add resource for journey views * [JM-1457]: import journey view as variable in main.go * [JM-1457]: Remove print statements * [JM-1457]: Refactor code * Remove default values from optional fields * [JM-1457]: Refactor and generate the doc * Remove default value from eventCountType * [JM-1457]: Filter should be nil if not given * Merge with dev * [JM-1457]: Filter should be nil if not given * [JM-1466]: Upgrade platform client version --------- Co-authored-by: Mohammed Islam * Devtooling 501: Removing support for v1 and v1-http widget deployments (#1097) * Updated widget_deployment schema to reflect API changes * updated example widget deployment resource * Removed old client_config field from schema and fixed data source test * Returned client_config field and marked it as deprecated * refactor/Tidy up journey_segment resource tests/doc (#1103) * Fix issues identified in DEVTOOLING-662 as a result of testing DEVTOOLING-477 (#1109) * Updating docs (#1110) * feat/devtooling 71: Outbound contact list contact resource (#1084) * Creating contact_list_contact resource * Defined contact list contact resource schema * Defined more boiler plate code for contact package + started working on create func * implemented read function for contact resource * finished crud operations and started testing * Refactored calls to GenerateMap test util function * Necessary refactoring to get contact test passing * extending contact_list_contact tests * Removed id field from schema + added example data * go generate * Adding contact_list_contact exporter * Updated gc sdk version and finished contact exporter * finishing contact exporter * DEVTOOLING-643 : Adds support for using sanitized names in export. (#1106) * Adds support for using sanitized names in export. This allows you to copy the names from the results of an export and reuse them as include/exclude filters in a new export * Fix Typo * Fix quotes * Bug/devtooling 659 (#1108) * added nil check * added nil check for line properties * Bump github.com/hashicorp/hcl/v2 from 2.20.1 to 2.21.0 (#1113) Bumps [github.com/hashicorp/hcl/v2](https://github.com/hashicorp/hcl) from 2.20.1 to 2.21.0. - [Release notes](https://github.com/hashicorp/hcl/releases) - [Changelog](https://github.com/hashicorp/hcl/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/hcl/compare/v2.20.1...v2.21.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/hcl/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Feat/devtooling 187 - Refactor routing settings (#1089) * Refactored Routing Settings * Added missing attributes to schema * Removed data source * Made requested Changes * Fixing merge conflicts * DEVTOOLING-601: Queue member assignment taking long time (#1107) * Sped up member assignment * Used diag error wrapper * Fixes #1086 + some minor refactoring (#1111) * Feat/devtooling 618 (#1083) * code for compression * added compression logic in generateoutput func * added fields compress and passphrase * removed passphrase flag * updated docs * moved the compression logic to a function * added test case for compress flag * comments resolved * updated docs * resolved comments * commenting RefAttr in trunkbasesettings exporter to fix unit test (#1115) * Merge unit tests & fix failing testcases (#1116) * run unit tests * run unit tests * add unit test * Fix failing tests * fix failed tests * Fix failing tests * Fix webdeployment testcases * Fix webdeployment testcases * Run remaining unit tests * Revert export changes * Fix export tests * Fix widget tests * Modify to delete list of didpool --------- Co-authored-by: Monisha Padmavathi Ragavan * onholdprompt attribute added along with test case (#1114) * refactor/Devtooling-190 [routing_utilization] + Devtooling-400 [routing_utilization_label] (#1105) * Refactored but waiting for cyclic dependency removal * refactor routing utilization label * Tidy up * Updated docs * fixing naming convention in tf_export * fixing user test * Requested changes * fixing merge conflicts * Refactored but waiting for cyclic dependency removal * refactor routing utilization label * Tidy up * Updated docs * fixing naming convention in tf_export * fixing user test * fixing merge * fixing docs * Made requested changes * changes * fixing tests * refactor/DEVTOOLING-158 idp_gsuite (#1099) * refactored idp_gsuite * removed references of data source * deleted unrefactored files * changed references * resolved comments * added name, slo_uri, slo_binding to idp_gsuite * Refactor/devtooling 160 idp_ping (#1102) * refactored idp_ping * updated docs * deleted unrefactored files * comments resolved * resolved conflicts * added name, slo_uri and slo_binding * Refactor/devtooling 157 - idp_generic (#1095) * refactoring of idp_generic * deleted original files * removed references of datasource * resolved comments * comments resolved * added slo_uri and slo_binding to idp_generic --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * Cleanup/Remove utilization label availability check / mentions of feature not being available (#1117) * Bug/devtooling 681 - New attributes for IDP (#1122) * Merge Dev to Main for Release v1.41.0 (#1118) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 (#1008) * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.1 to 0.19.2. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.1...v0.19.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * ran go generate --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * DEVTOOLING-352 - provider oauth credential rate limit exceeded (#1004) * Testing something * Adding retry * Fixed retry * Moved functionality to retries package * Fixed inport cycle * Extending sleep * Added retry to AuthorizeSdk * Using with retries * Remving old function * Feat/devtooling 461 - WithRetries errors include improved logging (#1012) * calling diag func * Changed retryable functions to call Diagnostic function * Converted all withRetries errors to have improved wrapper * Made requested Changes * fixing unit test * Bump golang.org/x/net from 0.23.0 to 0.25.0 (#1017) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.25.0. - [Commits](https://github.com/golang/net/compare/v0.23.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix for issue 993 : Changed message_column to optional and add verification logic (#1013) * Changed message_column to optional and add verification logic * applied safer nil value handling * go generate (#1018) * bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1015) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Revert "bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1…" (#1019) This reverts commit 3ff66d472071905b18b4f66f6ee4b3d3725600e7. * bug/devtooling 560 - CX as Code crash when creating phones (#1020) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Made requested Change * feat/devtooling 579 - Improved Logging for Non-API errors (#1021) * Adding improved non-api diag errors * Pulling Merged PR * Added improved error * Added more logging * Ran go vet * Updated docs * Bump hashicorp/setup-terraform from 3.1.0 to 3.1.1 (#1024) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bug/devtooling 362 - Evaluation forms incorrectly assigning published attribute (#1022) * Correctly sets published feature * Added functionality to set published field correctly * Fixed docs * Bug/devtooling 444: Custom resolver function for outbound campaign script_id (#1014) * Resolving campaign script_id to default outbound script data source when appropriate * Created constants package * editing scripts proxy so that the datasource catches Default scripts * Finished writing tests for new campaign field custom resolver * Fixed linting errors in campaigns package * implemented caching for campaigns exporter * minor changes to a comment * Add deleteCacheItem func + some refactoring work * Refactoring call to resolveToDataSource function and added unit test * Fixing script data source test * Bump github.com/nyaruka/phonenumbers from 1.3.4 to 1.3.5 (#1026) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.4 to 1.3.5. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.4...v1.3.5) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Devtooling-162: Refactored idp salesforce (#999) * Refactored idp salesforce * Fixing docs * Changed function name * Removed original file * Changed Build Function Call to fix type difference (#1029) * fixing test for published attribute (#1030) * No jira: fixing up a few acceptance tests (#1031) * fixed journey segment update * Adding check to journey segment tests to validate is feature is supported * preventing panic in export helper function * Adding sleep to milestone data source test * Cleaning up fmt.Print statements appearing in export tests * undoing changes to segment resource file * Fix routing queue (#1028) * README update (#1025) * Pre-verify if the tfState is in sync with the exporter (#1027) * Add state comapartors * Upddate review comments * Devtooling-591: Consistency Checker Refactor (#1032) * Moved where consistency checker is created in resources * Cleaned up consitency checker file * Added resource name to message * Conditionally adding name * Made requested changes * Feature/devtooling 589 1 (#1035) * update doc * fix reviews * Fix acceptance tests - TCA and Prod (#1033) * Fix edge,export,script test,Jenkin to run tca&prod * Fix export & integration tests * Fix auth tests Fix auth tests * fix tests * resolve conflicts * move assignregion func, remove commented function modify to return empty string - assignregion func return default region --------- Co-authored-by: Monisha Padmavathi Ragavan * Bug/devtooling 597 - Routing email route test failing (#1039) * Added call to cleanup function * linter * adding hotfix to pr labeler config file (#1042) * bug/DEVTOOLING-436 - Added cleanup function for webdeployments resources (#1038) * Added cleanup function for webdeployments resources * fixing conflict * Made requested changes * Made requested changes * Bump github.com/hashicorp/terraform-plugin-sdk/v2 from 2.33.0 to 2.34.0 (#1047) Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.33.0 to 2.34.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.33.0...v2.34.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bug/devtooling 287 temp disable cchecker (#1037) * removed consistency checker * changed DID number * phoneUpdated * Merging dev to main for v1.38.0 (#1036) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cach… * Chore/Bump platform-client-sdk-go to v133 (#1119) * feat/COBROWSE-2427 pause field added (#1121) * updated version to 133 * pause_criteria changes done * reveted back go.mod * changed description * changed description * one more change * merged dev * crazy merge conflicts * made changes based on review * go.mod changed * more changes after review --------- Co-authored-by: ivan * go mod tidy (#1126) * added validation for ja-JP (#1127) * Cleanup/Use sdk to deal with utilization instead of direct public-api calls (#1123) * Fixes DEVTOOLING-674 by allowing the sanitizeMap function to continue processing as sanitizeE164Number and sanitizeRrule functions could return empty strings. If they do, we want to filter them out (further down the sanitizeMap function) unless they are explicitly marked to be kept by the AllowForZeroValues config to be set (#1128) * Add `make` command for generating docs (#1134) * Update latest language codes (#1130) * Pull in latest language codes from the API schema. See values available in dropdown for language field in API Explorer https://apicentral.genesys.cloud/api-explorer\#post-api-v2-knowledge-knowledgebases and https://apicentral.genesys.cloud/api-explorer\#post-api-v2-knowledge-knowledgebases--knowledgeBaseId--languages--languageCode--categories * Pull the language code logic out into its own validator function * Fixed export for teams (#1140) * Cleanup/Use sdk instead of direct calls to user utilization (#1136) * Refactor/devtooling 161 refactor idp_onelogin (#1125) * Merge Dev to Main for Release v1.41.0 (#1118) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 (#1008) * Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.19.1 to 0.19.2. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.19.1...v0.19.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * ran go generate --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * DEVTOOLING-352 - provider oauth credential rate limit exceeded (#1004) * Testing something * Adding retry * Fixed retry * Moved functionality to retries package * Fixed inport cycle * Extending sleep * Added retry to AuthorizeSdk * Using with retries * Remving old function * Feat/devtooling 461 - WithRetries errors include improved logging (#1012) * calling diag func * Changed retryable functions to call Diagnostic function * Converted all withRetries errors to have improved wrapper * Made requested Changes * fixing unit test * Bump golang.org/x/net from 0.23.0 to 0.25.0 (#1017) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.25.0. - [Commits](https://github.com/golang/net/compare/v0.23.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix for issue 993 : Changed message_column to optional and add verification logic (#1013) * Changed message_column to optional and add verification logic * applied safer nil value handling * go generate (#1018) * bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1015) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Revert "bug/devtooling 560 - Nil error in telephony_providers_edges_phone (#1…" (#1019) This reverts commit 3ff66d472071905b18b4f66f6ee4b3d3725600e7. * bug/devtooling 560 - CX as Code crash when creating phones (#1020) * Removed Print Statement that throws Nil error and added random id to test to prevent failing * golint changes made * Made requested Change * feat/devtooling 579 - Improved Logging for Non-API errors (#1021) * Adding improved non-api diag errors * Pulling Merged PR * Added improved error * Added more logging * Ran go vet * Updated docs * Bump hashicorp/setup-terraform from 3.1.0 to 3.1.1 (#1024) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bug/devtooling 362 - Evaluation forms incorrectly assigning published attribute (#1022) * Correctly sets published feature * Added functionality to set published field correctly * Fixed docs * Bug/devtooling 444: Custom resolver function for outbound campaign script_id (#1014) * Resolving campaign script_id to default outbound script data source when appropriate * Created constants package * editing scripts proxy so that the datasource catches Default scripts * Finished writing tests for new campaign field custom resolver * Fixed linting errors in campaigns package * implemented caching for campaigns exporter * minor changes to a comment * Add deleteCacheItem func + some refactoring work * Refactoring call to resolveToDataSource function and added unit test * Fixing script data source test * Bump github.com/nyaruka/phonenumbers from 1.3.4 to 1.3.5 (#1026) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.4 to 1.3.5. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.4...v1.3.5) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Devtooling-162: Refactored idp salesforce (#999) * Refactored idp salesforce * Fixing docs * Changed function name * Removed original file * Changed Build Function Call to fix type difference (#1029) * fixing test for published attribute (#1030) * No jira: fixing up a few acceptance tests (#1031) * fixed journey segment update * Adding check to journey segment tests to validate is feature is supported * preventing panic in export helper function * Adding sleep to milestone data source test * Cleaning up fmt.Print statements appearing in export tests * undoing changes to segment resource file * Fix routing queue (#1028) * README update (#1025) * Pre-verify if the tfState is in sync with the exporter (#1027) * Add state comapartors * Upddate review comments * Devtooling-591: Consistency Checker Refactor (#1032) * Moved where consistency checker is created in resources * Cleaned up consitency checker file * Added resource name to message * Conditionally adding name * Made requested changes * Feature/devtooling 589 1 (#1035) * update doc * fix reviews * Fix acceptance tests - TCA and Prod (#1033) * Fix edge,export,script test,Jenkin to run tca&prod * Fix export & integration tests * Fix auth tests Fix auth tests * fix tests * resolve conflicts * move assignregion func, remove commented function modify to return empty string - assignregion func return default region --------- Co-authored-by: Monisha Padmavathi Ragavan * Bug/devtooling 597 - Routing email route test failing (#1039) * Added call to cleanup function * linter * adding hotfix to pr labeler config file (#1042) * bug/DEVTOOLING-436 - Added cleanup function for webdeployments resources (#1038) * Added cleanup function for webdeployments resources * fixing conflict * Made requested changes * Made requested changes * Bump github.com/hashicorp/terraform-plugin-sdk/v2 from 2.33.0 to 2.34.0 (#1047) Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.33.0 to 2.34.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.33.0...v2.34.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bug/devtooling 287 temp disable cchecker (#1037) * removed consistency checker * changed DID number * phoneUpdated * Merging dev to main for v1.38.0 (#1036) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports * Feat/add flow log level resource (#948) * add code changes * add flow log level changes * testing commit * getting there, have a create test together * still trying to get a passing test * tests have passed! but getting the plan was not empty errors now * flow log level test * finally got tests passing * remove debug logging * rerun go generate * rerun go generate * apply suggestions from PR review * address PR review * remove characteristics * address PR comments * return total flow log levels when no more are found --------- Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> * NO-JIRA: Small Change to flow log level (#984) * Small Change to flow log level * Fixing typo * Merge hotfix changes on main into dev (#983) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (#992) * Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.18.0 to 0.19.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.18.0...v0.19.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-docs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * rerunning go generate after tf-docs package upgrade --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charlie Conneely * Devtooling 432: Conditonal Group Routing (#970) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Added CGR and toggle * Fixed some errors * Added queue proxy to CGR * Added toggle to get all * Made some changes * Added CGR toggle package * Moved CGR toggle package * Ran linter * Checking queue id in tests * Small change * bug/Devtooling-458: media retention policy creation failing with error on time interval (#980) * added checks * Checks for time interval attributes * Fixing TimeInterval * Added BuildFunc for timeInterval * Added returned errors for invalid time Interval * Fixed buildFunctions * Generate Docs * Fixed exporter * Getting rid of go vet warning about copying a lock value to a variable (#991) * No jira: util function for getting cursor value from next uri (#990) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added cache to routing queue * Added proxy and caching to routing queue * Removed log * Add consistency checker back * Fix group cache * Fix Export cyclic deps (#968) * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Feat/devtooling-177: Refactored orgAuthorization_pairing (#975) * refactored orgauthorization_pairing * Added exporter for response management response asset * Added refactor label to pr-labeler-config * Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (#969) * adding getALl functionality * adding exporter * adding export * Added getAll functionality * Update go.mod * Added Caching * Added file_content_hash * Fixed test * using resource mutexes in init_test files & linting errors (#973) * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Feature/devtooling 63 (#978) * Fix exports --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix Exporter for non-flow resources (#982) * Fix Exporter for non-flow resources * Added check (#981) * Made function for parsing cursor from next uri --------- Signed-off-by: dependabot[bot] Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles * Fix acceptance tests (#979) * fix acceptance test fix test fix test fix test fix test fix tests fix tests fix tests fix tests fix tests fix test fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix routing test fix tests fix tests restore files fix team test * fix comments * fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests fix tests * fix tests fix tests fix tests * fix tests * fix conditional routing test fix conditional routing test --------- Co-authored-by: Monisha Padmavathi Ragavan * Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (#995) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/setup-terraform/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Improvise exclude attributes to Regex (#988) * Fix Media call back Read Attributes (#987) * DEVTOOLING-445: User Roles not returning duplicate roles (#989) * NO-JIRA-Upgrading-Go-SDK * Fixed errors * Fixed conditional group routing * Fixed some tests * feat/Devtooling 496: Routing queue Outbound email address independent resource (#954) * Added routing_queue_conditional_group_routing resource * Rebased * Removed accidental commits * Rebased and fixed errors * Added evaluated_queue_id * Fixed some things * Added CGR and toggle * Made some changes * Added CGR toggle package * Moved CGR toggle package * Feature/devtooling 63 (#974) * Introduce new Elements * Update Attribs * Introduce scoring Method * Upgrade ssdk * remove unwanted logs * Routing queue outbound email address package * Made changes * Added tests * Added more to test * Fixed test * Finished resource * Finished resource * Made some requested changes * Added feature toggle stuff * Added feature toggle * Made changes * Fixing change in queue exporter --------- Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> * bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (#996) * Fixing null export * Fixing Test * Added check for export * Added attribute and fixed test * Removed Computed attribute * Added check for reschedule_time_zone_skipped_contacts in test * Update Export Guide (#971) * update export uide * update tf_export.md and resource.tf * cross check resource.tf and schema, add missing attributes * update * update export.md.tmp * Removed duplicate paragraph and ran go generate --------- Co-authored-by: Charlie Conneely * NO-JIRA: Fixing dev (#1000) * Fixing dev * Fixes some errors * Fixing flow outcome description (#998) * Devtooling 561 - Members not being added correctly to teams (#1001) * Fixed bug * Fixed problem deleting members * Removed print * Fix Version Problem in WebDeployments (#997) * Fix Version Problem in WebDeployments * Add test cases * Fix review comments * no jira: Fixing merge conflicts on dev branch (#1009) * moving changes (#960) * Revert "moving changes (#960)" (#963) This reverts commit 70d8a8036c52ae2f91aee081fe0d1c4c5451a58f. * Release Merge to Main (#977) * Bump golang.org/x/net from 0.22.0 to 0.23.0 (#951) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add team to custom resolver (#950) * Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (#921) * Added routing_queue_conditional_group_routing resource * Rebased * Fixed routing queue tests * Removed accidental commits * Rebased and fixed errors * Made some requested changes * Added evaluated_queue_id * Added warning * Fixed some things * Fixed test * Fixing exporter * Fixed type * Changing target branch of dependabot PRs to dev (#956) * Fix User Resource Panics (#949) * moving changes (#964) * Reverting conditional group routing resoure (#965) * Remove use_supported_content_profile (#962) * bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (#953) * Allow Multiple inputs for BYMONTHDAY and BYMONTH * Update go.mod * Added Error Message to Validator * Bug/devtooling-530: Fixing panic during export caused by MemberGroupsResolver (#957) * Changing groups.owner_ids to optional and computed * Preventing panic inside MemberGroupsResolver with some refactoring * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag… (#946) * DEVTOOLING-417: Removed the go:generate git restore docs/index.md tag. This is pulling the index.md out of git hub and overriding what ever is being generated. * DEVTOOLING-417: Fixed a mispelling in a package alias * DEVTOOLING-417 Accidently added cache code * avoiding infinite loop in flow data source read (#966) * feat/Devtooling-448 oauth cred cache (#945) * DEVTOOLING-448: Initial commit of code * DEVTOOLING-448: Added caching while creating a Genesys Cloud OAuth Client specific so we dont have to force the user embed a secret * DEVTOOLING-448: Refactored retrieveCachedOauthClientSecret code * DEVTOOLING-448: Committing interm work * DEVTOOLING-448: Reworked how we handle the addition of roles for user credentials * DEVTOOLING-448: Removed the ToPtrStr function * Fixing go.mod and running go generate (#967) * feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (#959) * added buildDiag function p1 * Adding call to BuildApiDiag * BuildAPIDiag functions added * Added util.BuildAPIDiag function to refactored resources * Added call to BuildAPIDiag in resources * Update go.mod * Fixed tests * Update go.mod * Added err * Added err * Update go.mod * Requested Changes * Fix for BotFlows dependencies (#961) * feat/Devtooling-531: Add proxy and cache to routing queue (#958) * Added ca… * feature/devtooling 608 (#1124) * added schema * added line properties * updated and flatten function * changed to station remote address * pushing changes * regenerated docs * added remote if statement for remote address * line and remote address are mutually exclusive * fixed nil pointer deref on error * synced documents * added continue statement to prevent deref of nil pointer * Feat/More validation in utilization label names (#1143) * Fix DEVTOOLING-703 (#1144) * Fix DEVTOOLING-703 * Add unit test for isQueueEmailAddressEmpty() * Bump golang.org/x/net from 0.26.0 to 0.27.0 (#1146) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.26.0 to 0.27.0. - [Commits](https://github.com/golang/net/compare/v0.26.0...v0.27.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Feat/devtooling-645: Add roles_enabled to group resource (#1145) * Added roles_enabled to group * Added rolesEnabled to test * Requested changes * Bug/Devtooling-677: Error Migrating routes to independent resource (#1132) * Fixing conflict * Remove Duplicate imports * adding missing return statement in utils function (#1148) * feat/GPE-14463 add support for App stream type on Journey resources (#1147) When configuring Journey resources like segments, outcomes or action maps, it is now possible to use App stream type. Also, the documentation around supported session types was updated, to specify the allowed values. --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: HemanthDogiparthi12 <127493303+HemanthDogiparthi12@users.noreply.github.com> Co-authored-by: dginty4 <108797778+dginty4@users.noreply.github.com> Co-authored-by: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Co-authored-by: kavinbalagen <150852268+kavinbalagen@users.noreply.github.com> Co-authored-by: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Co-authored-by: carnellj-genesys <109529583+carnellj-genesys@users.noreply.github.com> Co-authored-by: BrianMoyles Co-authored-by: ben-howarth-genesys <164904178+ben-howarth-genesys@users.noreply.github.com> Co-authored-by: Charlie Conneely Co-authored-by: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Co-authored-by: Monisha Padmavathi Ragavan Co-authored-by: jenissabarrera <50225452+jenissabarrera@users.noreply.github.com> Co-authored-by: Taisuk Choi <131831426+TaisukChoi@users.noreply.github.com> Co-authored-by: sureshperiyappan <61573777+sureshperiyappan@users.noreply.github.com> Co-authored-by: willjeuniaux-genesys <153622483+willjeuniaux-genesys@users.noreply.github.com> Co-authored-by: Will <37446330+williamjeuniaux@users.noreply.github.com> Co-authored-by: Ivan Mikhalchenko Co-authored-by: ivan Co-authored-by: HemanthDogiparthi12 Co-authored-by: Majharul Islam Rafat Co-authored-by: Mohammed Islam Co-authored-by: tsantos-genesys <154342374+tsantos-genesys@users.noreply.github.com> Co-authored-by: Brian Goad Co-authored-by: michalk-genesys --- GNUmakefile | 5 +- README.md | 32 +- docs/resources/group.md | 1 + docs/resources/idp_adfs.md | 2 +- docs/resources/idp_generic.md | 2 + docs/resources/idp_gsuite.md | 3 + docs/resources/idp_onelogin.md | 6 +- docs/resources/idp_ping.md | 3 + docs/resources/journey_action_map.md | 4 +- docs/resources/journey_outcome.md | 4 +- docs/resources/journey_segment.md | 4 +- docs/resources/routing_utilization.md | 2 +- docs/resources/routing_utilization_label.md | 4 +- .../telephony_providers_edges_phone.md | 11 +- .../resources/webdeployments_configuration.md | 14 + .../resource.tf | 4 + ...source_genesyscloud_architect_datatable.go | 2 +- ...source_genesyscloud_architect_datatable.go | 2 +- ..._genesyscloud_architect_datatable_proxy.go | 2 +- ...e_genesyscloud_architect_datatable_test.go | 2 +- ...esyscloud_architect_datatable_row_utils.go | 2 +- ...ce_genesyscloud_architect_datatable_row.go | 2 +- ...esyscloud_architect_datatable_row_proxy.go | 5 +- ...nesyscloud_architect_datatable_row_test.go | 2 +- ...syscloud_architect_emergencygroup_proxy.go | 3 +- ...e_genesyscloud_architect_emergencygroup.go | 2 +- ...esyscloud_architect_emergencygroup_test.go | 2 +- ...syscloud_architect_emergencygroup_utils.go | 2 +- ...ource_genesyscloud_architect_flow_proxy.go | 3 +- .../resource_genesyscloud_flow.go | 2 +- .../resource_genesyscloud_flow_test.go | 2 +- .../genesyscloud_architect_grammar_proxy.go | 2 +- ...resource_genesyscloud_architect_grammar.go | 2 +- ...rce_genesyscloud_architect_grammar_test.go | 2 +- ...scloud_architect_grammar_language_proxy.go | 2 +- ...genesyscloud_architect_grammar_language.go | 2 +- ...yscloud_architect_grammar_language_test.go | 2 +- ...scloud_architect_grammar_language_utils.go | 2 +- ..._source_genesyscloud_architect_ivr_test.go | 2 +- .../genesyscloud_architect_ivr_proxy.go | 2 +- ...esyscloud_architect_ivr_proxy_unit_test.go | 2 +- .../resource_genesyscloud_architect_ivr.go | 2 +- ...esource_genesyscloud_architect_ivr_test.go | 2 +- ...ce_genesyscloud_architect_ivr_unit_test.go | 2 +- ...source_genesyscloud_architect_ivr_utils.go | 2 +- ...syscloud_architect_schedulegroups_proxy.go | 3 +- ...e_genesyscloud_architect_schedulegroups.go | 2 +- ...esyscloud_architect_schedulegroups_test.go | 2 +- .../genesyscloud_architect_schedules_proxy.go | 2 +- ...source_genesyscloud_architect_schedules.go | 2 +- ...e_genesyscloud_architect_schedules_test.go | 2 +- ...enesyscloud_architect_user_prompt_proxy.go | 2 +- ...urce_genesyscloud_architect_user_prompt.go | 2 +- ...genesyscloud_architect_user_prompt_test.go | 2 +- ...enesyscloud_architect_user_prompt_utils.go | 2 +- .../data_source_genesyscloud_auth_role.go | 9 +- .../auth_role/genesyscloud_auth_role_proxy.go | 2 +- .../resource_genesyscloud_auth_role.go | 9 +- .../resource_genesyscloud_auth_role_test.go | 2 +- .../resource_genesyscloud_auth_role_utils.go | 2 +- ...genesyscloud_authorization_product_test.go | 2 +- ...enesyscloud_authorization_product_proxy.go | 2 +- ...source_genesyscloud_architect_schedules.go | 2 +- .../data_source_genesyscloud_auth_division.go | 2 +- ..._source_genesyscloud_auth_division_home.go | 2 +- ..._source_genesyscloud_journey_action_map.go | 2 +- ...ce_genesyscloud_journey_action_template.go | 2 +- ...ata_source_genesyscloud_journey_outcome.go | 2 +- ...ata_source_genesyscloud_journey_segment.go | 2 +- ..._source_genesyscloud_knowledge_category.go | 2 +- ...ce_genesyscloud_knowledge_knowledgebase.go | 12 +- ...ata_source_genesyscloud_knowledge_label.go | 2 +- .../data_source_genesyscloud_location.go | 2 +- ...ta_source_genesyscloud_organizations_me.go | 7 +- ...e_genesyscloud_quality_forms_evaluation.go | 2 +- ...ource_genesyscloud_quality_forms_survey.go | 2 +- ...ource_genesyscloud_routing_email_domain.go | 2 +- ..._genesyscloud_routing_email_domain_test.go | 2 +- ...ta_source_genesyscloud_routing_language.go | 2 +- .../data_source_genesyscloud_routing_skill.go | 2 +- ...source_genesyscloud_routing_skill_group.go | 9 +- ..._source_genesyscloud_routing_wrapupcode.go | 2 +- genesyscloud/data_source_genesyscloud_user.go | 2 +- ...a_source_genesyscloud_widget_deployment.go | 2 +- .../genesyscloud_dependent_consumer_proxy.go | 5 +- ...mance_externalmetrics_definitions_proxy.go | 3 +- ...performance_externalmetrics_definitions.go | 7 +- ...rmance_externalmetrics_definitions_test.go | 2 +- ...syscloud_externalcontacts_contact_proxy.go | 2 +- ...e_genesyscloud_externalcontacts_contact.go | 2 +- ...esyscloud_externalcontacts_contact_test.go | 2 +- ...syscloud_externalcontacts_contact_utils.go | 2 +- .../genesyscloud_flow_loglevel_proxy.go | 3 +- .../resource_genesyscloud_flow_loglevel.go | 2 +- ...esource_genesyscloud_flow_loglevel_test.go | 9 +- .../genesyscloud_flow_milestone_proxy.go | 2 +- .../resource_genesyscloud_flow_milestone.go | 2 +- ...source_genesyscloud_flow_milestone_test.go | 2 +- ...ource_genesyscloud_flow_milestone_utils.go | 2 +- .../genesyscloud_flow_outcome_proxy.go | 2 +- .../resource_genesyscloud_flow_outcome.go | 2 +- ...esource_genesyscloud_flow_outcome_utils.go | 2 +- .../data_source_genesyscloud_group_test.go | 2 +- .../group/genesyscloud_group_proxy.go | 3 +- .../group/resource_genesyscloud_group.go | 7 +- .../resource_genesyscloud_group_schema.go | 11 +- .../group/resource_genesyscloud_group_test.go | 6 +- .../resource_genesyscloud_group_utils.go | 5 +- .../genesyscloud_group_roles_proxy.go | 2 +- ...esource_genesyscloud_group_roles_schema.go | 2 +- ...resource_genesyscloud_group_roles_utils.go | 2 +- .../idp_adfs/genesyscloud_idp_adfs_proxy.go | 2 +- .../resource_genesyscloud_idp_adfs.go | 8 +- .../resource_genesyscloud_idp_adfs_schema.go | 2 +- .../resource_genesyscloud_idp_adfs_test.go | 47 ++- .../genesyscloud_idp_generic_proxy.go | 87 ++++++ .../resource_genesyscloud_idp_generic.go | 162 ++++++++++ ...urce_genesyscloud_idp_generic_init_test.go | 46 +++ ...esource_genesyscloud_idp_generic_schema.go | 130 ++++++++ .../resource_genesyscloud_idp_generic_test.go | 37 ++- .../genesyscloud_idp_gsuite_proxy.go | 88 ++++++ .../resource_genesyscloud_idp_gsuite.go | 156 ++++++++++ ...ource_genesyscloud_idp_gsuite_init_test.go | 46 +++ ...resource_genesyscloud_idp_gsuite_schema.go | 103 +++++++ .../resource_genesyscloud_idp_gsuite_test.go | 51 +++- .../idp_okta/genesyscloud_idp_okta_proxy.go | 2 +- .../resource_genesyscloud_idp_okta.go | 16 +- .../resource_genesyscloud_idp_okta_test.go | 65 +++- .../genesyscloud_idp_onelogin_proxy.go | 88 ++++++ .../resource_genesyscloud_idp_onelogin.go | 157 ++++++++++ ...rce_genesyscloud_idp_onelogin_init_test.go | 46 +++ ...source_genesyscloud_idp_onelogin_schema.go | 103 +++++++ ...resource_genesyscloud_idp_onelogin_test.go | 69 ++++- .../idp_ping/genesyscloud_idp_ping_proxy.go | 88 ++++++ .../resource_genesyscloud_idp_ping.go | 155 ++++++++++ ...esource_genesyscloud_idp_ping_init_test.go | 46 +++ .../resource_genesyscloud_idp_ping_schema.go | 103 +++++++ .../resource_genesyscloud_idp_ping_test.go | 51 +++- .../genesyscloud_idp_salesforce_proxy.go | 3 +- .../resource_genesyscloud_idp_salesforce.go | 9 +- ...source_genesyscloud_idp_salesforce_test.go | 2 +- .../genesyscloud_integration_proxy.go | 2 +- .../resource_genesyscloud_integration.go | 2 +- .../resource_genesyscloud_integration_test.go | 2 +- ...resource_genesyscloud_integration_utils.go | 2 +- .../genesyscloud_integration_action_proxy.go | 3 +- ...esource_genesyscloud_integration_action.go | 2 +- ...ce_genesyscloud_integration_action_test.go | 2 +- ...e_genesyscloud_integration_action_utils.go | 2 +- ...nesyscloud_integration_credential_proxy.go | 2 +- ...rce_genesyscloud_integration_credential.go | 2 +- ...enesyscloud_integration_credential_test.go | 2 +- ...ud_integration_custom_auth_action_proxy.go | 2 +- ...syscloud_integration_custom_auth_action.go | 2 +- ...oud_integration_custom_auth_action_test.go | 2 +- ...ud_integration_custom_auth_action_utils.go | 2 +- ...yscloud_journey_outcome_predictor_proxy.go | 3 +- ..._genesyscloud_journey_outcome_predictor.go | 2 +- ...syscloud_journey_outcome_predictor_test.go | 2 +- .../genesyscloud_journey_views_proxy.go | 3 +- .../resource_genesyscloud_journey_views.go | 9 +- ...esource_genesyscloud_journey_views_test.go | 9 +- ...source_genesyscloud_journey_views_utils.go | 5 +- .../resource_genesyscloud_oauth_client.go | 2 +- ...esource_genesyscloud_oauth_client_proxy.go | 2 +- ...esource_genesyscloud_oauth_client_utils.go | 2 +- ...ce_genesyscloude_oauth_client_unit_test.go | 2 +- ...anization_authentication_settings_proxy.go | 3 +- ...ud_organization_authentication_settings.go | 7 +- ...ation_authentication_settings_unit_test.go | 9 +- ...anization_authentication_settings_utils.go | 2 +- ...syscloud_orgauthorization_pairing_proxy.go | 2 +- ...e_genesyscloud_orgauthorization_pairing.go | 2 +- ...rce_genesyscloud_outbound_cattemptlimit.go | 2 +- ...genesyscloud_outbound_messagingcampaign.go | 2 +- ...yscloud_outbound_messagingcampaign_test.go | 2 +- ...genesyscloud_outbound_messagingcampaign.go | 2 +- ...yscloud_outbound_messagingcampaign_test.go | 2 +- ...urce_genesyscloud_outbound_attemptlimit.go | 2 +- ...urce_genesyscloud_outbound_attemptlimit.go | 2 +- ...genesyscloud_outbound_attemptlimit_test.go | 2 +- ...syscloud_outbound_callabletimeset_proxy.go | 2 +- ...e_genesyscloud_outbound_callabletimeset.go | 2 +- ...esyscloud_outbound_callabletimeset_test.go | 2 +- ...syscloud_outbound_callabletimeset_utils.go | 2 +- ..._outbound_callanalysisresponseset_proxy.go | 3 +- ...scloud_outbound_callanalysisresponseset.go | 9 +- ...d_outbound_callanalysisresponseset_test.go | 2 +- ..._outbound_callanalysisresponseset_utils.go | 5 +- ...enesyscloud_outbound_campaign_init_test.go | 2 +- .../genesyscloud_outbound_campaign_proxy.go | 2 +- ...resource_genesyscloud_outbound_campaign.go | 2 +- ...rce_genesyscloud_outbound_campaign_test.go | 2 +- ...ce_genesyscloud_outbound_campaign_utils.go | 2 +- ...urce_genesyscloud_outbound_campaignrule.go | 2 +- ...enesyscloud_outbound_campaignrule_proxy.go | 2 +- ...urce_genesyscloud_outbound_campaignrule.go | 2 +- ...genesyscloud_outbound_campaignrule_test.go | 2 +- ...yscloud_outbound_campaignrule_unit_test.go | 2 +- ...enesyscloud_outbound_campaignrule_utils.go | 2 +- ...ource_genesyscloud_outbound_contactlist.go | 2 +- ...ource_genesyscloud_outbound_contactlist.go | 2 +- ..._genesyscloud_outbound_contactlist_test.go | 2 +- ...oud_outbound_contact_list_contact_proxy.go | 3 +- ...esyscloud_outbound_contact_list_contact.go | 9 +- ...oud_outbound_contact_list_contact_utils.go | 5 +- ...scloud_outbound_contactlistfilter_proxy.go | 3 +- ...genesyscloud_outbound_contactlistfilter.go | 9 +- ...yscloud_outbound_contactlistfilter_test.go | 2 +- ...scloud_outbound_contactlistfilter_utils.go | 5 +- .../genesyscloud_outbound_dnclist_proxy.go | 5 +- .../resource_genesyscloud_outbound_dnclist.go | 2 +- ...urce_genesyscloud_outbound_dnclist_test.go | 2 +- ...utbound_filespecificationtemplate_proxy.go | 2 +- ...loud_outbound_filespecificationtemplate.go | 2 +- ...outbound_filespecificationtemplate_test.go | 2 +- ...utbound_filespecificationtemplate_utils.go | 5 +- .../genesyscloud_outbound_ruleset_proxy.go | 2 +- .../resource_genesyscloud_outbound_ruleset.go | 2 +- ...urce_genesyscloud_outbound_ruleset_test.go | 2 +- ...genesyscloud_outbound_ruleset_unit_test.go | 2 +- ...rce_genesyscloud_outbound_ruleset_utils.go | 2 +- ...enesyscloud_outbound_sequence_init_test.go | 2 +- .../genesyscloud_outbound_sequence_proxy.go | 2 +- ...resource_genesyscloud_outbound_sequence.go | 2 +- ...rce_genesyscloud_outbound_sequence_test.go | 2 +- ...ce_genesyscloud_outbound_sequence_utils.go | 2 +- .../genesyscloud_outbound_settings_proxy.go | 3 +- ...resource_genesyscloud_outbound_settings.go | 9 +- ...ce_genesyscloud_outbound_settings_utils.go | 5 +- .../genesyscloud_wrapupcode_mappings_proxy.go | 2 +- ...loud_outbound_wrapupcode_mappings_utils.go | 2 +- ...enesyscloud_outbound_wrapupcodemappings.go | 2 +- ..._genesyscloud_processautomation_trigger.go | 2 +- .../process_automation_triggers_proxy.go | 2 +- .../process_automations_triggers_struct.go | 2 +- ..._genesyscloud_processautomation_trigger.go | 5 +- ...syscloud_processautomation_trigger_test.go | 2 +- genesyscloud/provider/division.go | 5 +- genesyscloud/provider/provider.go | 5 +- genesyscloud/provider/sdk_client_pool.go | 2 +- ...ording_media_retention_policy_init_test.go | 2 +- ..._recording_media_retention_policy_proxy.go | 2 +- ...scloud_recording_media_retention_policy.go | 2 +- ...d_recording_media_retention_policy_test.go | 2 +- ..._recording_media_retention_policy_utils.go | 2 +- .../resource_cache/datasource_cache.go | 2 +- .../resource_exporter/resource_exporter.go | 9 +- .../resource_exporter_custom.go | 3 +- ...source_genesyscloud_architect_schedules.go | 2 +- .../resource_genesyscloud_auth_division.go | 2 +- ...esource_genesyscloud_auth_division_test.go | 2 +- .../resource_genesyscloud_idp_generic.go | 277 ------------------ .../resource_genesyscloud_idp_gsuite.go | 212 -------------- .../resource_genesyscloud_idp_onelogin.go | 199 ------------- .../resource_genesyscloud_idp_ping.go | 212 -------------- genesyscloud/resource_genesyscloud_init.go | 8 - .../resource_genesyscloud_init_test.go | 6 +- ...esource_genesyscloud_journey_action_map.go | 9 +- ...ce_genesyscloud_journey_action_map_test.go | 2 +- ...ce_genesyscloud_journey_action_template.go | 2 +- ...nesyscloud_journey_action_template_test.go | 2 +- .../resource_genesyscloud_journey_outcome.go | 2 +- ...ource_genesyscloud_journey_outcome_test.go | 2 +- .../resource_genesyscloud_journey_segment.go | 10 +- ...ource_genesyscloud_journey_segment_test.go | 2 +- ...esource_genesyscloud_knowledge_category.go | 2 +- ...ce_genesyscloud_knowledge_category_test.go | 2 +- ...esource_genesyscloud_knowledge_document.go | 2 +- ...ce_genesyscloud_knowledge_document_test.go | 2 +- ...nesyscloud_knowledge_document_variation.go | 2 +- ...cloud_knowledge_document_variation_test.go | 2 +- ...ce_genesyscloud_knowledge_knowledgebase.go | 12 +- ...nesyscloud_knowledge_knowledgebase_test.go | 2 +- .../resource_genesyscloud_knowledge_label.go | 2 +- ...ource_genesyscloud_knowledge_label_test.go | 2 +- ...urce_genesyscloud_knowledge_v1_category.go | 12 +- ...genesyscloud_knowledge_v1_category_test.go | 2 +- ...urce_genesyscloud_knowledge_v1_document.go | 11 +- ...genesyscloud_knowledge_v1_document_test.go | 2 +- .../resource_genesyscloud_location.go | 2 +- .../resource_genesyscloud_location_test.go | 2 +- ...e_genesyscloud_quality_forms_evaluation.go | 2 +- ...esyscloud_quality_forms_evaluation_test.go | 2 +- ...ource_genesyscloud_quality_forms_survey.go | 2 +- ..._genesyscloud_quality_forms_survey_test.go | 2 +- ...ource_genesyscloud_routing_email_domain.go | 2 +- ..._genesyscloud_routing_email_domain_test.go | 2 +- .../resource_genesyscloud_routing_language.go | 2 +- ...urce_genesyscloud_routing_language_test.go | 2 +- .../resource_genesyscloud_routing_skill.go | 2 +- ...source_genesyscloud_routing_skill_group.go | 2 +- ...e_genesyscloud_routing_skill_group_test.go | 2 +- ...esource_genesyscloud_routing_skill_test.go | 2 +- ...esource_genesyscloud_routing_wrapupcode.go | 2 +- ...ce_genesyscloud_routing_wrapupcode_test.go | 2 +- genesyscloud/resource_genesyscloud_user.go | 77 ++--- .../resource_genesyscloud_user_test.go | 11 +- ...resource_genesyscloud_widget_deployment.go | 2 +- ...rce_genesyscloud_widget_deployment_test.go | 2 +- ...scloud_responsemanagement_library_proxy.go | 3 +- ...genesyscloud_responsemanagement_library.go | 7 +- ...yscloud_responsemanagement_library_test.go | 2 +- ...cloud_responsemanagement_response_proxy.go | 3 +- ...enesyscloud_responsemanagement_response.go | 9 +- ...scloud_responsemanagement_response_test.go | 2 +- ...cloud_responsemanagement_response_utils.go | 5 +- ..._responsemanagement_responseasset_proxy.go | 2 +- ...scloud_responsemanagement_responseasset.go | 9 +- ...d_responsemanagement_responseasset_test.go | 2 +- .../genesyscloud_routing_email_route_proxy.go | 2 +- ...source_genesyscloud_routing_email_route.go | 2 +- ...e_genesyscloud_routing_email_route_test.go | 2 +- ..._genesyscloud_routing_email_route_utils.go | 2 +- .../data_source_genesyscloud_routing_queue.go | 2 +- .../genesyscloud_routing_queue_proxy.go | 2 +- .../resource_genesyscloud_routing_queue.go | 2 +- ...esource_genesyscloud_routing_queue_test.go | 2 +- ...g_queue_conditional_group_routing_proxy.go | 3 +- ...routing_queue_conditional_group_routing.go | 9 +- ...ng_queue_conditional_group_routing_test.go | 2 +- ...eue_conditional_group_routing_unit_test.go | 9 +- ...ting_queue_outbound_email_address_proxy.go | 3 +- ...ud_routing_queue_outbound_email_address.go | 11 +- ...ing_queue_outbound_email_address_schema.go | 3 +- ...uting_queue_outbound_email_address_test.go | 9 +- ..._queue_outbound_email_address_unit_test.go | 9 +- ...ting_queue_outbound_email_address_utils.go | 25 ++ ..._outbound_email_address_utils_unit_test.go | 30 ++ .../genesyscloud_routing_settings_proxy.go | 3 +- .../resource_genesyscloud_routing_settings.go | 2 +- ...enesyscloud_routing_sms_addresses_proxy.go | 2 +- ...urce_genesyscloud_routing_sms_addresses.go | 2 +- ...genesyscloud_routing_sms_addresses_test.go | 2 +- .../genesyscloud_routing_utilization_proxy.go | 52 +--- ...source_genesyscloud_routing_utilization.go | 45 +-- ...genesyscloud_routing_utilization_schema.go | 23 +- ...e_genesyscloud_routing_utilization_test.go | 15 +- .../resource_routing_utilization_utils.go | 53 ++-- ...syscloud_routing_utilization_label_test.go | 7 +- ...yscloud_routing_utilization_label_proxy.go | 4 +- ..._genesyscloud_routing_utilization_label.go | 2 +- ...scloud_routing_utilization_label_schema.go | 41 ++- ...syscloud_routing_utilization_label_test.go | 40 ++- ...yscloud_routing_utilization_label_utils.go | 16 - .../scripts/genesyscloud_scripts_proxy.go | 2 +- .../scripts/resource_genesyscloud_script.go | 2 +- .../resource_genesyscloud_script_test.go | 2 +- .../data_source_genesyscloud_station_test.go | 1 - .../station/genesyscloud_station_init_test.go | 2 +- .../station/genesyscloud_station_proxy.go | 2 +- ...esyscloud_task_management_workbin_proxy.go | 2 +- ...ce_genesyscloud_task_management_workbin.go | 2 +- ...nesyscloud_task_management_workbin_test.go | 2 +- ...syscloud_task_management_workitem_proxy.go | 2 +- ...e_genesyscloud_task_management_workitem.go | 2 +- ...esyscloud_task_management_workitem_test.go | 2 +- ...loud_task_management_workitem_unit_test.go | 2 +- ...syscloud_task_management_workitem_utils.go | 2 +- ...d_task_management_workitem_schema_proxy.go | 2 +- ...yscloud_task_management_workitem_schema.go | 2 +- ...ud_task_management_workitem_schema_test.go | 2 +- ...sk_management_workitem_schema_unit_test.go | 2 +- ...d_task_management_workitem_schema_utils.go | 2 +- ..._genesyscloud_task_management_unit_test.go | 7 +- ...syscloud_task_management_worktype_proxy.go | 2 +- ...e_genesyscloud_task_management_worktype.go | 2 +- ...esyscloud_task_management_worktype_test.go | 2 +- ...loud_task_management_worktype_unit_test.go | 2 +- ...syscloud_task_management_worktype_utils.go | 2 +- genesyscloud/team/genesyscloud_team_proxy.go | 5 +- .../team/resource_genesyscloud_team.go | 2 +- .../team/resource_genesyscloud_team_test.go | 7 +- .../resource_genesyscloud_team_unit_test.go | 2 +- .../team/resource_genesyscloud_team_utils.go | 4 +- ...phony_providers_edges_trunkbasesettings.go | 2 +- ..._providers_edges_trunkbasesettings_test.go | 2 +- ...oud_telephony_providers_edges_did_proxy.go | 2 +- ...elephony_providers_edges_did_pool_proxy.go | 2 +- ...loud_telephony_providers_edges_did_pool.go | 2 +- ...telephony_providers_edges_did_pool_test.go | 2 +- ...elephony_providers_edges_did_pool_utils.go | 2 +- ...ephony_providers_edges_edge_group_proxy.go | 2 +- ...ud_telephony_providers_edges_edge_group.go | 2 +- ...lephony_providers_edges_edge_group_test.go | 2 +- ...ephony_providers_edges_edge_group_utils.go | 2 +- ...ny_providers_edges_extension_pool_proxy.go | 2 +- ...elephony_providers_edges_extension_pool.go | 2 +- ...ony_providers_edges_extension_pool_test.go | 2 +- ...ephony_providers_edges_linebasesettings.go | 2 +- ...ud_telephony_providers_edges_phone_test.go | 1 - ...lephony_providers_edges_phone_init_test.go | 2 +- ...d_telephony_providers_edges_phone_proxy.go | 2 +- ...yscloud_telephony_providers_edges_phone.go | 4 +- ..._telephony_providers_edges_phone_schema.go | 32 +- ...ud_telephony_providers_edges_phone_test.go | 131 ++++++++- ...d_telephony_providers_edges_phone_utils.go | 239 +++++++++------ ...phony_providers_edges_phonebasesettings.go | 2 +- ...providers_edges_phonebasesettings_proxy.go | 2 +- ...phony_providers_edges_phonebasesettings.go | 2 +- ..._providers_edges_phonebasesettings_test.go | 2 +- ...providers_edges_phonebasesettings_utils.go | 2 +- ...oud_telephony_providers_edges_site_test.go | 2 +- ...ud_telephony_providers_edges_site_proxy.go | 2 +- ...syscloud_telephony_providers_edges_site.go | 2 +- ...d_telephony_providers_edges_site_schema.go | 7 +- ...oud_telephony_providers_edges_site_test.go | 2 +- ...ud_telephony_providers_edges_site_utils.go | 2 +- ...ers_edges_site_outbound_route_init_test.go | 5 +- ...oviders_edges_site_outbound_route_proxy.go | 3 +- ...ony_providers_edges_site_outbound_route.go | 37 ++- ...oviders_edges_site_outbound_route_utils.go | 17 +- ...yscloud_telephony_providers_edges_trunk.go | 2 +- ...d_telephony_providers_edges_trunk_proxy.go | 2 +- ...yscloud_telephony_providers_edges_trunk.go | 2 +- .../genesyscloud_resource_exporter.go | 8 +- .../genesyscloud_resource_exporter_test.go | 5 +- .../resource_genesyscloud_tf_export_test.go | 2 +- .../tfexporter/tf_exporter_resource_test.go | 32 +- .../genesyscloud_user_roles_proxy.go | 2 +- .../resource_genesyscloud_user_roles_utils.go | 2 +- .../util/resourcedata/resourcedata.go | 2 +- .../util/util_basesetting_properties.go | 2 +- .../util/util_diagnostic_unit_test.go | 5 +- genesyscloud/util/util_diagnostics.go | 3 +- genesyscloud/util/util_divisions.go | 2 +- genesyscloud/util/util_domainentities.go | 2 +- genesyscloud/util/util_retries.go | 2 +- genesyscloud/validators/validators.go | 12 + ...loud_webdeployments_configuration_proxy.go | 2 +- ...nesyscloud_webdeployments_configuration.go | 2 +- ...oud_webdeployments_configuration_schema.go | 20 ++ ...cloud_webdeployments_configuration_test.go | 29 +- ...ud_webdeployments_configuration_journey.go | 2 +- ..._webdeployments_configuration_messenger.go | 5 +- ...eployments_configuration_support_center.go | 2 +- ...loud_webdeployments_configuration_utils.go | 17 +- ...yscloud_webdeployments_deployment_proxy.go | 7 +- ..._genesyscloud_webdeployments_deployment.go | 2 +- ...syscloud_webdeployments_deployment_test.go | 2 +- ...yscloud_webdeployments_deployment_utils.go | 2 +- go.mod | 8 +- go.sum | 16 +- main.go | 8 + 444 files changed, 3234 insertions(+), 1851 deletions(-) create mode 100644 genesyscloud/idp_generic/genesyscloud_idp_generic_proxy.go create mode 100644 genesyscloud/idp_generic/resource_genesyscloud_idp_generic.go create mode 100644 genesyscloud/idp_generic/resource_genesyscloud_idp_generic_init_test.go create mode 100644 genesyscloud/idp_generic/resource_genesyscloud_idp_generic_schema.go rename genesyscloud/{ => idp_generic}/resource_genesyscloud_idp_generic_test.go (85%) create mode 100644 genesyscloud/idp_gsuite/genesyscloud_idp_gsuite_proxy.go create mode 100644 genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite.go create mode 100644 genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_init_test.go create mode 100644 genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_schema.go rename genesyscloud/{ => idp_gsuite}/resource_genesyscloud_idp_gsuite_test.go (74%) create mode 100644 genesyscloud/idp_onelogin/genesyscloud_idp_onelogin_proxy.go create mode 100644 genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin.go create mode 100644 genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin_init_test.go create mode 100644 genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin_schema.go rename genesyscloud/{ => idp_onelogin}/resource_genesyscloud_idp_onelogin_test.go (63%) create mode 100644 genesyscloud/idp_ping/genesyscloud_idp_ping_proxy.go create mode 100644 genesyscloud/idp_ping/resource_genesyscloud_idp_ping.go create mode 100644 genesyscloud/idp_ping/resource_genesyscloud_idp_ping_init_test.go create mode 100644 genesyscloud/idp_ping/resource_genesyscloud_idp_ping_schema.go rename genesyscloud/{ => idp_ping}/resource_genesyscloud_idp_ping_test.go (74%) delete mode 100644 genesyscloud/resource_genesyscloud_idp_generic.go delete mode 100644 genesyscloud/resource_genesyscloud_idp_gsuite.go delete mode 100644 genesyscloud/resource_genesyscloud_idp_onelogin.go delete mode 100644 genesyscloud/resource_genesyscloud_idp_ping.go create mode 100644 genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_utils.go create mode 100644 genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_utils_unit_test.go diff --git a/GNUmakefile b/GNUmakefile index 3dbb0308d..4b9cf8322 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,6 +1,6 @@ default: build -.PHONY: testacc clean build sideload +.PHONY: testacc clean build docs sideload DIST_DIR=./dist BIN_NAME=terraform-provider-genesyscloud @@ -29,6 +29,9 @@ testacc: testunit: TF_UNIT=1 go test ./... -run TestUnit -cover -count=1 -coverprofile=coverage_unit.out +# Generate docs +docs: + go generate coverageacc: go tool cover -func coverage.out | grep "total:" | \ diff --git a/README.md b/README.md index 919101ea1..1260c7fed 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,13 @@ ![tests](https://github.com/MyPureCloud/terraform-provider-genesyscloud/workflows/Tests/badge.svg?branch=main) + # Genesys Cloud Terraform Provider + Terraform Logo ## Requirements -- [Terraform](https://www.terraform.io/downloads.html) >= 1.0.x -- [Go](https://golang.org/doc/install) >= 1.18 +- [Terraform](https://www.terraform.io/downloads.html) >= 1.0.x +- [Go](https://golang.org/doc/install) >= 1.18 ## Building The Provider @@ -45,9 +47,9 @@ GENESYSCLOUD_ACCESS_TOKEN GENESYSCLOUD_REGION ``` -*Note:* If `GENESYSCLOUD_ACCESS_TOKEN` is set, the Oauth client will use the access token instead of client credentials to make requests. +_Note:_ If `GENESYSCLOUD_ACCESS_TOKEN` is set, the Oauth client will use the access token instead of client credentials to make requests. -*Note:* The provider makes Public API calls to perform all of the CRUD operations necessary to manage Genesys Cloud resources. All of these API calls require specific permissions and OAuth scopes. Therefore it is important that you verify your OAuth Client is authorized for all necessary scopes and is assigned an admin role capable of creating, reading, updating, and deleting all resources that your Terraform configuration will manage. +_Note:_ The provider makes Public API calls to perform all of the CRUD operations necessary to manage Genesys Cloud resources. All of these API calls require specific permissions and OAuth scopes. Therefore it is important that you verify your OAuth Client is authorized for all necessary scopes and is assigned an admin role capable of creating, reading, updating, and deleting all resources that your Terraform configuration will manage. For any issues, questions, or suggestions for the provider, visit the [Genesys Cloud Developer Forum](https://developer.mypurecloud.com/forum/) @@ -61,11 +63,11 @@ port - Port of the Proxy server host - Host Ip or DNS of the proxy server protocol - Protocol required to connect to the Proxy (http or https) -The 'proxy' has another section which is an optional section. +The 'proxy' has another section which is an optional section. If the proxy requires authentication to connect to 'auth' needs to be mentioned under the 'Proxy'. -An example of the provider configuration with the proxy: +An example of the provider configuration with the proxy: ```hcl provider "genesyscloud" { @@ -73,7 +75,7 @@ provider "genesyscloud" { oauthclient_secret = "" aws_region = "" - proxy { + proxy { host = "example.com" port = "8443" protocol = "https" @@ -100,11 +102,13 @@ GENESYSCLOUD_PROXY_AUTH_PASSWORD ### Data Sources There may be cases where you want to reference existing resources in a Terraform configuration file but do not want those resources to be managed by Terraform. This provider supports several data source types that can act as a read-only resource for existing objects in your org. To include one in your configuration, add a `data` block to your configuration file with one of the supported data source types: + ```hcl data "genesyscloud_auth_role" "employee" { name = "employee" } ``` + The example above will attempt to find a role named "employee" which can be referenced elsewhere in the config. By default, all data sources will allow you to access the `id` attribute which is useful for setting reference attributes that require IDs. Additional attributes may be added to data sources as needs arise. ## Developing the Provider @@ -121,32 +125,30 @@ In order to run the full suite of Acceptance tests, run `make testacc`. You can $ make testacc TESTARGS="-run TestAccResourceUserBasic" ``` -All new resources must have passing acceptance tests and docs in order to be merged. Most of the docs are generated automatically from the schema and examples folder by running `go generate`. - +All new resources must have passing acceptance tests and docs in order to be merged. Most of the docs are generated automatically from the schema and examples folder by running `make docs`. To run all of the unit tests: + ```sh $make testunit ``` - - ### Adding a new resource type -1. Create new package inside `genesyscloud` with the following files. The package name should match the name of the resource (minus, the genesyscloud_ prefix). +1. Create new package inside `genesyscloud` with the following files. The package name should match the name of the resource (minus, the genesyscloud\_ prefix). - `resource_genesyscloud_{resource_name}_schema.go` - The file containing the schema definition for the resource, data source, and exporter. It also contains a constant variable which defines the resource name, and a public function called `SetRegistrar`, which will be called from outside the package to register the resource with the provider. The schema should closely match Public API schemas, but there are some Terraform schema limitations that may require some deviation from the API. - `resource_genesyscloud_{resource_name}.go` - Contains the create, read, update and delete functions for the resource (the methods for the resource's `CreateContext`, `ReadContext`, `UpdateContext`, and `DeleteContext` attributes.) It also contains the getAll function to be used by the exporter. If you have a few helper functions present in this file, that is fine, but if there are more than 1-2 helper functions you should create a `resource_genesyscloud_{resource_name}_utils.go` to contain the business logic. - - `resource_genesyscloud_{resource_name}_test.go` - Contains the resource tests. Write acceptance test cases that cover all of the attributes and CRUD operations for the resource. Acceptance tests modify real resources in a test org and require an OAuth Client authorized to create, update, and delete the resource type in the org. See existing tests for examples and [Terraform Acceptance Test documentation](https://www.terraform.io/docs/extend/testing/acceptance-tests/index.html) for more details. Unit tests are also encouraged where applicable (for helper functions etc.) + - `resource_genesyscloud_{resource_name}_test.go` - Contains the resource tests. Write acceptance test cases that cover all of the attributes and CRUD operations for the resource. Acceptance tests modify real resources in a test org and require an OAuth Client authorized to create, update, and delete the resource type in the org. See existing tests for examples and [Terraform Acceptance Test documentation](https://www.terraform.io/docs/extend/testing/acceptance-tests/index.html) for more details. Unit tests are also encouraged where applicable (for helper functions etc.) - `data_source_genesyscloud_{resource_name}.go` - This file contains all of the data source logic for a resource. The data source should call any Genesys Cloud APIs through its API proxy class. All functions and variables in this class should be private. - `data_source_genesyscloud_{resource_name}_test.go` - Contains the data source tests. - `genesyscloud_{resource_name}_proxy.go` - This contains all of the API logic for interacting with the Genesys Cloud APIs. This is meant to be an isolated layer from Terraform, so know Terraform objects should be passed back and forth to this code. All functions and variables in this class should be private. - `genesyscloud_{resource_name}_init_test.go` - This file contains all of the logic needed to initialize a test case for your resource. All functions and variables in this class should be private. -2. Add a new folder for the resource and data source under the `/examples` folder. An example `resource.tf` file for the resource should be added to the folder along with an `apis.md` file listing all of the APIs the resource uses. To generate the documentation, run `go generate`. __Note:__ Everything inside the `docs` directory is generated based off schema data and the content inside `examples`. Do not manually edit anything inside `docs`. +2. Add a new folder for the resource and data source under the `/examples` folder. An example `resource.tf` file for the resource should be added to the folder along with an `apis.md` file listing all of the APIs the resource uses. To generate the documentation, run `go generate`. **Note:** Everything inside the `docs` directory is generated based off schema data and the content inside `examples`. Do not manually edit anything inside `docs`. 3. Import your package to `main.go` at the root of the project and, from the `registerResources` function, call the SetRegistrar function passing in the `regInstance` variable. If you want to go off of an example, we recommend using the [external contacts](https://github.com/MyPureCloud/terraform-provider-genesyscloud/tree/main/genesyscloud/external_contacts) package. -### Cx As Code Resource Generator +### Cx As Code Resource Generator [The Cx as Code Resource Generator](https://github.com/MyPureCloud/cxascode-resource-generator) is a tool that can help generate resources for Cx as Code and speed up development. The resource generator will generate resources using the package structure mentioned above. The project can be found [here](https://github.com/MyPureCloud/cxascode-resource-generator) and all usage is documented in the README. Please note that the resource generator is not perfect, it is a tool to help with development and the generated code will require review and the package will still need to be registered manually in `main.go`. diff --git a/docs/resources/group.md b/docs/resources/group.md index 543559487..b30335d26 100644 --- a/docs/resources/group.md +++ b/docs/resources/group.md @@ -51,6 +51,7 @@ resource "genesyscloud_group" "sample_group" { - `description` (String) Group description. - `member_ids` (Set of String) IDs of members assigned to the group. If not set, this resource will not manage group members. - `owner_ids` (List of String) IDs of owners of the group. +- `roles_enabled` (Boolean) Allow roles to be assigned to this group. Defaults to `true`. - `rules_visible` (Boolean) Are membership rules visible to the person requesting to view the group. Defaults to `true`. - `type` (String) Group type (official | social). This cannot be modified. Changing type attribute will cause the existing genesys_group object to dropped and recreated with a new ID. Defaults to `official`. - `visibility` (String) Who can view this group (public | owners | members). Defaults to `public`. diff --git a/docs/resources/idp_adfs.md b/docs/resources/idp_adfs.md index ee0c86fd6..42ce28c9c 100644 --- a/docs/resources/idp_adfs.md +++ b/docs/resources/idp_adfs.md @@ -40,7 +40,7 @@ resource "genesyscloud_idp_adfs" "adfs" { - `name` (String) IDP ADFS resource name - `relying_party_identifier` (String) String used to identify Genesys Cloud to ADFS. - `slo_binding` (String) Valid values: HTTP Redirect, HTTP Post -- `slo_uri` (String) Provided by ADSF on app creation +- `slo_uri` (String) Provided by ADFS on app creation - `target_uri` (String) Target URI provided by ADFS. - `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) diff --git a/docs/resources/idp_generic.md b/docs/resources/idp_generic.md index 95d69a46d..0accb0ded 100644 --- a/docs/resources/idp_generic.md +++ b/docs/resources/idp_generic.md @@ -46,6 +46,8 @@ resource "genesyscloud_idp_generic" "generic" { - `logo_image_data` (String) Base64 encoded SVG image. - `name_identifier_format` (String) SAML name identifier format. (urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified | urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress | urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName | urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName | urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos | urn:oasis:names:tc:SAML:2.0:nameid-format:entity | urn:oasis:names:tc:SAML:2.0:nameid-format:persistent | urn:oasis:names:tc:SAML:2.0:nameid-format:transient) Defaults to `urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified`. - `relying_party_identifier` (String) String used to identify Genesys Cloud to the identity provider. +- `slo_binding` (String) Valid values: HTTP Redirect, HTTP Post +- `slo_uri` (String) Provided on app creation. - `target_uri` (String) Target URI provided by the provider. - `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) diff --git a/docs/resources/idp_gsuite.md b/docs/resources/idp_gsuite.md index 0098d55c4..e10fde192 100644 --- a/docs/resources/idp_gsuite.md +++ b/docs/resources/idp_gsuite.md @@ -37,7 +37,10 @@ resource "genesyscloud_idp_gsuite" "gsuite" { ### Optional - `disabled` (Boolean) True if GSuite is disabled. Defaults to `false`. +- `name` (String) Name of the provider. - `relying_party_identifier` (String) String used to identify Genesys Cloud to GSuite. +- `slo_binding` (String) Valid values: HTTP Redirect, HTTP Post +- `slo_uri` (String) Provided on app creation. - `target_uri` (String) Target URI provided by GSuite. - `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) diff --git a/docs/resources/idp_onelogin.md b/docs/resources/idp_onelogin.md index 6f6c7beb4..21dd3de9f 100644 --- a/docs/resources/idp_onelogin.md +++ b/docs/resources/idp_onelogin.md @@ -30,12 +30,16 @@ resource "genesyscloud_idp_onelogin" "onelogin" { ### Required -- `certificates` (List of String) PEM or DER encoded public X.509 certificates for SAML signature validation. - `issuer_uri` (String) Issuer URI provided by OneLogin. ### Optional +- `certificates` (List of String) PEM or DER encoded public X.509 certificates for SAML signature validation. - `disabled` (Boolean) True if OneLogin is disabled. Defaults to `false`. +- `name` (String) IDP OneLogin resource name +- `relying_party_identifier` (String) String used to identify Genesys Cloud to OneLogin. +- `slo_binding` (String) Valid values: HTTP Redirect, HTTP Post +- `slo_uri` (String) Provided by OneLogin on app creation - `target_uri` (String) Target URI provided by OneLogin. - `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) diff --git a/docs/resources/idp_ping.md b/docs/resources/idp_ping.md index 61dc0d7f3..827158a7b 100644 --- a/docs/resources/idp_ping.md +++ b/docs/resources/idp_ping.md @@ -37,7 +37,10 @@ resource "genesyscloud_idp_ping" "ping" { ### Optional - `disabled` (Boolean) True if Ping is disabled. Defaults to `false`. +- `name` (String) Name of the provider - `relying_party_identifier` (String) String used to identify Genesys Cloud to Ping. +- `slo_binding` (String) Valid values: HTTP Redirect, HTTP Post +- `slo_uri` (String) Provided on app creation. - `target_uri` (String) Target URI provided by Ping. - `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) diff --git a/docs/resources/journey_action_map.md b/docs/resources/journey_action_map.md index 467dbed77..883fd233a 100644 --- a/docs/resources/journey_action_map.md +++ b/docs/resources/journey_action_map.md @@ -170,8 +170,8 @@ Required: Required: - `key` (String) The event key. -- `session_type` (String) The session type for which this condition can be satisfied. -- `stream_type` (String) The stream type for which this condition can be satisfied. Valid values: Web, Custom, Conversation. +- `session_type` (String) The session type for which this condition can be satisfied. Valid values: web, app. +- `stream_type` (String) The stream type for which this condition can be satisfied. Valid values: Web, App. - `values` (Set of String) The event values. Optional: diff --git a/docs/resources/journey_outcome.md b/docs/resources/journey_outcome.md index 58acec4f7..e3ac09b60 100644 --- a/docs/resources/journey_outcome.md +++ b/docs/resources/journey_outcome.md @@ -126,8 +126,8 @@ Required: - `count` (Number) The number of times the pattern must match. - `criteria` (Block Set, Min: 1) A list of one or more criteria to satisfy. (see [below for nested schema](#nestedblock--journey--patterns--criteria)) -- `session_type` (String) The session type for which this pattern can be matched on. -- `stream_type` (String) The stream type for which this pattern can be matched on.Valid values: Web, Custom, Conversation. +- `session_type` (String) The session type for which this pattern can be matched on. Valid values: web, app. +- `stream_type` (String) The stream type for which this pattern can be matched on. Valid values: Web, App. Optional: diff --git a/docs/resources/journey_segment.md b/docs/resources/journey_segment.md index 785e47715..2550f03ae 100644 --- a/docs/resources/journey_segment.md +++ b/docs/resources/journey_segment.md @@ -119,8 +119,8 @@ Required: - `count` (Number) The number of times the pattern must match. - `criteria` (Block Set, Min: 1) A list of one or more criteria to satisfy. (see [below for nested schema](#nestedblock--journey--patterns--criteria)) -- `session_type` (String) The session type for which this pattern can be matched on. -- `stream_type` (String) The stream type for which this pattern can be matched on.Valid values: Web, Custom, Conversation. +- `session_type` (String) The session type for which this pattern can be matched on. Valid values: web, app. +- `stream_type` (String) The stream type for which this pattern can be matched on. Valid values: Web, App. Optional: diff --git a/docs/resources/routing_utilization.md b/docs/resources/routing_utilization.md index b66575c7f..e0f7f239a 100644 --- a/docs/resources/routing_utilization.md +++ b/docs/resources/routing_utilization.md @@ -64,7 +64,7 @@ resource "genesyscloud_routing_utilization" "org-utilization" { - `callback` (Block List, Max: 1) Callback media settings. If not set, this reverts to the default media type settings. (see [below for nested schema](#nestedblock--callback)) - `chat` (Block List, Max: 1) Chat media settings. If not set, this reverts to the default media type settings. (see [below for nested schema](#nestedblock--chat)) - `email` (Block List, Max: 1) Email media settings. If not set, this reverts to the default media type settings. (see [below for nested schema](#nestedblock--email)) -- `label_utilizations` (Block List) Label utilization settings. If not set, default label settings will be applied. This is in PREVIEW and should not be used unless the feature is available to your organization. (see [below for nested schema](#nestedblock--label_utilizations)) +- `label_utilizations` (Block List) Label utilization settings. If not set, default label settings will be applied. (see [below for nested schema](#nestedblock--label_utilizations)) - `message` (Block List, Max: 1) Message media settings. If not set, this reverts to the default media type settings. (see [below for nested schema](#nestedblock--message)) - `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) diff --git a/docs/resources/routing_utilization_label.md b/docs/resources/routing_utilization_label.md index 367e660a4..7714919f7 100644 --- a/docs/resources/routing_utilization_label.md +++ b/docs/resources/routing_utilization_label.md @@ -2,11 +2,11 @@ page_title: "genesyscloud_routing_utilization_label Resource - terraform-provider-genesyscloud" subcategory: "" description: |- - Genesys Cloud Routing Utilization Label. This resource is not yet widely available. Only use it if the feature is enabled. + Genesys Cloud Routing Utilization Label. --- # genesyscloud_routing_utilization_label (Resource) -Genesys Cloud Routing Utilization Label. This resource is not yet widely available. Only use it if the feature is enabled. +Genesys Cloud Routing Utilization Label. ## 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: diff --git a/docs/resources/telephony_providers_edges_phone.md b/docs/resources/telephony_providers_edges_phone.md index 5bcbb1b76..5d7c15349 100644 --- a/docs/resources/telephony_providers_edges_phone.md +++ b/docs/resources/telephony_providers_edges_phone.md @@ -56,8 +56,8 @@ resource "genesyscloud_telephony_providers_edges_phone" "example_phone" { ### Optional - `capabilities` (Block List, Max: 1) Phone Capabilities. (see [below for nested schema](#nestedblock--capabilities)) -- `line_addresses` (List of String) Ordered list of Line DIDs for standalone phones. Each phone number must be in an E.164 phone number format. - `line_base_settings_id` (String) Line Base Settings ID. +- `line_properties` (Block List, Max: 1) line properties (see [below for nested schema](#nestedblock--line_properties)) - `phone_meta_base_id` (String) Phone Meta Base ID. - `properties` (String) phone properties - `state` (String) Indicates if the resource is active, inactive, or deleted. Valid values: active, inactive, deleted. Defaults to `active`. @@ -82,3 +82,12 @@ Optional: - `provisions` (Boolean) Provisions - `registers` (Boolean) Registers + + +### Nested Schema for `line_properties` + +Optional: + +- `line_address` (List of String) DID for standalone phones. Each phone number must be in an E.164 phone number format. +- `remote_address` (List of String) Station remote property for phones. No validation is provided + diff --git a/docs/resources/webdeployments_configuration.md b/docs/resources/webdeployments_configuration.md index cb3d040f9..f3d258b66 100644 --- a/docs/resources/webdeployments_configuration.md +++ b/docs/resources/webdeployments_configuration.md @@ -100,6 +100,10 @@ resource "genesyscloud_webdeployments_configuration" "exampleConfiguration" { channels = ["Webmessaging", "Voice"] mask_selectors = [".my-class", "#my-id"] readonly_selectors = [".my-class", "#my-id"] + pause_criteria = { + url_fragment = "/sensitive" + condition = "includes" + } } journey_events { enabled = true @@ -213,8 +217,18 @@ Optional: - `channels` (List of String) List of channels through which cobrowse is available (for now only Webmessaging and Voice) - `enabled` (Boolean) Whether or not cobrowse is enabled - `mask_selectors` (List of String) List of CSS selectors which should be masked when screen sharing is active +- `pause_criteria` (Block List) Pause criteria that will pause cobrowse if some of them are met in the user's URL (see [below for nested schema](#nestedblock--cobrowse--pause_criteria)) - `readonly_selectors` (List of String) List of CSS selectors which should be read-only when screen sharing is active + +### Nested Schema for `cobrowse.pause_criteria` + +Required: + +- `condition` (String) The condition to be applied to the `url_fragment`. Conditions are 'includes', 'does_not_include', 'starts_with', 'ends_with', 'equals' +- `url_fragment` (String) A string representing a part of the URL that, when matched according to the specified condition, will trigger a pause in the cobrowse session + + ### Nested Schema for `custom_i18n_labels` diff --git a/examples/resources/genesyscloud_webdeployments_configuration/resource.tf b/examples/resources/genesyscloud_webdeployments_configuration/resource.tf index ff8944c76..982c2b1fc 100644 --- a/examples/resources/genesyscloud_webdeployments_configuration/resource.tf +++ b/examples/resources/genesyscloud_webdeployments_configuration/resource.tf @@ -75,6 +75,10 @@ resource "genesyscloud_webdeployments_configuration" "exampleConfiguration" { channels = ["Webmessaging", "Voice"] mask_selectors = [".my-class", "#my-id"] readonly_selectors = [".my-class", "#my-id"] + pause_criteria = { + url_fragment = "/sensitive" + condition = "includes" + } } journey_events { enabled = true diff --git a/genesyscloud/architect_datatable/data_source_genesyscloud_architect_datatable.go b/genesyscloud/architect_datatable/data_source_genesyscloud_architect_datatable.go index fe8f6f8e6..8ec505d59 100644 --- a/genesyscloud/architect_datatable/data_source_genesyscloud_architect_datatable.go +++ b/genesyscloud/architect_datatable/data_source_genesyscloud_architect_datatable.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func DataSourceArchitectDatatableRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { diff --git a/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable.go b/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable.go index 0aa344ef2..10739a8d2 100644 --- a/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable.go +++ b/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type Datatableproperty struct { diff --git a/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_proxy.go b/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_proxy.go index 9223c15f3..232263a12 100644 --- a/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_proxy.go +++ b/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_proxy.go @@ -6,7 +6,7 @@ import ( "errors" "net/http" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // internalProxy holds a proxy instance that can be used throughout the package diff --git a/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_test.go b/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_test.go index bd6b97a9e..d2df0544c 100644 --- a/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_test.go +++ b/genesyscloud/architect_datatable/resource_genesyscloud_architect_datatable_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceArchitectDatatable(t *testing.T) { diff --git a/genesyscloud/architect_datatable_row/genesyscloud_architect_datatable_row_utils.go b/genesyscloud/architect_datatable_row/genesyscloud_architect_datatable_row_utils.go index a346d63de..134f773ad 100644 --- a/genesyscloud/architect_datatable_row/genesyscloud_architect_datatable_row_utils.go +++ b/genesyscloud/architect_datatable_row/genesyscloud_architect_datatable_row_utils.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // Row IDs structured as {table-id}/{key-value} diff --git a/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row.go b/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row.go index 74a126ee4..d75e6d836 100644 --- a/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row.go +++ b/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type Datatableproperty struct { diff --git a/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_proxy.go b/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_proxy.go index 1f94400bc..eddc171ee 100644 --- a/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_proxy.go +++ b/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_proxy.go @@ -4,11 +4,12 @@ import ( "context" "encoding/json" "errors" - "github.com/mitchellh/mapstructure" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "net/http" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" + + "github.com/mitchellh/mapstructure" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // internalProxy holds a proxy instance that can be used throughout the package diff --git a/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_test.go b/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_test.go index 070e1bc05..5a277203b 100644 --- a/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_test.go +++ b/genesyscloud/architect_datatable_row/resource_genesyscloud_architect_datatable_row_test.go @@ -11,7 +11,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceArchitectDatatableRow(t *testing.T) { diff --git a/genesyscloud/architect_emergencygroup/genesyscloud_architect_emergencygroup_proxy.go b/genesyscloud/architect_emergencygroup/genesyscloud_architect_emergencygroup_proxy.go index 01d41745a..d4d565748 100644 --- a/genesyscloud/architect_emergencygroup/genesyscloud_architect_emergencygroup_proxy.go +++ b/genesyscloud/architect_emergencygroup/genesyscloud_architect_emergencygroup_proxy.go @@ -3,7 +3,8 @@ package architect_emergencygroup import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *architectEmergencyGroupProxy diff --git a/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup.go b/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup.go index 9523a2472..e6640bc33 100644 --- a/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup.go +++ b/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllEmergencyGroups(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_test.go b/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_test.go index 0cf52ad50..7be483c9f 100644 --- a/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_test.go +++ b/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceArchitectEmergencyGroups(t *testing.T) { diff --git a/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_utils.go b/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_utils.go index 11ecb8e35..7d57c85ab 100644 --- a/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_utils.go +++ b/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_utils.go @@ -2,7 +2,7 @@ package architect_emergencygroup import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func buildSdkEmergencyGroupCallFlows(d *schema.ResourceData) *[]platformclientv2.Emergencycallflow { diff --git a/genesyscloud/architect_flow/resource_genesyscloud_architect_flow_proxy.go b/genesyscloud/architect_flow/resource_genesyscloud_architect_flow_proxy.go index f0642e4e5..f4a1b6b73 100644 --- a/genesyscloud/architect_flow/resource_genesyscloud_architect_flow_proxy.go +++ b/genesyscloud/architect_flow/resource_genesyscloud_architect_flow_proxy.go @@ -3,9 +3,10 @@ package architect_flow import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *architectFlowProxy diff --git a/genesyscloud/architect_flow/resource_genesyscloud_flow.go b/genesyscloud/architect_flow/resource_genesyscloud_flow.go index 6c70707fd..2ad10f577 100644 --- a/genesyscloud/architect_flow/resource_genesyscloud_flow.go +++ b/genesyscloud/architect_flow/resource_genesyscloud_flow.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllFlows(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/architect_flow/resource_genesyscloud_flow_test.go b/genesyscloud/architect_flow/resource_genesyscloud_flow_test.go index bb721ed40..ddcfb05e4 100644 --- a/genesyscloud/architect_flow/resource_genesyscloud_flow_test.go +++ b/genesyscloud/architect_flow/resource_genesyscloud_flow_test.go @@ -17,7 +17,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // lockFlow will search for a specific flow and then lock it. This is to specifically test the force_unlock flag where I want to create a flow, simulate some one locking it and then attempt to diff --git a/genesyscloud/architect_grammar/genesyscloud_architect_grammar_proxy.go b/genesyscloud/architect_grammar/genesyscloud_architect_grammar_proxy.go index 36c73863d..cd0493219 100644 --- a/genesyscloud/architect_grammar/genesyscloud_architect_grammar_proxy.go +++ b/genesyscloud/architect_grammar/genesyscloud_architect_grammar_proxy.go @@ -6,7 +6,7 @@ import ( "log" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar.go b/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar.go index 6fe8bff54..e7a667976 100644 --- a/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar.go +++ b/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar_test.go b/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar_test.go index 6d81a2d27..a85bf3bd2 100644 --- a/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar_test.go +++ b/genesyscloud/architect_grammar/resource_genesyscloud_architect_grammar_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceArchitectGrammar(t *testing.T) { diff --git a/genesyscloud/architect_grammar_language/genesyscloud_architect_grammar_language_proxy.go b/genesyscloud/architect_grammar_language/genesyscloud_architect_grammar_language_proxy.go index 6647b9801..00051d1d7 100644 --- a/genesyscloud/architect_grammar_language/genesyscloud_architect_grammar_language_proxy.go +++ b/genesyscloud/architect_grammar_language/genesyscloud_architect_grammar_language_proxy.go @@ -8,7 +8,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/files" "time" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type FileType int diff --git a/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language.go b/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language.go index b8423f1a4..d1374d9f1 100644 --- a/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language.go +++ b/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_test.go b/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_test.go index 7bc029fd3..bbff62799 100644 --- a/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_test.go +++ b/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_test.go @@ -15,7 +15,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceArchitectGrammarLanguage(t *testing.T) { diff --git a/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_utils.go b/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_utils.go index 97f30023c..b4a6aa530 100644 --- a/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_utils.go +++ b/genesyscloud/architect_grammar_language/resource_genesyscloud_architect_grammar_language_utils.go @@ -13,7 +13,7 @@ import ( "time" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/architect_ivr/data_source_genesyscloud_architect_ivr_test.go b/genesyscloud/architect_ivr/data_source_genesyscloud_architect_ivr_test.go index 97345394d..0fb9de850 100644 --- a/genesyscloud/architect_ivr/data_source_genesyscloud_architect_ivr_test.go +++ b/genesyscloud/architect_ivr/data_source_genesyscloud_architect_ivr_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/stretchr/testify/assert" "github.com/google/uuid" diff --git a/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy.go b/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy.go index fdd8c9c55..096f1fdbf 100644 --- a/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy.go +++ b/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy.go @@ -7,7 +7,7 @@ import ( utillists "terraform-provider-genesyscloud/genesyscloud/util/lists" "time" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy_unit_test.go b/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy_unit_test.go index 9c00434e0..a49095e59 100644 --- a/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy_unit_test.go +++ b/genesyscloud/architect_ivr/genesyscloud_architect_ivr_proxy_unit_test.go @@ -11,7 +11,7 @@ import ( "testing" "github.com/google/uuid" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestUnitUploadIvrDnisChunksSuccess(t *testing.T) { diff --git a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr.go b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr.go index ab6fb8e76..c90727097 100644 --- a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr.go +++ b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // getAllIvrConfigs retrieves all architect IVRs and is used for the exporter diff --git a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_test.go b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_test.go index 166d0320e..7cb398da0 100644 --- a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_test.go +++ b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceIvrConfigBasic(t *testing.T) { diff --git a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_unit_test.go b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_unit_test.go index b5c97be4b..6b8073966 100644 --- a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_unit_test.go +++ b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_unit_test.go @@ -11,7 +11,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/stretchr/testify/assert" ) diff --git a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_utils.go b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_utils.go index cfe4f8446..4ef23a38a 100644 --- a/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_utils.go +++ b/genesyscloud/architect_ivr/resource_genesyscloud_architect_ivr_utils.go @@ -8,7 +8,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type IvrConfigStruct struct { diff --git a/genesyscloud/architect_schedulegroups/genesyscloud_architect_schedulegroups_proxy.go b/genesyscloud/architect_schedulegroups/genesyscloud_architect_schedulegroups_proxy.go index 44bf1b3ee..5072b3500 100644 --- a/genesyscloud/architect_schedulegroups/genesyscloud_architect_schedulegroups_proxy.go +++ b/genesyscloud/architect_schedulegroups/genesyscloud_architect_schedulegroups_proxy.go @@ -3,8 +3,9 @@ package architect_schedulegroups import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups.go b/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups.go index 3b8bd4e45..85805b7a6 100644 --- a/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups.go +++ b/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups_test.go b/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups_test.go index b654c0254..1b2e57d71 100644 --- a/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups_test.go +++ b/genesyscloud/architect_schedulegroups/resource_genesyscloud_architect_schedulegroups_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceArchitectScheduleGroups(t *testing.T) { diff --git a/genesyscloud/architect_schedules/genesyscloud_architect_schedules_proxy.go b/genesyscloud/architect_schedules/genesyscloud_architect_schedules_proxy.go index 9fb733127..f19f33763 100644 --- a/genesyscloud/architect_schedules/genesyscloud_architect_schedules_proxy.go +++ b/genesyscloud/architect_schedules/genesyscloud_architect_schedules_proxy.go @@ -6,7 +6,7 @@ import ( "log" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules.go b/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules.go index 7d0c6ba1e..a5b53eba8 100644 --- a/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules.go +++ b/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules.go @@ -19,7 +19,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) const timeFormat = "2006-01-02T15:04:05.000000" diff --git a/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules_test.go b/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules_test.go index f780c8d5e..41821062d 100644 --- a/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules_test.go +++ b/genesyscloud/architect_schedules/resource_genesyscloud_architect_schedules_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceArchitectSchedules(t *testing.T) { diff --git a/genesyscloud/architect_user_prompt/genesyscloud_architect_user_prompt_proxy.go b/genesyscloud/architect_user_prompt/genesyscloud_architect_user_prompt_proxy.go index 25ac10cb1..1f0467e5b 100644 --- a/genesyscloud/architect_user_prompt/genesyscloud_architect_user_prompt_proxy.go +++ b/genesyscloud/architect_user_prompt/genesyscloud_architect_user_prompt_proxy.go @@ -4,7 +4,7 @@ import ( "context" "log" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // internalProxy holds a proxy instance that can be used throughout the package diff --git a/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt.go b/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt.go index 6c7a11825..823b8318c 100644 --- a/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt.go +++ b/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllUserPrompts(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_test.go b/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_test.go index 9ed5d9cce..f7c539930 100644 --- a/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_test.go +++ b/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_test.go @@ -16,7 +16,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceUserPromptBasic(t *testing.T) { diff --git a/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_utils.go b/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_utils.go index 615a715c3..5250ed023 100644 --- a/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_utils.go +++ b/genesyscloud/architect_user_prompt/resource_genesyscloud_architect_user_prompt_utils.go @@ -16,7 +16,7 @@ import ( files "terraform-provider-genesyscloud/genesyscloud/util/files" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type PromptAudioData struct { diff --git a/genesyscloud/auth_role/data_source_genesyscloud_auth_role.go b/genesyscloud/auth_role/data_source_genesyscloud_auth_role.go index a5539383f..5bce507ee 100644 --- a/genesyscloud/auth_role/data_source_genesyscloud_auth_role.go +++ b/genesyscloud/auth_role/data_source_genesyscloud_auth_role.go @@ -3,13 +3,14 @@ package auth_role import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/auth_role/genesyscloud_auth_role_proxy.go b/genesyscloud/auth_role/genesyscloud_auth_role_proxy.go index 07200518c..9bd760116 100644 --- a/genesyscloud/auth_role/genesyscloud_auth_role_proxy.go +++ b/genesyscloud/auth_role/genesyscloud_auth_role_proxy.go @@ -6,7 +6,7 @@ import ( rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/auth_role/resource_genesyscloud_auth_role.go b/genesyscloud/auth_role/resource_genesyscloud_auth_role.go index 37b70ee8a..587e91ce9 100644 --- a/genesyscloud/auth_role/resource_genesyscloud_auth_role.go +++ b/genesyscloud/auth_role/resource_genesyscloud_auth_role.go @@ -3,10 +3,6 @@ package auth_role import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -16,6 +12,11 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/lists" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/auth_role/resource_genesyscloud_auth_role_test.go b/genesyscloud/auth_role/resource_genesyscloud_auth_role_test.go index 80782c374..d39dae8cd 100644 --- a/genesyscloud/auth_role/resource_genesyscloud_auth_role_test.go +++ b/genesyscloud/auth_role/resource_genesyscloud_auth_role_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceAuthRoleDefault(t *testing.T) { diff --git a/genesyscloud/auth_role/resource_genesyscloud_auth_role_utils.go b/genesyscloud/auth_role/resource_genesyscloud_auth_role_utils.go index 7efb5f4e1..85375d231 100644 --- a/genesyscloud/auth_role/resource_genesyscloud_auth_role_utils.go +++ b/genesyscloud/auth_role/resource_genesyscloud_auth_role_utils.go @@ -6,7 +6,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func validatePermissionPolicy(proxy *authRoleProxy, policy platformclientv2.Domainpermissionpolicy) (*platformclientv2.APIResponse, error) { diff --git a/genesyscloud/authorization_product/data_source_genesyscloud_authorization_product_test.go b/genesyscloud/authorization_product/data_source_genesyscloud_authorization_product_test.go index f26f62ca5..7629eb42b 100644 --- a/genesyscloud/authorization_product/data_source_genesyscloud_authorization_product_test.go +++ b/genesyscloud/authorization_product/data_source_genesyscloud_authorization_product_test.go @@ -7,7 +7,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/stretchr/testify/assert" "golang.org/x/net/context" diff --git a/genesyscloud/authorization_product/genesyscloud_authorization_product_proxy.go b/genesyscloud/authorization_product/genesyscloud_authorization_product_proxy.go index 0a920b87a..fa0ce1465 100644 --- a/genesyscloud/authorization_product/genesyscloud_authorization_product_proxy.go +++ b/genesyscloud/authorization_product/genesyscloud_authorization_product_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/data_source_genesyscloud_architect_schedules.go b/genesyscloud/data_source_genesyscloud_architect_schedules.go index a1b604725..1d9411608 100644 --- a/genesyscloud/data_source_genesyscloud_architect_schedules.go +++ b/genesyscloud/data_source_genesyscloud_architect_schedules.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func DataSourceSchedule() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_auth_division.go b/genesyscloud/data_source_genesyscloud_auth_division.go index dbf0c9e84..1bdacb2f1 100644 --- a/genesyscloud/data_source_genesyscloud_auth_division.go +++ b/genesyscloud/data_source_genesyscloud_auth_division.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceAuthDivision() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_auth_division_home.go b/genesyscloud/data_source_genesyscloud_auth_division_home.go index bf12bec4b..b49303d31 100644 --- a/genesyscloud/data_source_genesyscloud_auth_division_home.go +++ b/genesyscloud/data_source_genesyscloud_auth_division_home.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func DataSourceAuthDivisionHome() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_journey_action_map.go b/genesyscloud/data_source_genesyscloud_journey_action_map.go index 4f02d9b46..33a8d112f 100644 --- a/genesyscloud/data_source_genesyscloud_journey_action_map.go +++ b/genesyscloud/data_source_genesyscloud_journey_action_map.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceJourneyActionMap() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_journey_action_template.go b/genesyscloud/data_source_genesyscloud_journey_action_template.go index 32f4f93e8..c24b722c3 100644 --- a/genesyscloud/data_source_genesyscloud_journey_action_template.go +++ b/genesyscloud/data_source_genesyscloud_journey_action_template.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceJourneyActionTemplate() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_journey_outcome.go b/genesyscloud/data_source_genesyscloud_journey_outcome.go index ec3473602..9ece86b26 100644 --- a/genesyscloud/data_source_genesyscloud_journey_outcome.go +++ b/genesyscloud/data_source_genesyscloud_journey_outcome.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceJourneyOutcome() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_journey_segment.go b/genesyscloud/data_source_genesyscloud_journey_segment.go index d870635b8..e66ad5fc7 100644 --- a/genesyscloud/data_source_genesyscloud_journey_segment.go +++ b/genesyscloud/data_source_genesyscloud_journey_segment.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceJourneySegment() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_knowledge_category.go b/genesyscloud/data_source_genesyscloud_knowledge_category.go index 27801fee5..c113709fb 100644 --- a/genesyscloud/data_source_genesyscloud_knowledge_category.go +++ b/genesyscloud/data_source_genesyscloud_knowledge_category.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceKnowledgeCategory() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_knowledge_knowledgebase.go b/genesyscloud/data_source_genesyscloud_knowledge_knowledgebase.go index 96f15c63c..94cea4a68 100644 --- a/genesyscloud/data_source_genesyscloud_knowledge_knowledgebase.go +++ b/genesyscloud/data_source_genesyscloud_knowledge_knowledgebase.go @@ -5,14 +5,14 @@ import ( "fmt" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" + "terraform-provider-genesyscloud/genesyscloud/validators" "time" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceKnowledgeKnowledgebase() *schema.Resource { @@ -26,10 +26,10 @@ func dataSourceKnowledgeKnowledgebase() *schema.Resource { Required: true, }, "core_language": { - Description: "Core language for knowledge base in which initial content must be created, language codes [en-US, en-UK, en-AU, de-DE] are supported currently, however the new DX knowledge will support all these language codes", - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{"en-US", "en-UK", "en-AU", "de-DE", "es-US", "es-ES", "fr-FR", "pt-BR", "nl-NL", "it-IT", "fr-CA"}, false), + Description: "Core language for knowledge base in which initial content must be created, language codes [en-US, en-UK, en-AU, de-DE] are supported currently, however the new DX knowledge will support all these language codes", + Type: schema.TypeString, + Required: true, + ValidateDiagFunc: validators.ValidateLanguageCode, }, }, } diff --git a/genesyscloud/data_source_genesyscloud_knowledge_label.go b/genesyscloud/data_source_genesyscloud_knowledge_label.go index 45312d9d4..bee3cddfe 100644 --- a/genesyscloud/data_source_genesyscloud_knowledge_label.go +++ b/genesyscloud/data_source_genesyscloud_knowledge_label.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceKnowledgeLabel() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_location.go b/genesyscloud/data_source_genesyscloud_location.go index 2063e68b5..611dbdf33 100644 --- a/genesyscloud/data_source_genesyscloud_location.go +++ b/genesyscloud/data_source_genesyscloud_location.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func DataSourceLocation() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_organizations_me.go b/genesyscloud/data_source_genesyscloud_organizations_me.go index fe8a15dbe..018930170 100644 --- a/genesyscloud/data_source_genesyscloud_organizations_me.go +++ b/genesyscloud/data_source_genesyscloud_organizations_me.go @@ -3,11 +3,12 @@ package genesyscloud import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func DataSourceOrganizationsMe() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_quality_forms_evaluation.go b/genesyscloud/data_source_genesyscloud_quality_forms_evaluation.go index a69e74b4a..52aef5fed 100644 --- a/genesyscloud/data_source_genesyscloud_quality_forms_evaluation.go +++ b/genesyscloud/data_source_genesyscloud_quality_forms_evaluation.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type EvaluationFormQuestionGroupStruct struct { diff --git a/genesyscloud/data_source_genesyscloud_quality_forms_survey.go b/genesyscloud/data_source_genesyscloud_quality_forms_survey.go index c3f3d84ae..7c7544614 100644 --- a/genesyscloud/data_source_genesyscloud_quality_forms_survey.go +++ b/genesyscloud/data_source_genesyscloud_quality_forms_survey.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceQualityFormsSurvey() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_routing_email_domain.go b/genesyscloud/data_source_genesyscloud_routing_email_domain.go index 2e9266932..dadf36ac9 100644 --- a/genesyscloud/data_source_genesyscloud_routing_email_domain.go +++ b/genesyscloud/data_source_genesyscloud_routing_email_domain.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // Returns the schema for the routing email domain diff --git a/genesyscloud/data_source_genesyscloud_routing_email_domain_test.go b/genesyscloud/data_source_genesyscloud_routing_email_domain_test.go index f155f18b3..5afcebfd5 100644 --- a/genesyscloud/data_source_genesyscloud_routing_email_domain_test.go +++ b/genesyscloud/data_source_genesyscloud_routing_email_domain_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccDataSourceRoutingEmailDomain(t *testing.T) { diff --git a/genesyscloud/data_source_genesyscloud_routing_language.go b/genesyscloud/data_source_genesyscloud_routing_language.go index eeebd35e8..729080fc8 100644 --- a/genesyscloud/data_source_genesyscloud_routing_language.go +++ b/genesyscloud/data_source_genesyscloud_routing_language.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceRoutingLanguage() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_routing_skill.go b/genesyscloud/data_source_genesyscloud_routing_skill.go index 22bdf02dd..bf82e832d 100644 --- a/genesyscloud/data_source_genesyscloud_routing_skill.go +++ b/genesyscloud/data_source_genesyscloud_routing_skill.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // The context is now added without Timeout , diff --git a/genesyscloud/data_source_genesyscloud_routing_skill_group.go b/genesyscloud/data_source_genesyscloud_routing_skill_group.go index 5bb30ae14..cb5b51cce 100644 --- a/genesyscloud/data_source_genesyscloud_routing_skill_group.go +++ b/genesyscloud/data_source_genesyscloud_routing_skill_group.go @@ -3,13 +3,14 @@ package genesyscloud import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceRoutingSkillGroup() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_routing_wrapupcode.go b/genesyscloud/data_source_genesyscloud_routing_wrapupcode.go index 33d96f72b..c28a387e5 100644 --- a/genesyscloud/data_source_genesyscloud_routing_wrapupcode.go +++ b/genesyscloud/data_source_genesyscloud_routing_wrapupcode.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func DataSourceRoutingWrapupcode() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_user.go b/genesyscloud/data_source_genesyscloud_user.go index 42ce5df10..eb9e5f24a 100644 --- a/genesyscloud/data_source_genesyscloud_user.go +++ b/genesyscloud/data_source_genesyscloud_user.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func DataSourceUser() *schema.Resource { diff --git a/genesyscloud/data_source_genesyscloud_widget_deployment.go b/genesyscloud/data_source_genesyscloud_widget_deployment.go index 31b04b4de..472d8aa7e 100644 --- a/genesyscloud/data_source_genesyscloud_widget_deployment.go +++ b/genesyscloud/data_source_genesyscloud_widget_deployment.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceWidgetDeployments() *schema.Resource { diff --git a/genesyscloud/dependent_consumers/genesyscloud_dependent_consumer_proxy.go b/genesyscloud/dependent_consumers/genesyscloud_dependent_consumer_proxy.go index 1b806376d..5bfaea832 100644 --- a/genesyscloud/dependent_consumers/genesyscloud_dependent_consumer_proxy.go +++ b/genesyscloud/dependent_consumers/genesyscloud_dependent_consumer_proxy.go @@ -4,13 +4,14 @@ import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "strings" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" "terraform-provider-genesyscloud/genesyscloud/util/stringmap" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type DependentConsumerProxy struct { diff --git a/genesyscloud/employeeperformance_externalmetrics_definitions/genesyscloud_employeeperformance_externalmetrics_definitions_proxy.go b/genesyscloud/employeeperformance_externalmetrics_definitions/genesyscloud_employeeperformance_externalmetrics_definitions_proxy.go index 4f123630e..73fe26385 100644 --- a/genesyscloud/employeeperformance_externalmetrics_definitions/genesyscloud_employeeperformance_externalmetrics_definitions_proxy.go +++ b/genesyscloud/employeeperformance_externalmetrics_definitions/genesyscloud_employeeperformance_externalmetrics_definitions_proxy.go @@ -3,8 +3,9 @@ package employeeperformance_externalmetrics_definitions import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions.go b/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions.go index f8ff2b8c8..ff6b02b2c 100644 --- a/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions.go +++ b/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions.go @@ -3,9 +3,6 @@ package employeeperformance_externalmetrics_definitions import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -14,6 +11,10 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" "time" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" + "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" diff --git a/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions_test.go b/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions_test.go index 105eb00e5..d988ab237 100644 --- a/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions_test.go +++ b/genesyscloud/employeeperformance_externalmetrics_definitions/resource_genesyscloud_employeeperformance_externalmetrics_definitions_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceEmployeePerformanceExternalMetricsDefintions(t *testing.T) { diff --git a/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_proxy.go b/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_proxy.go index f624411ce..4530e2812 100644 --- a/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_proxy.go +++ b/genesyscloud/external_contacts/genesyscloud_externalcontacts_contact_proxy.go @@ -7,7 +7,7 @@ import ( rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact.go b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact.go index 98565b2ea..bc0f113fd 100644 --- a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact.go +++ b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_test.go b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_test.go index bf6c6c2b0..31b245525 100644 --- a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_test.go +++ b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_utils.go b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_utils.go index d7b3df901..2c2142ff6 100644 --- a/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_utils.go +++ b/genesyscloud/external_contacts/resource_genesyscloud_externalcontacts_contact_utils.go @@ -5,7 +5,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/nyaruka/phonenumbers" ) diff --git a/genesyscloud/flow_loglevel/genesyscloud_flow_loglevel_proxy.go b/genesyscloud/flow_loglevel/genesyscloud_flow_loglevel_proxy.go index 34437c34a..cd9193470 100644 --- a/genesyscloud/flow_loglevel/genesyscloud_flow_loglevel_proxy.go +++ b/genesyscloud/flow_loglevel/genesyscloud_flow_loglevel_proxy.go @@ -3,7 +3,8 @@ package flow_loglevel import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel.go b/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel.go index 0100e60ae..748ef1fd6 100644 --- a/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel.go +++ b/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel_test.go b/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel_test.go index acbf5cd6f..883241ef7 100644 --- a/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel_test.go +++ b/genesyscloud/flow_loglevel/resource_genesyscloud_flow_loglevel_test.go @@ -2,14 +2,15 @@ package flow_loglevel import ( "fmt" - "github.com/google/uuid" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/architect_flow" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "testing" + + "github.com/google/uuid" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceFlowLogLevel(t *testing.T) { diff --git a/genesyscloud/flow_milestone/genesyscloud_flow_milestone_proxy.go b/genesyscloud/flow_milestone/genesyscloud_flow_milestone_proxy.go index 932a45cc7..e6fc37bc1 100644 --- a/genesyscloud/flow_milestone/genesyscloud_flow_milestone_proxy.go +++ b/genesyscloud/flow_milestone/genesyscloud_flow_milestone_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone.go b/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone.go index b83780b75..67538cb90 100644 --- a/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone.go +++ b/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_test.go b/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_test.go index 2f26afbd0..eedf346fb 100644 --- a/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_test.go +++ b/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceFlowMilestone(t *testing.T) { diff --git a/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_utils.go b/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_utils.go index 46b801e53..78cea07b5 100644 --- a/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_utils.go +++ b/genesyscloud/flow_milestone/resource_genesyscloud_flow_milestone_utils.go @@ -2,7 +2,7 @@ package flow_milestone import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/flow_outcome/genesyscloud_flow_outcome_proxy.go b/genesyscloud/flow_outcome/genesyscloud_flow_outcome_proxy.go index 4aa3507bc..b2790b6bc 100644 --- a/genesyscloud/flow_outcome/genesyscloud_flow_outcome_proxy.go +++ b/genesyscloud/flow_outcome/genesyscloud_flow_outcome_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome.go b/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome.go index b36bf8781..89037d9ad 100644 --- a/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome.go +++ b/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome_utils.go b/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome_utils.go index efde6651e..2d143eb77 100644 --- a/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome_utils.go +++ b/genesyscloud/flow_outcome/resource_genesyscloud_flow_outcome_utils.go @@ -2,7 +2,7 @@ package flow_outcome import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/group/data_source_genesyscloud_group_test.go b/genesyscloud/group/data_source_genesyscloud_group_test.go index f69c4f037..548649fc7 100644 --- a/genesyscloud/group/data_source_genesyscloud_group_test.go +++ b/genesyscloud/group/data_source_genesyscloud_group_test.go @@ -10,7 +10,7 @@ import ( "time" "github.com/google/uuid" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" diff --git a/genesyscloud/group/genesyscloud_group_proxy.go b/genesyscloud/group/genesyscloud_group_proxy.go index 956ba6d43..a6a380c1a 100644 --- a/genesyscloud/group/genesyscloud_group_proxy.go +++ b/genesyscloud/group/genesyscloud_group_proxy.go @@ -3,8 +3,9 @@ package group import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *groupProxy diff --git a/genesyscloud/group/resource_genesyscloud_group.go b/genesyscloud/group/resource_genesyscloud_group.go index 60faa5abc..59f47ced5 100644 --- a/genesyscloud/group/resource_genesyscloud_group.go +++ b/genesyscloud/group/resource_genesyscloud_group.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func GetAllGroups(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { @@ -46,6 +46,7 @@ func createGroup(ctx context.Context, d *schema.ResourceData, meta interface{}) groupType := d.Get("type").(string) visibility := d.Get("visibility").(string) rulesVisible := d.Get("rules_visible").(bool) + rolesEnabled := d.Get("roles_enabled").(bool) sdkConfig := meta.(*provider.ProviderMeta).ClientConfig gp := getGroupProxy(sdkConfig) @@ -61,6 +62,7 @@ func createGroup(ctx context.Context, d *schema.ResourceData, meta interface{}) Visibility: &visibility, RulesVisible: &rulesVisible, Addresses: addresses, + RolesEnabled: &rolesEnabled, OwnerIds: lists.BuildSdkStringListFromInterfaceArray(d, "owner_ids"), } log.Printf("Creating group %s", name) @@ -111,6 +113,7 @@ func readGroup(ctx context.Context, d *schema.ResourceData, meta interface{}) di resourcedata.SetNillableValue(d, "visibility", group.Visibility) resourcedata.SetNillableValue(d, "rules_visible", group.RulesVisible) resourcedata.SetNillableValue(d, "description", group.Description) + resourcedata.SetNillableValue(d, "roles_enabled", group.RolesEnabled) resourcedata.SetNillableValueWithInterfaceArrayWithFunc(d, "owner_ids", group.Owners, flattenGroupOwners) @@ -136,6 +139,7 @@ func updateGroup(ctx context.Context, d *schema.ResourceData, meta interface{}) description := d.Get("description").(string) visibility := d.Get("visibility").(string) rulesVisible := d.Get("rules_visible").(bool) + rolesEnabled := d.Get("roles_enabled").(bool) sdkConfig := meta.(*provider.ProviderMeta).ClientConfig gp := getGroupProxy(sdkConfig) @@ -160,6 +164,7 @@ func updateGroup(ctx context.Context, d *schema.ResourceData, meta interface{}) Visibility: &visibility, RulesVisible: &rulesVisible, Addresses: addresses, + RolesEnabled: &rolesEnabled, OwnerIds: lists.BuildSdkStringListFromInterfaceArray(d, "owner_ids"), } _, resp, putErr := gp.updateGroup(ctx, d.Id(), updateGroup) diff --git a/genesyscloud/group/resource_genesyscloud_group_schema.go b/genesyscloud/group/resource_genesyscloud_group_schema.go index d4fcc109a..e26320623 100644 --- a/genesyscloud/group/resource_genesyscloud_group_schema.go +++ b/genesyscloud/group/resource_genesyscloud_group_schema.go @@ -1,12 +1,13 @@ package group import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" "terraform-provider-genesyscloud/genesyscloud/validators" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) const resourceName = "genesyscloud_group" @@ -120,6 +121,12 @@ func ResourceGroup() *schema.Resource { Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, }, + "roles_enabled": { + Description: "Allow roles to be assigned to this group.", + Type: schema.TypeBool, + Optional: true, + Default: true, + }, }, } } diff --git a/genesyscloud/group/resource_genesyscloud_group_test.go b/genesyscloud/group/resource_genesyscloud_group_test.go index f9658b391..c889d8a4b 100644 --- a/genesyscloud/group/resource_genesyscloud_group_test.go +++ b/genesyscloud/group/resource_genesyscloud_group_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceGroupBasic(t *testing.T) { @@ -44,6 +44,7 @@ func TestAccResourceGroupBasic(t *testing.T) { util.NullValue, // Default type util.NullValue, // Default visibility util.NullValue, // Default rules_visible + "roles_enabled = false", GenerateGroupOwners("genesyscloud_user."+testUserResource+".id"), ), Check: resource.ComposeTestCheckFunc( @@ -52,6 +53,7 @@ func TestAccResourceGroupBasic(t *testing.T) { resource.TestCheckResourceAttr("genesyscloud_group."+groupResource1, "description", groupDesc1), resource.TestCheckResourceAttr("genesyscloud_group."+groupResource1, "visibility", visPublic), resource.TestCheckResourceAttr("genesyscloud_group."+groupResource1, "rules_visible", util.TrueValue), + resource.TestCheckResourceAttr("genesyscloud_group."+groupResource1, "roles_enabled", util.FalseValue), ), }, { @@ -63,6 +65,7 @@ func TestAccResourceGroupBasic(t *testing.T) { strconv.Quote(typeOfficial), // Cannot change type strconv.Quote(visMembers), util.FalseValue, + "roles_enabled = true", GenerateGroupOwners("genesyscloud_user."+testUserResource+".id"), ), Check: resource.ComposeTestCheckFunc( @@ -71,6 +74,7 @@ func TestAccResourceGroupBasic(t *testing.T) { resource.TestCheckResourceAttr("genesyscloud_group."+groupResource1, "description", groupDesc2), resource.TestCheckResourceAttr("genesyscloud_group."+groupResource1, "visibility", visMembers), resource.TestCheckResourceAttr("genesyscloud_group."+groupResource1, "rules_visible", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_group."+groupResource1, "roles_enabled", util.TrueValue), func(s *terraform.State) error { time.Sleep(30 * time.Second) // Wait for 30 seconds for resources to get deleted properly return nil diff --git a/genesyscloud/group/resource_genesyscloud_group_utils.go b/genesyscloud/group/resource_genesyscloud_group_utils.go index b7b5652fe..1c93548fd 100644 --- a/genesyscloud/group/resource_genesyscloud_group_utils.go +++ b/genesyscloud/group/resource_genesyscloud_group_utils.go @@ -2,12 +2,13 @@ package group import ( "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "strings" "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // 'number' and 'extension' conflict with eachother. However, one must be set. diff --git a/genesyscloud/group_roles/genesyscloud_group_roles_proxy.go b/genesyscloud/group_roles/genesyscloud_group_roles_proxy.go index 87cb8703e..c868fe9c5 100644 --- a/genesyscloud/group_roles/genesyscloud_group_roles_proxy.go +++ b/genesyscloud/group_roles/genesyscloud_group_roles_proxy.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *groupRolesProxy diff --git a/genesyscloud/group_roles/resource_genesyscloud_group_roles_schema.go b/genesyscloud/group_roles/resource_genesyscloud_group_roles_schema.go index 7adf536f1..734573648 100644 --- a/genesyscloud/group_roles/resource_genesyscloud_group_roles_schema.go +++ b/genesyscloud/group_roles/resource_genesyscloud_group_roles_schema.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" diff --git a/genesyscloud/group_roles/resource_genesyscloud_group_roles_utils.go b/genesyscloud/group_roles/resource_genesyscloud_group_roles_utils.go index d1ecb34c9..3a9940d33 100644 --- a/genesyscloud/group_roles/resource_genesyscloud_group_roles_utils.go +++ b/genesyscloud/group_roles/resource_genesyscloud_group_roles_utils.go @@ -7,7 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func flattenSubjectRoles(d *schema.ResourceData, p *groupRolesProxy) (*schema.Set, *platformclientv2.APIResponse, error) { diff --git a/genesyscloud/idp_adfs/genesyscloud_idp_adfs_proxy.go b/genesyscloud/idp_adfs/genesyscloud_idp_adfs_proxy.go index a1825f1c1..d2284ab71 100644 --- a/genesyscloud/idp_adfs/genesyscloud_idp_adfs_proxy.go +++ b/genesyscloud/idp_adfs/genesyscloud_idp_adfs_proxy.go @@ -3,7 +3,7 @@ package idp_adfs import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs.go b/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs.go index cde86dead..c747406f9 100644 --- a/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs.go +++ b/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" @@ -69,10 +69,13 @@ func readIdpAdfs(ctx context.Context, d *schema.ResourceData, meta interface{}) return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read IDP ADFS: %s", getErr), resp)) } + resourcedata.SetNillableValue(d, "name", aDFS.Name) resourcedata.SetNillableValue(d, "disabled", aDFS.Disabled) resourcedata.SetNillableValue(d, "issuer_uri", aDFS.IssuerURI) resourcedata.SetNillableValue(d, "target_uri", aDFS.SsoTargetURI) resourcedata.SetNillableValue(d, "relying_party_identifier", aDFS.RelyingPartyIdentifier) + resourcedata.SetNillableValue(d, "slo_uri", aDFS.SloURI) + resourcedata.SetNillableValue(d, "slo_binding", aDFS.SloBinding) if aDFS.Certificate != nil { d.Set("certificates", lists.StringListToInterfaceList([]string{*aDFS.Certificate})) @@ -137,9 +140,12 @@ func deleteIdpAdfs(ctx context.Context, d *schema.ResourceData, meta interface{} // getIdpAdfsFromResourceData maps data from schema ResourceData object to a platformclientv2.Adfs func getIdpAdfsFromResourceData(d *schema.ResourceData) platformclientv2.Adfs { return platformclientv2.Adfs{ + Name: platformclientv2.String(d.Get("name").(string)), Disabled: platformclientv2.Bool(d.Get("disabled").(bool)), IssuerURI: platformclientv2.String(d.Get("issuer_uri").(string)), SsoTargetURI: platformclientv2.String(d.Get("target_uri").(string)), RelyingPartyIdentifier: platformclientv2.String(d.Get("relying_party_identifier").(string)), + SloURI: platformclientv2.String(d.Get("slo_uri").(string)), + SloBinding: platformclientv2.String(d.Get("slo_binding").(string)), } } diff --git a/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_schema.go b/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_schema.go index beb08620b..85e6db742 100644 --- a/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_schema.go +++ b/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_schema.go @@ -67,7 +67,7 @@ func ResourceIdpAdfs() *schema.Resource { Type: schema.TypeString, }, `slo_uri`: { - Description: `Provided by ADSF on app creation`, + Description: `Provided by ADFS on app creation`, Optional: true, Type: schema.TypeString, }, diff --git a/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_test.go b/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_test.go index ef089ab46..2f77a11f2 100644 --- a/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_test.go +++ b/genesyscloud/idp_adfs/resource_genesyscloud_idp_adfs_test.go @@ -7,17 +7,22 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "testing" + "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceIdpAdfs(t *testing.T) { var ( + name1 = "Test ADFS " + uuid.NewString() uri1 = "https://test.com/1" uri2 = "https://test.com/2" relyingPartyID1 = "test-id1" relyingPartyID2 = "test-id2" + uri3 = "https://example.com" + slo_binding1 = "HTTP Redirect" + slo_binding2 = "HTTP Post" ) resource.Test(t, resource.TestCase{ @@ -27,83 +32,111 @@ func TestAccResourceIdpAdfs(t *testing.T) { { // Create Config: generateIdpAdfsResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1)), uri1, uri2, util.NullValue, // No relying party ID util.NullValue, // Not disabled + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "name", name1), util.ValidateStringInArray("genesyscloud_idp_adfs.adfs", "certificates", util.TestCert1), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "issuer_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "target_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "relying_party_identifier", ""), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "slo_binding", slo_binding1), ), }, { // Update with new values Config: generateIdpAdfsResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert2)), uri2, uri1, strconv.Quote(relyingPartyID1), util.TrueValue, // disabled + uri3, + slo_binding2, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "name", name1), util.ValidateStringInArray("genesyscloud_idp_adfs.adfs", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "relying_party_identifier", relyingPartyID1), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "disabled", util.TrueValue), + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "slo_binding", slo_binding2), ), }, { // Update with multiple certs Config: generateIdpAdfsResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1), strconv.Quote(util.TestCert2)), uri2, uri1, strconv.Quote(relyingPartyID2), util.FalseValue, // disabled + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "name", name1), util.ValidateStringInArray("genesyscloud_idp_adfs.adfs", "certificates", util.TestCert1), util.ValidateStringInArray("genesyscloud_idp_adfs.adfs", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "relying_party_identifier", relyingPartyID2), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "slo_binding", slo_binding1), ), }, { // Update to one cert in array Config: generateIdpAdfsResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1)), uri2, uri1, strconv.Quote(relyingPartyID2), util.FalseValue, // disabled + uri3, + slo_binding2, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "name", name1), util.ValidateStringInArray("genesyscloud_idp_adfs.adfs", "certificates", util.TestCert1), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "certificates.#", "1"), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "relying_party_identifier", relyingPartyID2), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "slo_binding", slo_binding2), ), }, { // Update back to two certs in array Config: generateIdpAdfsResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1), strconv.Quote(util.TestCert2)), uri2, uri1, strconv.Quote(relyingPartyID2), util.FalseValue, // disabled + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "name", name1), util.ValidateStringInArray("genesyscloud_idp_adfs.adfs", "certificates", util.TestCert1), util.ValidateStringInArray("genesyscloud_idp_adfs.adfs", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "certificates.#", "2"), @@ -111,6 +144,8 @@ func TestAccResourceIdpAdfs(t *testing.T) { resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "relying_party_identifier", relyingPartyID2), resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_adfs.adfs", "slo_binding", slo_binding1), ), }, { @@ -125,19 +160,25 @@ func TestAccResourceIdpAdfs(t *testing.T) { } func generateIdpAdfsResource( + name string, certs string, issuerURI string, targetURI string, partyID string, - disabled string) string { + disabled string, + sloURI string, + sloBinding string) string { return fmt.Sprintf(`resource "genesyscloud_idp_adfs" "adfs" { + name = "%s" certificates = %s issuer_uri = "%s" target_uri = "%s" relying_party_identifier = %s disabled = %s + slo_uri = "%s" + slo_binding = "%s" } - `, certs, issuerURI, targetURI, partyID, disabled) + `, name, certs, issuerURI, targetURI, partyID, disabled, sloURI, sloBinding) } func testVerifyIdpAdfsDestroyed(state *terraform.State) error { diff --git a/genesyscloud/idp_generic/genesyscloud_idp_generic_proxy.go b/genesyscloud/idp_generic/genesyscloud_idp_generic_proxy.go new file mode 100644 index 000000000..8aeda9acc --- /dev/null +++ b/genesyscloud/idp_generic/genesyscloud_idp_generic_proxy.go @@ -0,0 +1,87 @@ +package idp_generic + +import ( + "context" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" +) + +/* +The genesyscloud_idp_generic_proxy.go file contains the proxy structures and methods that interact +with the Genesys Cloud SDK. We use composition here for each function on the proxy so individual functions can be stubbed +out during testing. +*/ + +// internalProxy holds a proxy instance that can be used throughout the package +var internalProxy *idpGenericProxy + +// Type definitions for each func on our proxy so we can easily mock them out later +type getIdpGenericFunc func(ctx context.Context, p *idpGenericProxy) (*platformclientv2.Genericsaml, *platformclientv2.APIResponse, error) +type updateIdpGenericFunc func(ctx context.Context, p *idpGenericProxy, id string, genericSAML *platformclientv2.Genericsaml) (*platformclientv2.Identityprovider, *platformclientv2.APIResponse, error) +type deleteIdpGenericFunc func(ctx context.Context, p *idpGenericProxy, id string) (response *platformclientv2.APIResponse, err error) + +// idpGenericProxy contains all of the methods that call genesys cloud APIs. +type idpGenericProxy struct { + clientConfig *platformclientv2.Configuration + identityProviderApi *platformclientv2.IdentityProviderApi + getIdpGenericAttr getIdpGenericFunc + updateIdpGenericAttr updateIdpGenericFunc + deleteIdpGenericAttr deleteIdpGenericFunc +} + +// newIdpGenericProxy initializes the idp generic proxy with all of the data needed to communicate with Genesys Cloud +func newIdpGenericProxy(clientConfig *platformclientv2.Configuration) *idpGenericProxy { + api := platformclientv2.NewIdentityProviderApiWithConfig(clientConfig) + return &idpGenericProxy{ + clientConfig: clientConfig, + identityProviderApi: api, + getIdpGenericAttr: getIdpGenericFn, + updateIdpGenericAttr: updateIdpGenericFn, + deleteIdpGenericAttr: deleteIdpGenericFn, + } +} + +// getIdpGenericProxy acts as a singleton to for the internalProxy. It also ensures +// that we can still proxy our tests by directly setting internalProxy package variable +func getIdpGenericProxy(clientConfig *platformclientv2.Configuration) *idpGenericProxy { + if internalProxy == nil { + internalProxy = newIdpGenericProxy(clientConfig) + } + + return internalProxy +} + +// getIdpGeneric retrieves all Genesys Cloud idp generic +func (p *idpGenericProxy) getIdpGeneric(ctx context.Context) (*platformclientv2.Genericsaml, *platformclientv2.APIResponse, error) { + return p.getIdpGenericAttr(ctx, p) +} + +// updateIdpGeneric updates a Genesys Cloud idp generic +func (p *idpGenericProxy) updateIdpGeneric(ctx context.Context, id string, idpGeneric *platformclientv2.Genericsaml) (*platformclientv2.Identityprovider, *platformclientv2.APIResponse, error) { + return p.updateIdpGenericAttr(ctx, p, id, idpGeneric) +} + +// deleteIdpGeneric deletes a Genesys Cloud idp generic by Id +func (p *idpGenericProxy) deleteIdpGeneric(ctx context.Context, id string) (resp *platformclientv2.APIResponse, err error) { + return p.deleteIdpGenericAttr(ctx, p, id) +} + +// getIdpGenericFn is the implementation for retrieving all idp generic in Genesys Cloud +func getIdpGenericFn(ctx context.Context, p *idpGenericProxy) (*platformclientv2.Genericsaml, *platformclientv2.APIResponse, error) { + return p.identityProviderApi.GetIdentityprovidersGeneric() +} + +// updateIdpGenericFn is an implementation of the function to update a Genesys Cloud idp generic +func updateIdpGenericFn(ctx context.Context, p *idpGenericProxy, id string, idpGeneric *platformclientv2.Genericsaml) (*platformclientv2.Identityprovider, *platformclientv2.APIResponse, error) { + return p.identityProviderApi.PutIdentityprovidersGeneric(*idpGeneric) +} + +// deleteIdpGenericFn is an implementation function for deleting a Genesys Cloud idp generic +func deleteIdpGenericFn(ctx context.Context, p *idpGenericProxy, id string) (response *platformclientv2.APIResponse, err error) { + _, resp, err := p.identityProviderApi.DeleteIdentityprovidersGeneric() + if err != nil { + return resp, err + } + + return resp, err +} diff --git a/genesyscloud/idp_generic/resource_genesyscloud_idp_generic.go b/genesyscloud/idp_generic/resource_genesyscloud_idp_generic.go new file mode 100644 index 000000000..a72f05274 --- /dev/null +++ b/genesyscloud/idp_generic/resource_genesyscloud_idp_generic.go @@ -0,0 +1,162 @@ +package idp_generic + +import ( + "context" + "fmt" + "log" + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + "terraform-provider-genesyscloud/genesyscloud/util" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" + + "terraform-provider-genesyscloud/genesyscloud/consistency_checker" + + "terraform-provider-genesyscloud/genesyscloud/util/constants" + "terraform-provider-genesyscloud/genesyscloud/util/lists" + "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" +) + +/* +The resource_genesyscloud_idp_generic.go contains all of the methods that perform the core logic for a resource. +*/ + +// getAllAuthIdpGeneric retrieves all of the idp generic via Terraform in the Genesys Cloud and is used for the exporter +func getAllAuthIdpGenerics(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { + proxy := getIdpGenericProxy(clientConfig) + resources := make(resourceExporter.ResourceIDMetaMap) + + _, resp, getErr := proxy.getIdpGeneric(ctx) + if getErr != nil { + if util.IsStatus404(resp) { + // Don't export if config doesn't exist + return resources, nil + } + return nil, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to get IDP Generic error: %s", getErr), resp) + } + + resources["0"] = &resourceExporter.ResourceMeta{Name: "generic"} + return resources, nil +} + +// createIdpGeneric is used by the idp_generic resource to create Genesys cloud idp generic +func createIdpGeneric(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + log.Printf("Creating IDP Generic") + d.SetId("generic") + return updateIdpGeneric(ctx, d, meta) +} + +// readIdpGeneric is used by the idp_generic resource to read an idp generic from genesys cloud +func readIdpGeneric(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getIdpGenericProxy(sdkConfig) + + log.Printf("Reading idp generic %s", d.Id()) + + cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceIdpGeneric(), constants.DefaultConsistencyChecks, resourceName) + + return util.WithRetriesForReadCustomTimeout(ctx, d.Timeout(schema.TimeoutRead), d, func() *retry.RetryError { + genericSAML, resp, getErr := proxy.getIdpGeneric(ctx) + if getErr != nil { + if util.IsStatus404(resp) { + createIdpGeneric(ctx, d, meta) + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read IDP Generic: %s", getErr), resp)) + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read IDP Generic: %s", getErr), resp)) + } + + resourcedata.SetNillableValue(d, "name", genericSAML.Name) + resourcedata.SetNillableValue(d, "disabled", genericSAML.Disabled) + resourcedata.SetNillableValue(d, "issuer_uri", genericSAML.IssuerURI) + resourcedata.SetNillableValue(d, "target_uri", genericSAML.SsoTargetURI) + resourcedata.SetNillableValue(d, "slo_uri", genericSAML.SloURI) + resourcedata.SetNillableValue(d, "slo_binding", genericSAML.SloBinding) + resourcedata.SetNillableValue(d, "relying_party_identifier", genericSAML.RelyingPartyIdentifier) + resourcedata.SetNillableValue(d, "logo_image_data", genericSAML.LogoImageData) + resourcedata.SetNillableValue(d, "endpoint_compression", genericSAML.EndpointCompression) + resourcedata.SetNillableValue(d, "name_identifier_format", genericSAML.NameIdentifierFormat) + + if genericSAML.Certificate != nil { + d.Set("certificates", lists.StringListToInterfaceList([]string{*genericSAML.Certificate})) + } else if genericSAML.Certificates != nil { + d.Set("certificates", lists.StringListToInterfaceList(*genericSAML.Certificates)) + } else { + d.Set("certificates", nil) + } + + log.Printf("Read idp generic %s %s", d.Id(), *genericSAML.Name) + return cc.CheckState(d) + }) +} + +// updateIdpGeneric is used by the idp_generic resource to update an idp generic in Genesys Cloud +func updateIdpGeneric(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getIdpGenericProxy(sdkConfig) + + idpGeneric := getIdpGenericFromResourceData(d) + + log.Printf("Updating idp generic %s", *idpGeneric.Name) + + certificates := lists.BuildSdkStringListFromInterfaceArray(d, "certificates") + if certificates != nil { + if len(*certificates) == 1 { + idpGeneric.Certificate = &(*certificates)[0] + } + idpGeneric.Certificates = certificates + } + + _, resp, err := proxy.updateIdpGeneric(ctx, d.Id(), &idpGeneric) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to update IDP Generic %s error: %s", d.Id(), err), resp) + } + + log.Printf("Updated idp generic") + return readIdpGeneric(ctx, d, meta) +} + +// deleteIdpGeneric is used by the idp_generic resource to delete an idp generic from Genesys cloud +func deleteIdpGeneric(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getIdpGenericProxy(sdkConfig) + + resp, err := proxy.deleteIdpGeneric(ctx, d.Id()) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to delete IDP Generic %s error: %s", d.Id(), err), resp) + } + + return util.WithRetries(ctx, 60*time.Second, func() *retry.RetryError { + _, resp, err := proxy.getIdpGeneric(ctx) + + if err != nil { + if util.IsStatus404(resp) { + // IDP Generic deleted + log.Printf("Deleted IDP Generic") + return nil + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Error deleting IDP Generic: %s", err), resp)) + } + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("IDP Generic still exists"), resp)) + }) +} + +// getIdpGenericFromResourceData maps data from schema ResourceData object to a platformclientv2.Genericsaml +func getIdpGenericFromResourceData(d *schema.ResourceData) platformclientv2.Genericsaml { + return platformclientv2.Genericsaml{ + Name: platformclientv2.String(d.Get("name").(string)), + Disabled: platformclientv2.Bool(d.Get("disabled").(bool)), + IssuerURI: platformclientv2.String(d.Get("issuer_uri").(string)), + SsoTargetURI: platformclientv2.String(d.Get("target_uri").(string)), + RelyingPartyIdentifier: platformclientv2.String(d.Get("relying_party_identifier").(string)), + LogoImageData: platformclientv2.String(d.Get("logo_image_data").(string)), + EndpointCompression: platformclientv2.Bool(d.Get("endpoint_compression").(bool)), + NameIdentifierFormat: platformclientv2.String(d.Get("name_identifier_format").(string)), + SloURI: platformclientv2.String(d.Get("slo_uri").(string)), + SloBinding: platformclientv2.String(d.Get("slo_binding").(string)), + } +} diff --git a/genesyscloud/idp_generic/resource_genesyscloud_idp_generic_init_test.go b/genesyscloud/idp_generic/resource_genesyscloud_idp_generic_init_test.go new file mode 100644 index 000000000..25e259220 --- /dev/null +++ b/genesyscloud/idp_generic/resource_genesyscloud_idp_generic_init_test.go @@ -0,0 +1,46 @@ +package idp_generic + +import ( + "sync" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +/* + The genesyscloud_idp_generic_init_test.go file is used to initialize the resources + used in testing the idp_generic resource. +*/ + +// providerResources holds a map of all registered resources +var providerResources map[string]*schema.Resource + +type registerTestInstance struct { + resourceMapMutex sync.RWMutex +} + +// registerTestResources registers all resources used in the tests +func (r *registerTestInstance) registerTestResources() { + r.resourceMapMutex.Lock() + defer r.resourceMapMutex.Unlock() + + providerResources[resourceName] = ResourceIdpGeneric() +} + +// initTestResources initializes all test_data resources. +func initTestResources() { + providerResources = make(map[string]*schema.Resource) + + regInstance := ®isterTestInstance{} + + regInstance.registerTestResources() +} + +// TestMain is a "setup" function called by the testing framework when run the test_data +func TestMain(m *testing.M) { + // Run setup function before starting the test_data suite for the idp_generic package + initTestResources() + + // Run the test_data suite for the idp_generic package + m.Run() +} diff --git a/genesyscloud/idp_generic/resource_genesyscloud_idp_generic_schema.go b/genesyscloud/idp_generic/resource_genesyscloud_idp_generic_schema.go new file mode 100644 index 000000000..cb5806bca --- /dev/null +++ b/genesyscloud/idp_generic/resource_genesyscloud_idp_generic_schema.go @@ -0,0 +1,130 @@ +package idp_generic + +import ( + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" +) + +/* +resource_genesycloud_idp_generic_schema.go holds four functions within it: + +1. The registration code that registers the Datasource, Resource and Exporter for the package. +2. The resource schema definitions for the idp_generic resource. +3. The datasource schema definitions for the idp_generic datasource. +4. The resource exporter configuration for the idp_generic exporter. +*/ +const resourceName = "genesyscloud_idp_generic" + +// SetRegistrar registers all of the resources, datasources and exporters in the package +func SetRegistrar(regInstance registrar.Registrar) { + regInstance.RegisterResource(resourceName, ResourceIdpGeneric()) + regInstance.RegisterExporter(resourceName, IdpGenericExporter()) +} + +// ResourceIdpGeneric registers the genesyscloud_idp_generic resource with Terraform +func ResourceIdpGeneric() *schema.Resource { + return &schema.Resource{ + Description: `Genesys Cloud Single Sign-on Generic Identity Provider. See this page for detailed configuration instructions: https://help.mypurecloud.com/articles/add-a-generic-single-sign-on-provider/`, + + CreateContext: provider.CreateWithPooledClient(createIdpGeneric), + ReadContext: provider.ReadWithPooledClient(readIdpGeneric), + UpdateContext: provider.UpdateWithPooledClient(updateIdpGeneric), + DeleteContext: provider.DeleteWithPooledClient(deleteIdpGeneric), + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + SchemaVersion: 1, + Timeouts: &schema.ResourceTimeout{ + Update: schema.DefaultTimeout(8 * time.Minute), + Read: schema.DefaultTimeout(8 * time.Minute), + }, + Schema: map[string]*schema.Schema{ + `name`: { + Description: `Name of the provider.`, + Required: true, + Type: schema.TypeString, + }, + `disabled`: { + Description: `True if Generic provider is disabled.`, + Optional: true, + Default: false, + Type: schema.TypeBool, + }, + `issuer_uri`: { + Description: `Issuer URI provided by the provider.`, + Required: true, + Type: schema.TypeString, + }, + `target_uri`: { + Description: `Target URI provided by the provider.`, + Optional: true, + Type: schema.TypeString, + }, + `slo_uri`: { + Description: `Provided on app creation.`, + Optional: true, + Type: schema.TypeString, + }, + `slo_binding`: { + Description: `Valid values: HTTP Redirect, HTTP Post`, + Optional: true, + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice([]string{`HTTP Redirect`, `HTTP Post`}, false), + }, + `relying_party_identifier`: { + Description: `String used to identify Genesys Cloud to the identity provider.`, + Optional: true, + Type: schema.TypeString, + }, + `certificates`: { + Description: `PEM or DER encoded public X.509 certificates for SAML signature validation.`, + Required: true, + Type: schema.TypeList, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + `logo_image_data`: { + Description: `Base64 encoded SVG image.`, + Optional: true, + Type: schema.TypeString, + }, + `endpoint_compression`: { + Description: `True if the Genesys Cloud authentication request should be compressed.`, + Optional: true, + Type: schema.TypeBool, + Default: false, + }, + `name_identifier_format`: { + Description: `SAML name identifier format. (urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified | urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress | urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName | urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName | urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos | urn:oasis:names:tc:SAML:2.0:nameid-format:entity | urn:oasis:names:tc:SAML:2.0:nameid-format:persistent | urn:oasis:names:tc:SAML:2.0:nameid-format:transient)`, + Type: schema.TypeString, + Optional: true, + Default: `urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified`, + ValidateFunc: validation.StringInSlice([]string{ + `urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified`, + `urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress`, + `urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName`, + `urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName`, + `urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos`, + `urn:oasis:names:tc:SAML:2.0:nameid-format:entity`, + `urn:oasis:names:tc:SAML:2.0:nameid-format:persistent`, + `urn:oasis:names:tc:SAML:2.0:nameid-format:transient`, + }, false), + }, + }, + } +} + +// IdpGenericExporter returns the resourceExporter object used to hold the genesyscloud_idp_generic exporter's config +func IdpGenericExporter() *resourceExporter.ResourceExporter { + return &resourceExporter.ResourceExporter{ + GetResourcesFunc: provider.GetAllWithPooledClient(getAllAuthIdpGenerics), + RefAttrs: map[string]*resourceExporter.RefAttrSettings{ + // TODO: Add any reference attributes here + }, + } +} diff --git a/genesyscloud/resource_genesyscloud_idp_generic_test.go b/genesyscloud/idp_generic/resource_genesyscloud_idp_generic_test.go similarity index 85% rename from genesyscloud/resource_genesyscloud_idp_generic_test.go rename to genesyscloud/idp_generic/resource_genesyscloud_idp_generic_test.go index 6043d440d..fa9a266f9 100644 --- a/genesyscloud/resource_genesyscloud_idp_generic_test.go +++ b/genesyscloud/idp_generic/resource_genesyscloud_idp_generic_test.go @@ -1,4 +1,4 @@ -package genesyscloud +package idp_generic import ( "fmt" @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceIdpGeneric(t *testing.T) { @@ -23,11 +23,14 @@ func TestAccResourceIdpGeneric(t *testing.T) { nameIDFormatDefault = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" nameIDFormatEmail = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" base64Img = "PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvM" + uri3 = "https://example.com" + slo_binding1 = "HTTP Redirect" + slo_binding2 = "HTTP Post" ) resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) }, - ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + ProviderFactories: provider.GetProviderFactories(providerResources, nil), Steps: []resource.TestStep{ { // Create @@ -41,6 +44,8 @@ func TestAccResourceIdpGeneric(t *testing.T) { util.NullValue, // no image util.NullValue, // No endpoint compression util.NullValue, // Default name ID format + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "name", name1), @@ -52,6 +57,8 @@ func TestAccResourceIdpGeneric(t *testing.T) { resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "logo_image_data", ""), resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "endpoint_compression", util.FalseValue), resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "name_identifier_format", nameIDFormatDefault), + resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "slo_binding", slo_binding1), ), }, { @@ -66,6 +73,8 @@ func TestAccResourceIdpGeneric(t *testing.T) { strconv.Quote(base64Img), util.TrueValue, // Endpoint compression strconv.Quote(nameIDFormatEmail), + uri3, + slo_binding2, ), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "name", name2), @@ -77,6 +86,8 @@ func TestAccResourceIdpGeneric(t *testing.T) { resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "logo_image_data", base64Img), resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "endpoint_compression", util.TrueValue), resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "name_identifier_format", nameIDFormatEmail), + resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "slo_binding", slo_binding2), ), }, { @@ -91,6 +102,8 @@ func TestAccResourceIdpGeneric(t *testing.T) { strconv.Quote(base64Img), util.TrueValue, // Endpoint compression strconv.Quote(nameIDFormatEmail), + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "name", name2), @@ -100,6 +113,8 @@ func TestAccResourceIdpGeneric(t *testing.T) { resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "relying_party_identifier", relyingPartyID2), resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "slo_binding", slo_binding1), ), }, { @@ -114,6 +129,8 @@ func TestAccResourceIdpGeneric(t *testing.T) { strconv.Quote(base64Img), util.TrueValue, // Endpoint compression strconv.Quote(nameIDFormatEmail), + uri3, + slo_binding2, ), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "name", name2), @@ -123,6 +140,8 @@ func TestAccResourceIdpGeneric(t *testing.T) { resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "relying_party_identifier", relyingPartyID2), resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "slo_binding", slo_binding2), ), }, { @@ -137,6 +156,8 @@ func TestAccResourceIdpGeneric(t *testing.T) { strconv.Quote(base64Img), util.TrueValue, // Endpoint compression strconv.Quote(nameIDFormatEmail), + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "name", name2), @@ -147,6 +168,8 @@ func TestAccResourceIdpGeneric(t *testing.T) { resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "relying_party_identifier", relyingPartyID2), resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_generic.generic", "slo_binding", slo_binding1), ), }, { @@ -169,7 +192,9 @@ func generateIdpGenericResource( disabled string, logoImageData string, endpointCompression string, - nameIDFormat string) string { + nameIDFormat string, + sloURI string, + sloBinding string) string { return fmt.Sprintf(`resource "genesyscloud_idp_generic" "generic" { name = "%s" certificates = %s @@ -180,8 +205,10 @@ func generateIdpGenericResource( logo_image_data = %s endpoint_compression = %s name_identifier_format = %s + slo_uri = "%s" + slo_binding = "%s" } - `, name, certs, issuerURI, targetURI, partyID, disabled, logoImageData, endpointCompression, nameIDFormat) + `, name, certs, issuerURI, targetURI, partyID, disabled, logoImageData, endpointCompression, nameIDFormat, sloURI, sloBinding) } func testVerifyIdpGenericDestroyed(state *terraform.State) error { diff --git a/genesyscloud/idp_gsuite/genesyscloud_idp_gsuite_proxy.go b/genesyscloud/idp_gsuite/genesyscloud_idp_gsuite_proxy.go new file mode 100644 index 000000000..820b555d5 --- /dev/null +++ b/genesyscloud/idp_gsuite/genesyscloud_idp_gsuite_proxy.go @@ -0,0 +1,88 @@ +package idp_gsuite + +import ( + "context" + "fmt" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" +) + +/* +The genesyscloud_idp_gsuite_proxy.go file contains the proxy structures and methods that interact +with the Genesys Cloud SDK. We use composition here for each function on the proxy so individual functions can be stubbed +out during testing. +*/ + +// internalProxy holds a proxy instance that can be used throughout the package +var internalProxy *idpGsuiteProxy + +// Type definitions for each func on our proxy so we can easily mock them out later +type getIdpGsuiteFunc func(ctx context.Context, p *idpGsuiteProxy) (*platformclientv2.Gsuite, *platformclientv2.APIResponse, error) +type updateIdpGsuiteFunc func(ctx context.Context, p *idpGsuiteProxy, id string, gSuite *platformclientv2.Gsuite) (*platformclientv2.Identityprovider, *platformclientv2.APIResponse, error) +type deleteIdpGsuiteFunc func(ctx context.Context, p *idpGsuiteProxy, id string) (response *platformclientv2.APIResponse, err error) + +// idpGsuiteProxy contains all of the methods that call genesys cloud APIs. +type idpGsuiteProxy struct { + clientConfig *platformclientv2.Configuration + identityProviderApi *platformclientv2.IdentityProviderApi + getIdpGsuiteAttr getIdpGsuiteFunc + updateIdpGsuiteAttr updateIdpGsuiteFunc + deleteIdpGsuiteAttr deleteIdpGsuiteFunc +} + +// newIdpGsuiteProxy initializes the idp gsuite proxy with all of the data needed to communicate with Genesys Cloud +func newIdpGsuiteProxy(clientConfig *platformclientv2.Configuration) *idpGsuiteProxy { + api := platformclientv2.NewIdentityProviderApiWithConfig(clientConfig) + return &idpGsuiteProxy{ + clientConfig: clientConfig, + identityProviderApi: api, + getIdpGsuiteAttr: getIdpGsuiteFn, + updateIdpGsuiteAttr: updateIdpGsuiteFn, + deleteIdpGsuiteAttr: deleteIdpGsuiteFn, + } +} + +// getIdpGsuiteProxy acts as a singleton to for the internalProxy. It also ensures +// that we can still proxy our tests by directly setting internalProxy package variable +func getIdpGsuiteProxy(clientConfig *platformclientv2.Configuration) *idpGsuiteProxy { + if internalProxy == nil { + internalProxy = newIdpGsuiteProxy(clientConfig) + } + + return internalProxy +} + +// getIdpGsuite retrieves all Genesys Cloud idp gsuite +func (p *idpGsuiteProxy) getIdpGsuite(ctx context.Context) (*platformclientv2.Gsuite, *platformclientv2.APIResponse, error) { + return p.getIdpGsuiteAttr(ctx, p) +} + +// updateIdpGsuite updates a Genesys Cloud idp gsuite +func (p *idpGsuiteProxy) updateIdpGsuite(ctx context.Context, id string, idpGsuite *platformclientv2.Gsuite) (*platformclientv2.Identityprovider, *platformclientv2.APIResponse, error) { + return p.updateIdpGsuiteAttr(ctx, p, id, idpGsuite) +} + +// deleteIdpGsuite deletes a Genesys Cloud idp gsuite by Id +func (p *idpGsuiteProxy) deleteIdpGsuite(ctx context.Context, id string) (response *platformclientv2.APIResponse, err error) { + return p.deleteIdpGsuiteAttr(ctx, p, id) +} + +// getIdpGsuiteFn is the implementation for retrieving all idp gsuite in Genesys Cloud +func getIdpGsuiteFn(ctx context.Context, p *idpGsuiteProxy) (*platformclientv2.Gsuite, *platformclientv2.APIResponse, error) { + return p.identityProviderApi.GetIdentityprovidersGsuite() +} + +// updateIdpGsuiteFn is an implementation of the function to update a Genesys Cloud idp gsuite +func updateIdpGsuiteFn(ctx context.Context, p *idpGsuiteProxy, id string, idpGsuite *platformclientv2.Gsuite) (*platformclientv2.Identityprovider, *platformclientv2.APIResponse, error) { + return p.identityProviderApi.PutIdentityprovidersGsuite(*idpGsuite) +} + +// deleteIdpGsuiteFn is an implementation function for deleting a Genesys Cloud idp gsuite +func deleteIdpGsuiteFn(ctx context.Context, p *idpGsuiteProxy, id string) (response *platformclientv2.APIResponse, err error) { + _, resp, err := p.identityProviderApi.DeleteIdentityprovidersGsuite() + if err != nil { + return resp, fmt.Errorf("Failed to delete idp gsuite: %s", err) + } + + return resp, err +} diff --git a/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite.go b/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite.go new file mode 100644 index 000000000..e9b32c0e3 --- /dev/null +++ b/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite.go @@ -0,0 +1,156 @@ +package idp_gsuite + +import ( + "context" + "fmt" + "log" + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + "terraform-provider-genesyscloud/genesyscloud/util" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" + + "terraform-provider-genesyscloud/genesyscloud/consistency_checker" + + "terraform-provider-genesyscloud/genesyscloud/util/constants" + "terraform-provider-genesyscloud/genesyscloud/util/lists" + "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" +) + +/* +The resource_genesyscloud_idp_gsuite.go contains all of the methods that perform the core logic for a resource. +*/ + +// getAllAuthIdpGsuite retrieves all of the idp gsuite via Terraform in the Genesys Cloud and is used for the exporter +func getAllAuthIdpGsuites(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { + proxy := getIdpGsuiteProxy(clientConfig) + resources := make(resourceExporter.ResourceIDMetaMap) + + _, resp, err := proxy.getIdpGsuite(ctx) + if err != nil { + if util.IsStatus404(resp) { + // Don't export if config doesn't exist + return resources, nil + } + return nil, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to get IDP GSuite error: %s", err), resp) + } + + resources["0"] = &resourceExporter.ResourceMeta{Name: "gsuite"} + return resources, nil +} + +// createIdpGsuite is used by the idp_gsuite resource to create Genesys cloud idp gsuite +func createIdpGsuite(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + log.Printf("Creating IDP GSuite") + d.SetId("gsuite") + return updateIdpGsuite(ctx, d, meta) +} + +// readIdpGsuite is used by the idp_gsuite resource to read an idp gsuite from genesys cloud +func readIdpGsuite(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getIdpGsuiteProxy(sdkConfig) + + log.Printf("Reading idp gsuite") + + cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceIdpGsuite(), constants.DefaultConsistencyChecks, resourceName) + + return util.WithRetriesForReadCustomTimeout(ctx, d.Timeout(schema.TimeoutRead), d, func() *retry.RetryError { + gSuite, resp, getErr := proxy.getIdpGsuite(ctx) + if getErr != nil { + if util.IsStatus404(resp) { + createIdpGsuite(ctx, d, meta) + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read IDP GSuite: %s", getErr), resp)) + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read IDP GSuite: %s", getErr), resp)) + } + + resourcedata.SetNillableValue(d, "name", gSuite.Name) + resourcedata.SetNillableValue(d, "disabled", gSuite.Disabled) + resourcedata.SetNillableValue(d, "issuer_uri", gSuite.IssuerURI) + resourcedata.SetNillableValue(d, "target_uri", gSuite.SsoTargetURI) + resourcedata.SetNillableValue(d, "relying_party_identifier", gSuite.RelyingPartyIdentifier) + resourcedata.SetNillableValue(d, "slo_uri", gSuite.SloURI) + resourcedata.SetNillableValue(d, "slo_binding", gSuite.SloBinding) + + if gSuite.Certificate != nil { + d.Set("certificates", lists.StringListToInterfaceList([]string{*gSuite.Certificate})) + } else if gSuite.Certificates != nil { + d.Set("certificates", lists.StringListToInterfaceList(*gSuite.Certificates)) + } else { + d.Set("certificates", nil) + } + + log.Printf("Read idp gsuite") + return cc.CheckState(d) + }) +} + +// updateIdpGsuite is used by the idp_gsuite resource to update an idp gsuite in Genesys Cloud +func updateIdpGsuite(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getIdpGsuiteProxy(sdkConfig) + + idpGsuite := getIdpGsuiteFromResourceData(d) + + log.Printf("Updating idp gsuite") + + certificates := lists.BuildSdkStringListFromInterfaceArray(d, "certificates") + if certificates != nil { + if len(*certificates) == 1 { + idpGsuite.Certificate = &(*certificates)[0] + } + idpGsuite.Certificates = certificates + } + + _, resp, err := proxy.updateIdpGsuite(ctx, d.Id(), &idpGsuite) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to update IDP GSuite %s error: %s", d.Id(), err), resp) + } + + log.Printf("Updated idp gsuite") + return readIdpGsuite(ctx, d, meta) +} + +// deleteIdpGsuite is used by the idp_gsuite resource to delete an idp gsuite from Genesys cloud +func deleteIdpGsuite(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getIdpGsuiteProxy(sdkConfig) + + resp, err := proxy.deleteIdpGsuite(ctx, d.Id()) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to delete IDP GSuite %s error: %s", d.Id(), err), resp) + } + + return util.WithRetries(ctx, 60*time.Second, func() *retry.RetryError { + _, resp, err := proxy.getIdpGsuite(ctx) + + if err != nil { + if util.IsStatus404(resp) { + // IDP GSuite deleted + log.Printf("Deleted IDP GSuite") + return nil + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Error deleting IDP GSuite: %s", err), resp)) + } + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("IDP GSuite still exists"), resp)) + }) +} + +// getIdpGsuiteFromResourceData maps data from schema ResourceData object to a platformclientv2.Gsuite +func getIdpGsuiteFromResourceData(d *schema.ResourceData) platformclientv2.Gsuite { + return platformclientv2.Gsuite{ + Name: platformclientv2.String(d.Get("name").(string)), + Disabled: platformclientv2.Bool(d.Get("disabled").(bool)), + IssuerURI: platformclientv2.String(d.Get("issuer_uri").(string)), + SsoTargetURI: platformclientv2.String(d.Get("target_uri").(string)), + RelyingPartyIdentifier: platformclientv2.String(d.Get("relying_party_identifier").(string)), + SloURI: platformclientv2.String(d.Get("slo_uri").(string)), + SloBinding: platformclientv2.String(d.Get("slo_binding").(string)), + } +} diff --git a/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_init_test.go b/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_init_test.go new file mode 100644 index 000000000..bde036306 --- /dev/null +++ b/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_init_test.go @@ -0,0 +1,46 @@ +package idp_gsuite + +import ( + "sync" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +/* + The genesyscloud_idp_gsuite_init_test.go file is used to initialize the resources + used in testing the idp_gsuite resource. +*/ + +// providerResources holds a map of all registered resources +var providerResources map[string]*schema.Resource + +type registerTestInstance struct { + resourceMapMutex sync.RWMutex +} + +// registerTestResources registers all resources used in the tests +func (r *registerTestInstance) registerTestResources() { + r.resourceMapMutex.Lock() + defer r.resourceMapMutex.Unlock() + + providerResources[resourceName] = ResourceIdpGsuite() +} + +// initTestResources initializes all test_data resources. +func initTestResources() { + providerResources = make(map[string]*schema.Resource) + + regInstance := ®isterTestInstance{} + + regInstance.registerTestResources() +} + +// TestMain is a "setup" function called by the testing framework when run the test_data +func TestMain(m *testing.M) { + // Run setup function before starting the test_data suite for the idp_gsuite package + initTestResources() + + // Run the test_data suite for the idp_gsuite package + m.Run() +} diff --git a/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_schema.go b/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_schema.go new file mode 100644 index 000000000..6a9f80034 --- /dev/null +++ b/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_schema.go @@ -0,0 +1,103 @@ +package idp_gsuite + +import ( + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" +) + +/* +resource_genesycloud_idp_gsuite_schema.go holds four functions within it: + +1. The registration code that registers the Datasource, Resource and Exporter for the package. +2. The resource schema definitions for the idp_gsuite resource. +3. The datasource schema definitions for the idp_gsuite datasource. +4. The resource exporter configuration for the idp_gsuite exporter. +*/ +const resourceName = "genesyscloud_idp_gsuite" + +// SetRegistrar registers all of the resources, datasources and exporters in the package +func SetRegistrar(regInstance registrar.Registrar) { + regInstance.RegisterResource(resourceName, ResourceIdpGsuite()) + regInstance.RegisterExporter(resourceName, IdpGsuiteExporter()) +} + +// ResourceIdpGsuite registers the genesyscloud_idp_gsuite resource with Terraform +func ResourceIdpGsuite() *schema.Resource { + return &schema.Resource{ + Description: `Genesys Cloud Single Sign-on GSuite Identity Provider. See this page for detailed configuration instructions: https://help.mypurecloud.com/articles/add-google-g-suite-single-sign-provider/`, + + CreateContext: provider.CreateWithPooledClient(createIdpGsuite), + ReadContext: provider.ReadWithPooledClient(readIdpGsuite), + UpdateContext: provider.UpdateWithPooledClient(updateIdpGsuite), + DeleteContext: provider.DeleteWithPooledClient(deleteIdpGsuite), + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + SchemaVersion: 1, + Timeouts: &schema.ResourceTimeout{ + Update: schema.DefaultTimeout(8 * time.Minute), + Read: schema.DefaultTimeout(8 * time.Minute), + }, + Schema: map[string]*schema.Schema{ + `name`: { + Description: `Name of the provider.`, + Optional: true, + Type: schema.TypeString, + }, + `disabled`: { + Description: `True if GSuite is disabled.`, + Optional: true, + Type: schema.TypeBool, + Default: false, + }, + `issuer_uri`: { + Description: `Issuer URI provided by GSuite.`, + Required: true, + Type: schema.TypeString, + }, + `target_uri`: { + Description: `Target URI provided by GSuite.`, + Optional: true, + Type: schema.TypeString, + }, + `slo_uri`: { + Description: `Provided on app creation.`, + Optional: true, + Type: schema.TypeString, + }, + `slo_binding`: { + Description: `Valid values: HTTP Redirect, HTTP Post`, + Optional: true, + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice([]string{`HTTP Redirect`, `HTTP Post`}, false), + }, + `relying_party_identifier`: { + Description: `String used to identify Genesys Cloud to GSuite.`, + Optional: true, + Type: schema.TypeString, + }, + `certificates`: { + Description: `PEM or DER encoded public X.509 certificates for SAML signature validation.`, + Required: true, + Type: schema.TypeList, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + }, + } +} + +// IdpGsuiteExporter returns the resourceExporter object used to hold the genesyscloud_idp_gsuite exporter's config +func IdpGsuiteExporter() *resourceExporter.ResourceExporter { + return &resourceExporter.ResourceExporter{ + GetResourcesFunc: provider.GetAllWithPooledClient(getAllAuthIdpGsuites), + RefAttrs: map[string]*resourceExporter.RefAttrSettings{ + // TODO: Add any reference attributes here + }, + } +} diff --git a/genesyscloud/resource_genesyscloud_idp_gsuite_test.go b/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_test.go similarity index 74% rename from genesyscloud/resource_genesyscloud_idp_gsuite_test.go rename to genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_test.go index 38e02fab6..c93f1a188 100644 --- a/genesyscloud/resource_genesyscloud_idp_gsuite_test.go +++ b/genesyscloud/idp_gsuite/resource_genesyscloud_idp_gsuite_test.go @@ -1,4 +1,4 @@ -package genesyscloud +package idp_gsuite import ( "fmt" @@ -7,103 +7,136 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "testing" + "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceIdpGsuite(t *testing.T) { var ( + name1 = "Test gsuite " + uuid.NewString() uri1 = "https://test.com/1" uri2 = "https://test.com/2" relyingPartyID1 = "test-id1" relyingPartyID2 = "test-id2" + uri3 = "https://example.com" + slo_binding1 = "HTTP Redirect" + slo_binding2 = "HTTP Post" ) resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) }, - ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + ProviderFactories: provider.GetProviderFactories(providerResources, nil), Steps: []resource.TestStep{ { // Create Config: generateIdpGsuiteResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1)), uri1, uri2, util.NullValue, // No relying party ID util.NullValue, // Not disabled + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "name", name1), util.ValidateStringInArray("genesyscloud_idp_gsuite.gsuite", "certificates", util.TestCert1), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "issuer_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "target_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "relying_party_identifier", ""), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "slo_binding", slo_binding1), ), }, { // Update with new values Config: generateIdpGsuiteResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert2)), uri2, uri1, strconv.Quote(relyingPartyID1), util.TrueValue, // disabled + uri3, + slo_binding2, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "name", name1), util.ValidateStringInArray("genesyscloud_idp_gsuite.gsuite", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "relying_party_identifier", relyingPartyID1), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "disabled", util.TrueValue), + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "slo_binding", slo_binding2), ), }, { // Update with multiple certs Config: generateIdpGsuiteResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1), strconv.Quote(util.TestCert2)), uri2, uri1, strconv.Quote(relyingPartyID2), util.FalseValue, // disabled + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "name", name1), util.ValidateStringInArray("genesyscloud_idp_gsuite.gsuite", "certificates", util.TestCert1), util.ValidateStringInArray("genesyscloud_idp_gsuite.gsuite", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "relying_party_identifier", relyingPartyID2), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "slo_binding", slo_binding1), ), }, { // Update to one cert in array Config: generateIdpGsuiteResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1)), uri2, uri1, strconv.Quote(relyingPartyID2), util.FalseValue, // disabled + uri3, + slo_binding2, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "name", name1), util.ValidateStringInArray("genesyscloud_idp_gsuite.gsuite", "certificates", util.TestCert1), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "certificates.#", "1"), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "relying_party_identifier", relyingPartyID2), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "slo_binding", slo_binding2), ), }, { // Update back to two certs in array Config: generateIdpGsuiteResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1), strconv.Quote(util.TestCert2)), uri2, uri1, strconv.Quote(relyingPartyID2), util.FalseValue, // disabled + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "name", name1), util.ValidateStringInArray("genesyscloud_idp_gsuite.gsuite", "certificates", util.TestCert1), util.ValidateStringInArray("genesyscloud_idp_gsuite.gsuite", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "certificates.#", "2"), @@ -111,6 +144,8 @@ func TestAccResourceIdpGsuite(t *testing.T) { resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "relying_party_identifier", relyingPartyID2), resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_gsuite.gsuite", "slo_binding", slo_binding1), ), }, { @@ -125,19 +160,25 @@ func TestAccResourceIdpGsuite(t *testing.T) { } func generateIdpGsuiteResource( + name string, certs string, issuerURI string, targetURI string, partyID string, - disabled string) string { + disabled string, + sloURI string, + sloBinding string) string { return fmt.Sprintf(`resource "genesyscloud_idp_gsuite" "gsuite" { + name = "%s" certificates = %s issuer_uri = "%s" target_uri = "%s" relying_party_identifier = %s disabled = %s + slo_uri = "%s" + slo_binding = "%s" } - `, certs, issuerURI, targetURI, partyID, disabled) + `, name, certs, issuerURI, targetURI, partyID, disabled, sloURI, sloBinding) } func testVerifyIdpGsuiteDestroyed(state *terraform.State) error { diff --git a/genesyscloud/idp_okta/genesyscloud_idp_okta_proxy.go b/genesyscloud/idp_okta/genesyscloud_idp_okta_proxy.go index 1af69517d..252806870 100644 --- a/genesyscloud/idp_okta/genesyscloud_idp_okta_proxy.go +++ b/genesyscloud/idp_okta/genesyscloud_idp_okta_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/idp_okta/resource_genesyscloud_idp_okta.go b/genesyscloud/idp_okta/resource_genesyscloud_idp_okta.go index 7f0de2a14..b4b1517f5 100644 --- a/genesyscloud/idp_okta/resource_genesyscloud_idp_okta.go +++ b/genesyscloud/idp_okta/resource_genesyscloud_idp_okta.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/constants" "terraform-provider-genesyscloud/genesyscloud/util/lists" @@ -70,9 +70,13 @@ func readIdpOkta(ctx context.Context, d *schema.ResourceData, meta interface{}) cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceIdpOkta(), constants.DefaultConsistencyChecks, "genesyscloud_idp_okta") + resourcedata.SetNillableValue(d, "name", okta.Name) resourcedata.SetNillableValue(d, "disabled", okta.Disabled) resourcedata.SetNillableValue(d, "issuer_uri", okta.IssuerURI) resourcedata.SetNillableValue(d, "target_uri", okta.SsoTargetURI) + resourcedata.SetNillableValue(d, "relying_party_identifier", okta.RelyingPartyIdentifier) + resourcedata.SetNillableValue(d, "slo_uri", okta.SloURI) + resourcedata.SetNillableValue(d, "slo_binding", okta.SloBinding) if okta.Certificate != nil { d.Set("certificates", lists.StringListToInterfaceList([]string{*okta.Certificate})) @@ -140,8 +144,12 @@ func deleteIdpOkta(ctx context.Context, d *schema.ResourceData, meta interface{} // getIdpOktaFromResourceData maps data from schema ResourceData object to a platformclientv2.Okta func getIdpOktaFromResourceData(d *schema.ResourceData) platformclientv2.Okta { return platformclientv2.Okta{ - Disabled: platformclientv2.Bool(d.Get("disabled").(bool)), - IssuerURI: platformclientv2.String(d.Get("issuer_uri").(string)), - SsoTargetURI: platformclientv2.String(d.Get("target_uri").(string)), + Name: platformclientv2.String(d.Get("name").(string)), + Disabled: platformclientv2.Bool(d.Get("disabled").(bool)), + IssuerURI: platformclientv2.String(d.Get("issuer_uri").(string)), + SsoTargetURI: platformclientv2.String(d.Get("target_uri").(string)), + RelyingPartyIdentifier: platformclientv2.String(d.Get("relying_party_identifier").(string)), + SloURI: platformclientv2.String(d.Get("slo_uri").(string)), + SloBinding: platformclientv2.String(d.Get("slo_binding").(string)), } } diff --git a/genesyscloud/idp_okta/resource_genesyscloud_idp_okta_test.go b/genesyscloud/idp_okta/resource_genesyscloud_idp_okta_test.go index 3b2e770aa..003b2f2f6 100644 --- a/genesyscloud/idp_okta/resource_genesyscloud_idp_okta_test.go +++ b/genesyscloud/idp_okta/resource_genesyscloud_idp_okta_test.go @@ -7,15 +7,22 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "testing" + "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceIdpOkta(t *testing.T) { var ( - uri1 = "https://test.com/1" - uri2 = "https://test.com/2" + name1 = "Test okta " + uuid.NewString() + uri1 = "https://test.com/1" + uri2 = "https://test.com/2" + relyingPartyID1 = "test-id1" + relyingPartyID2 = "test-id2" + uri3 = "https://example.com" + slo_binding1 = "HTTP Redirect" + slo_binding2 = "HTTP Post" ) resource.Test(t, resource.TestCase{ @@ -25,80 +32,120 @@ func TestAccResourceIdpOkta(t *testing.T) { { // Create Config: generateIdpOktaResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1)), uri1, uri2, util.NullValue, // Not disabled + util.NullValue, // No relying party ID + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "name", name1), util.ValidateStringInArray("genesyscloud_idp_okta.okta", "certificates", util.TestCert1), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "issuer_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "target_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "relying_party_identifier", ""), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "slo_binding", slo_binding1), ), }, { // Update with new values Config: generateIdpOktaResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert2)), uri2, uri1, util.TrueValue, // disabled + strconv.Quote(relyingPartyID1), + uri3, + slo_binding2, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "name", name1), util.ValidateStringInArray("genesyscloud_idp_okta.okta", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "disabled", util.TrueValue), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "relying_party_identifier", relyingPartyID1), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "slo_binding", slo_binding2), ), }, { // Update with multiple certs Config: generateIdpOktaResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1), strconv.Quote(util.TestCert2)), uri2, uri1, util.FalseValue, // disabled + strconv.Quote(relyingPartyID2), + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "name", name1), util.ValidateStringInArray("genesyscloud_idp_okta.okta", "certificates", util.TestCert1), util.ValidateStringInArray("genesyscloud_idp_okta.okta", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "relying_party_identifier", relyingPartyID2), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "slo_binding", slo_binding1), ), }, { // Update to one cert in array Config: generateIdpOktaResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1)), uri2, uri1, util.FalseValue, // disabled + strconv.Quote(relyingPartyID2), + uri3, + slo_binding2, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "name", name1), util.ValidateStringInArray("genesyscloud_idp_okta.okta", "certificates", util.TestCert1), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "certificates.#", "1"), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "relying_party_identifier", relyingPartyID2), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "slo_binding", slo_binding2), ), }, { // Update back to two certs in array Config: generateIdpOktaResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1), strconv.Quote(util.TestCert2)), uri2, uri1, util.FalseValue, // disabled + strconv.Quote(relyingPartyID2), + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "name", name1), util.ValidateStringInArray("genesyscloud_idp_okta.okta", "certificates", util.TestCert1), util.ValidateStringInArray("genesyscloud_idp_okta.okta", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "certificates.#", "2"), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "relying_party_identifier", relyingPartyID2), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_okta.okta", "slo_binding", slo_binding1), ), }, { @@ -113,17 +160,25 @@ func TestAccResourceIdpOkta(t *testing.T) { } func generateIdpOktaResource( + name string, certs string, issuerURI string, targetURI string, - disabled string) string { + disabled string, + partyID string, + sloURI string, + sloBinding string) string { return fmt.Sprintf(`resource "genesyscloud_idp_okta" "okta" { + name = "%s" certificates = %s issuer_uri = "%s" target_uri = "%s" disabled = %s + relying_party_identifier = %s + slo_uri = "%s" + slo_binding = "%s" } - `, certs, issuerURI, targetURI, disabled) + `, name, certs, issuerURI, targetURI, disabled, partyID, sloURI, sloBinding) } func testVerifyIdpOktaDestroyed(state *terraform.State) error { diff --git a/genesyscloud/idp_onelogin/genesyscloud_idp_onelogin_proxy.go b/genesyscloud/idp_onelogin/genesyscloud_idp_onelogin_proxy.go new file mode 100644 index 000000000..25e1c8f96 --- /dev/null +++ b/genesyscloud/idp_onelogin/genesyscloud_idp_onelogin_proxy.go @@ -0,0 +1,88 @@ +package idp_onelogin + +import ( + "context" + "fmt" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" +) + +/* +The genesyscloud_idp_onelogin_proxy.go file contains the proxy structures and methods that interact +with the Genesys Cloud SDK. We use composition here for each function on the proxy so individual functions can be stubbed +out during testing. +*/ + +// internalProxy holds a proxy instance that can be used throughout the package +var internalProxy *idpOneloginProxy + +// Type definitions for each func on our proxy so we can easily mock them out later +type getIdpOneloginFunc func(ctx context.Context, p *idpOneloginProxy) (*platformclientv2.Onelogin, *platformclientv2.APIResponse, error) +type updateIdpOneloginFunc func(ctx context.Context, p *idpOneloginProxy, id string, oneLogin *platformclientv2.Onelogin) (*platformclientv2.Identityprovider, *platformclientv2.APIResponse, error) +type deleteIdpOneloginFunc func(ctx context.Context, p *idpOneloginProxy, id string) (response *platformclientv2.APIResponse, err error) + +// idpOneloginProxy contains all of the methods that call genesys cloud APIs. +type idpOneloginProxy struct { + clientConfig *platformclientv2.Configuration + identityProviderApi *platformclientv2.IdentityProviderApi + getIdpOneloginAttr getIdpOneloginFunc + updateIdpOneloginAttr updateIdpOneloginFunc + deleteIdpOneloginAttr deleteIdpOneloginFunc +} + +// newIdpOneloginProxy initializes the idp onelogin proxy with all of the data needed to communicate with Genesys Cloud +func newIdpOneloginProxy(clientConfig *platformclientv2.Configuration) *idpOneloginProxy { + api := platformclientv2.NewIdentityProviderApiWithConfig(clientConfig) + return &idpOneloginProxy{ + clientConfig: clientConfig, + identityProviderApi: api, + getIdpOneloginAttr: getIdpOneloginFn, + updateIdpOneloginAttr: updateIdpOneloginFn, + deleteIdpOneloginAttr: deleteIdpOneloginFn, + } +} + +// getIdpOneloginProxy acts as a singleton to for the internalProxy. It also ensures +// that we can still proxy our tests by directly setting internalProxy package variable +func getIdpOneloginProxy(clientConfig *platformclientv2.Configuration) *idpOneloginProxy { + if internalProxy == nil { + internalProxy = newIdpOneloginProxy(clientConfig) + } + + return internalProxy +} + +// getIdpOnelogin retrieves all Genesys Cloud idp onelogin +func (p *idpOneloginProxy) getIdpOnelogin(ctx context.Context) (*platformclientv2.Onelogin, *platformclientv2.APIResponse, error) { + return p.getIdpOneloginAttr(ctx, p) +} + +// updateIdpOnelogin updates a Genesys Cloud idp onelogin +func (p *idpOneloginProxy) updateIdpOnelogin(ctx context.Context, id string, idpOnelogin *platformclientv2.Onelogin) (*platformclientv2.Identityprovider, *platformclientv2.APIResponse, error) { + return p.updateIdpOneloginAttr(ctx, p, id, idpOnelogin) +} + +// deleteIdpOnelogin deletes a Genesys Cloud idp onelogin by Id +func (p *idpOneloginProxy) deleteIdpOnelogin(ctx context.Context, id string) (response *platformclientv2.APIResponse, err error) { + return p.deleteIdpOneloginAttr(ctx, p, id) +} + +// getAllIdpOneloginFn is the implementation for retrieving all idp onelogin in Genesys Cloud +func getIdpOneloginFn(ctx context.Context, p *idpOneloginProxy) (*platformclientv2.Onelogin, *platformclientv2.APIResponse, error) { + return p.identityProviderApi.GetIdentityprovidersOnelogin() +} + +// updateIdpOneloginFn is an implementation of the function to update a Genesys Cloud idp onelogin +func updateIdpOneloginFn(ctx context.Context, p *idpOneloginProxy, id string, idpOnelogin *platformclientv2.Onelogin) (*platformclientv2.Identityprovider, *platformclientv2.APIResponse, error) { + return p.identityProviderApi.PutIdentityprovidersOnelogin(*idpOnelogin) +} + +// deleteIdpOneloginFn is an implementation function for deleting a Genesys Cloud idp onelogin +func deleteIdpOneloginFn(ctx context.Context, p *idpOneloginProxy, id string) (response *platformclientv2.APIResponse, err error) { + _, resp, err := p.identityProviderApi.DeleteIdentityprovidersOnelogin() + if err != nil { + return resp, fmt.Errorf("Failed to delete idp onelogin: %s", err) + } + + return resp, err +} diff --git a/genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin.go b/genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin.go new file mode 100644 index 000000000..c7de09046 --- /dev/null +++ b/genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin.go @@ -0,0 +1,157 @@ +package idp_onelogin + +import ( + "context" + "fmt" + "log" + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + "terraform-provider-genesyscloud/genesyscloud/util" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" + + "terraform-provider-genesyscloud/genesyscloud/consistency_checker" + + "terraform-provider-genesyscloud/genesyscloud/util/constants" + "terraform-provider-genesyscloud/genesyscloud/util/lists" + "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" +) + +/* +The resource_genesyscloud_idp_onelogin.go contains all of the methods that perform the core logic for a resource. +*/ + +// getAllAuthIdpOnelogin retrieves all of the idp onelogin via Terraform in the Genesys Cloud and is used for the exporter +func getAllAuthIdpOnelogins(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { + proxy := getIdpOneloginProxy(clientConfig) + resources := make(resourceExporter.ResourceIDMetaMap) + + _, resp, err := proxy.getIdpOnelogin(ctx) + if err != nil { + if util.IsStatus404(resp) { + // Don't export if config doesn't exist + return resources, nil + } + return nil, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to get IDP Onelogin error: %s", err), resp) + } + + resources["0"] = &resourceExporter.ResourceMeta{Name: "onelogin"} + return resources, nil +} + +// createIdpOnelogin is used by the idp_onelogin resource to create Genesys cloud idp onelogin +func createIdpOnelogin(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + log.Printf("Creating IDP Onelogin") + d.SetId("onelogin") + return updateIdpOnelogin(ctx, d, meta) +} + +// readIdpOnelogin is used by the idp_onelogin resource to read an idp onelogin from genesys cloud +func readIdpOnelogin(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getIdpOneloginProxy(sdkConfig) + + log.Printf("Reading idp onelogin") + + return util.WithRetriesForReadCustomTimeout(ctx, d.Timeout(schema.TimeoutRead), d, func() *retry.RetryError { + oneLogin, resp, getErr := proxy.getIdpOnelogin(ctx) + if getErr != nil { + if util.IsStatus404(resp) { + createIdpOnelogin(ctx, d, meta) + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read IDP Onelogin: %s", getErr), resp)) + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read IDP Onelogin: %s", getErr), resp)) + } + + cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceIdpOnelogin(), constants.DefaultConsistencyChecks, resourceName) + + if oneLogin.Certificate != nil { + d.Set("certificates", lists.StringListToInterfaceList([]string{*oneLogin.Certificate})) + } else if oneLogin.Certificates != nil { + d.Set("certificates", lists.StringListToInterfaceList(*oneLogin.Certificates)) + } else { + d.Set("certificates", nil) + } + + resourcedata.SetNillableValue(d, "name", oneLogin.Name) + resourcedata.SetNillableValue(d, "disabled", oneLogin.Disabled) + resourcedata.SetNillableValue(d, "issuer_uri", oneLogin.IssuerURI) + resourcedata.SetNillableValue(d, "target_uri", oneLogin.SsoTargetURI) + resourcedata.SetNillableValue(d, "slo_uri", oneLogin.SloURI) + resourcedata.SetNillableValue(d, "slo_binding", oneLogin.SloBinding) + resourcedata.SetNillableValue(d, "relying_party_identifier", oneLogin.RelyingPartyIdentifier) + + log.Printf("Read idp onelogin") + return cc.CheckState(d) + }) +} + +// updateIdpOnelogin is used by the idp_onelogin resource to update an idp onelogin in Genesys Cloud +func updateIdpOnelogin(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getIdpOneloginProxy(sdkConfig) + + idpOnelogin := getIdpOneloginFromResourceData(d) + + certificates := lists.BuildSdkStringListFromInterfaceArray(d, "certificates") + if certificates != nil { + if len(*certificates) == 1 { + idpOnelogin.Certificate = &(*certificates)[0] + } + idpOnelogin.Certificates = certificates + } + + log.Printf("Updating idp onelogin") + _, resp, err := proxy.updateIdpOnelogin(ctx, d.Id(), &idpOnelogin) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to update IDP Onelogin %s error: %s", d.Id(), err), resp) + } + + log.Printf("Updated idp onelogin") + return readIdpOnelogin(ctx, d, meta) +} + +// deleteIdpOnelogin is used by the idp_onelogin resource to delete an idp onelogin from Genesys cloud +func deleteIdpOnelogin(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getIdpOneloginProxy(sdkConfig) + + log.Printf("Deleting IDP Onelogin") + + resp, err := proxy.deleteIdpOnelogin(ctx, d.Id()) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to updadeletete IDP Onelogin %s error: %s", d.Id(), err), resp) + } + + return util.WithRetries(ctx, 60*time.Second, func() *retry.RetryError { + _, resp, err := proxy.getIdpOnelogin(ctx) + + if err != nil { + if util.IsStatus404(resp) { + // IDP Onelogin deleted + log.Printf("Deleted IDP Onelogin") + return nil + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Error deleting IDP Onelogin: %s", err), resp)) + } + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("IDP Onelogin still exists"), resp)) + }) +} + +// getIdpOneloginFromResourceData maps data from schema ResourceData object to a platformclientv2.Onelogin +func getIdpOneloginFromResourceData(d *schema.ResourceData) platformclientv2.Onelogin { + return platformclientv2.Onelogin{ + Name: platformclientv2.String(d.Get("name").(string)), + Disabled: platformclientv2.Bool(d.Get("disabled").(bool)), + IssuerURI: platformclientv2.String(d.Get("issuer_uri").(string)), + SsoTargetURI: platformclientv2.String(d.Get("target_uri").(string)), + SloURI: platformclientv2.String(d.Get("slo_uri").(string)), + SloBinding: platformclientv2.String(d.Get("slo_binding").(string)), + RelyingPartyIdentifier: platformclientv2.String(d.Get("relying_party_identifier").(string)), + } +} diff --git a/genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin_init_test.go b/genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin_init_test.go new file mode 100644 index 000000000..266eebab0 --- /dev/null +++ b/genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin_init_test.go @@ -0,0 +1,46 @@ +package idp_onelogin + +import ( + "sync" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +/* + The genesyscloud_idp_onelogin_init_test.go file is used to initialize the data sources and resources + used in testing the idp_onelogin resource. +*/ + +// providerResources holds a map of all registered resources +var providerResources map[string]*schema.Resource + +type registerTestInstance struct { + resourceMapMutex sync.RWMutex +} + +// registerTestResources registers all resources used in the tests +func (r *registerTestInstance) registerTestResources() { + r.resourceMapMutex.Lock() + defer r.resourceMapMutex.Unlock() + + providerResources[resourceName] = ResourceIdpOnelogin() +} + +// initTestResources initializes all test_data resources and data sources. +func initTestResources() { + providerResources = make(map[string]*schema.Resource) + + regInstance := ®isterTestInstance{} + + regInstance.registerTestResources() +} + +// TestMain is a "setup" function called by the testing framework when run the test_data +func TestMain(m *testing.M) { + // Run setup function before starting the test_data suite for the idp_onelogin package + initTestResources() + + // Run the test_data suite for the idp_onelogin package + m.Run() +} diff --git a/genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin_schema.go b/genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin_schema.go new file mode 100644 index 000000000..4cd3b9cc8 --- /dev/null +++ b/genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin_schema.go @@ -0,0 +1,103 @@ +package idp_onelogin + +import ( + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" +) + +/* +resource_genesycloud_idp_onelogin_schema.go holds four functions within it: + +1. The registration code that registers the Datasource, Resource and Exporter for the package. +2. The resource schema definitions for the idp_onelogin resource. +3. The datasource schema definitions for the idp_onelogin datasource. +4. The resource exporter configuration for the idp_onelogin exporter. +*/ +const resourceName = "genesyscloud_idp_onelogin" + +// SetRegistrar registers all of the resources, datasources and exporters in the package +func SetRegistrar(regInstance registrar.Registrar) { + regInstance.RegisterResource(resourceName, ResourceIdpOnelogin()) + regInstance.RegisterExporter(resourceName, IdpOneloginExporter()) +} + +// ResourceIdpOnelogin registers the genesyscloud_idp_onelogin resource with Terraform +func ResourceIdpOnelogin() *schema.Resource { + return &schema.Resource{ + Description: `Genesys Cloud Single Sign-on OneLogin Identity Provider. See this page for detailed configuration instructions: https://help.mypurecloud.com/articles/add-onelogin-as-single-sign-on-provider/`, + + CreateContext: provider.CreateWithPooledClient(createIdpOnelogin), + ReadContext: provider.ReadWithPooledClient(readIdpOnelogin), + UpdateContext: provider.UpdateWithPooledClient(updateIdpOnelogin), + DeleteContext: provider.DeleteWithPooledClient(deleteIdpOnelogin), + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + SchemaVersion: 1, + Timeouts: &schema.ResourceTimeout{ + Update: schema.DefaultTimeout(8 * time.Minute), + Read: schema.DefaultTimeout(8 * time.Minute), + }, + Schema: map[string]*schema.Schema{ + `name`: { + Description: `IDP OneLogin resource name`, + Optional: true, + Type: schema.TypeString, + }, + `disabled`: { + Description: `True if OneLogin is disabled.`, + Optional: true, + Type: schema.TypeBool, + Default: false, + }, + `issuer_uri`: { + Description: `Issuer URI provided by OneLogin.`, + Required: true, + Type: schema.TypeString, + }, + `target_uri`: { + Description: `Target URI provided by OneLogin.`, + Optional: true, + Type: schema.TypeString, + }, + `slo_uri`: { + Description: `Provided by OneLogin on app creation`, + Optional: true, + Type: schema.TypeString, + }, + `slo_binding`: { + Description: `Valid values: HTTP Redirect, HTTP Post`, + Optional: true, + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice([]string{`HTTP Redirect`, `HTTP Post`}, false), + }, + `relying_party_identifier`: { + Description: `String used to identify Genesys Cloud to OneLogin.`, + Optional: true, + Type: schema.TypeString, + }, + `certificates`: { + Description: `PEM or DER encoded public X.509 certificates for SAML signature validation.`, + Optional: true, + Type: schema.TypeList, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + }, + } +} + +// IdpOneloginExporter returns the resourceExporter object used to hold the genesyscloud_idp_onelogin exporter's config +func IdpOneloginExporter() *resourceExporter.ResourceExporter { + return &resourceExporter.ResourceExporter{ + GetResourcesFunc: provider.GetAllWithPooledClient(getAllAuthIdpOnelogins), + RefAttrs: map[string]*resourceExporter.RefAttrSettings{ + // TODO: Add any reference attributes here + }, + } +} diff --git a/genesyscloud/resource_genesyscloud_idp_onelogin_test.go b/genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin_test.go similarity index 63% rename from genesyscloud/resource_genesyscloud_idp_onelogin_test.go rename to genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin_test.go index fcd55469b..f3e0d5c90 100644 --- a/genesyscloud/resource_genesyscloud_idp_onelogin_test.go +++ b/genesyscloud/idp_onelogin/resource_genesyscloud_idp_onelogin_test.go @@ -1,4 +1,4 @@ -package genesyscloud +package idp_onelogin import ( "fmt" @@ -7,98 +7,145 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "testing" + "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceIdpOnelogin(t *testing.T) { var ( - uri1 = "https://test.com/1" - uri2 = "https://test.com/2" + name1 = "Test onelogin " + uuid.NewString() + uri1 = "https://test.com/1" + uri2 = "https://test.com/2" + relyingPartyID1 = "test-id1" + relyingPartyID2 = "test-id2" + uri3 = "https://example.com" + slo_binding1 = "HTTP Redirect" + slo_binding2 = "HTTP Post" ) resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) }, - ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + ProviderFactories: provider.GetProviderFactories(providerResources, nil), Steps: []resource.TestStep{ { // Create Config: generateIdpOneloginResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1)), uri1, uri2, util.NullValue, // Not disabled + util.NullValue, // No relying party ID + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "name", name1), util.ValidateStringInArray("genesyscloud_idp_onelogin.onelogin", "certificates", util.TestCert1), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "issuer_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "target_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "relying_party_identifier", ""), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "slo_binding", slo_binding1), ), }, { // Update with new values Config: generateIdpOneloginResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert2)), uri2, uri1, util.TrueValue, // disabled + strconv.Quote(relyingPartyID1), + uri3, + slo_binding2, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "name", name1), util.ValidateStringInArray("genesyscloud_idp_onelogin.onelogin", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "disabled", util.TrueValue), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "relying_party_identifier", relyingPartyID1), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "slo_binding", slo_binding2), ), }, { // Update with multiple certs Config: generateIdpOneloginResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1), strconv.Quote(util.TestCert2)), uri2, uri1, util.FalseValue, // disabled + strconv.Quote(relyingPartyID2), + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "name", name1), util.ValidateStringInArray("genesyscloud_idp_onelogin.onelogin", "certificates", util.TestCert1), util.ValidateStringInArray("genesyscloud_idp_onelogin.onelogin", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "relying_party_identifier", relyingPartyID2), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "slo_binding", slo_binding1), ), }, { // Update to one cert in array Config: generateIdpOneloginResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1)), uri2, uri1, util.FalseValue, // disabled + strconv.Quote(relyingPartyID2), + uri3, + slo_binding2, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "name", name1), util.ValidateStringInArray("genesyscloud_idp_onelogin.onelogin", "certificates", util.TestCert1), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "certificates.#", "1"), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "relying_party_identifier", relyingPartyID2), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "slo_binding", slo_binding2), ), }, { // Update back to two certs in array Config: generateIdpOneloginResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1), strconv.Quote(util.TestCert2)), uri2, uri1, util.FalseValue, // disabled + strconv.Quote(relyingPartyID2), + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "name", name1), util.ValidateStringInArray("genesyscloud_idp_onelogin.onelogin", "certificates", util.TestCert1), util.ValidateStringInArray("genesyscloud_idp_onelogin.onelogin", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "certificates.#", "2"), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "relying_party_identifier", relyingPartyID2), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_onelogin.onelogin", "slo_binding", slo_binding1), ), }, { @@ -113,17 +160,25 @@ func TestAccResourceIdpOnelogin(t *testing.T) { } func generateIdpOneloginResource( + name string, certs string, issuerURI string, targetURI string, - disabled string) string { + disabled string, + partyID string, + sloURI string, + sloBinding string) string { return fmt.Sprintf(`resource "genesyscloud_idp_onelogin" "onelogin" { + name = "%s" certificates = %s issuer_uri = "%s" target_uri = "%s" disabled = %s + relying_party_identifier = %s + slo_uri = "%s" + slo_binding = "%s" } - `, certs, issuerURI, targetURI, disabled) + `, name, certs, issuerURI, targetURI, disabled, partyID, sloURI, sloBinding) } func testVerifyIdpOneloginDestroyed(state *terraform.State) error { diff --git a/genesyscloud/idp_ping/genesyscloud_idp_ping_proxy.go b/genesyscloud/idp_ping/genesyscloud_idp_ping_proxy.go new file mode 100644 index 000000000..2c9fc61db --- /dev/null +++ b/genesyscloud/idp_ping/genesyscloud_idp_ping_proxy.go @@ -0,0 +1,88 @@ +package idp_ping + +import ( + "context" + "fmt" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" +) + +/* +The genesyscloud_idp_ping_proxy.go file contains the proxy structures and methods that interact +with the Genesys Cloud SDK. We use composition here for each function on the proxy so individual functions can be stubbed +out during testing. +*/ + +// internalProxy holds a proxy instance that can be used throughout the package +var internalProxy *idpPingProxy + +// Type definitions for each func on our proxy so we can easily mock them out later +type getIdpPingFunc func(ctx context.Context, p *idpPingProxy) (*platformclientv2.Pingidentity, *platformclientv2.APIResponse, error) +type updateIdpPingFunc func(ctx context.Context, p *idpPingProxy, id string, pingIdentity *platformclientv2.Pingidentity) (*platformclientv2.Identityprovider, *platformclientv2.APIResponse, error) +type deleteIdpPingFunc func(ctx context.Context, p *idpPingProxy, id string) (response *platformclientv2.APIResponse, err error) + +// idpPingProxy contains all of the methods that call genesys cloud APIs. +type idpPingProxy struct { + clientConfig *platformclientv2.Configuration + identityProviderApi *platformclientv2.IdentityProviderApi + getIdpPingAttr getIdpPingFunc + updateIdpPingAttr updateIdpPingFunc + deleteIdpPingAttr deleteIdpPingFunc +} + +// newIdpPingProxy initializes the idp ping proxy with all of the data needed to communicate with Genesys Cloud +func newIdpPingProxy(clientConfig *platformclientv2.Configuration) *idpPingProxy { + api := platformclientv2.NewIdentityProviderApiWithConfig(clientConfig) + return &idpPingProxy{ + clientConfig: clientConfig, + identityProviderApi: api, + getIdpPingAttr: getIdpPingFn, + updateIdpPingAttr: updateIdpPingFn, + deleteIdpPingAttr: deleteIdpPingFn, + } +} + +// getIdpPingProxy acts as a singleton to for the internalProxy. It also ensures +// that we can still proxy our tests by directly setting internalProxy package variable +func getIdpPingProxy(clientConfig *platformclientv2.Configuration) *idpPingProxy { + if internalProxy == nil { + internalProxy = newIdpPingProxy(clientConfig) + } + + return internalProxy +} + +// getIdpPing retrieves all Genesys Cloud idp ping +func (p *idpPingProxy) getIdpPing(ctx context.Context) (*platformclientv2.Pingidentity, *platformclientv2.APIResponse, error) { + return p.getIdpPingAttr(ctx, p) +} + +// updateIdpPing updates a Genesys Cloud idp ping +func (p *idpPingProxy) updateIdpPing(ctx context.Context, id string, idpPing *platformclientv2.Pingidentity) (*platformclientv2.Identityprovider, *platformclientv2.APIResponse, error) { + return p.updateIdpPingAttr(ctx, p, id, idpPing) +} + +// deleteIdpPing deletes a Genesys Cloud idp ping by Id +func (p *idpPingProxy) deleteIdpPing(ctx context.Context, id string) (response *platformclientv2.APIResponse, err error) { + return p.deleteIdpPingAttr(ctx, p, id) +} + +// getAllIdpPingFn is the implementation for retrieving all idp ping in Genesys Cloud +func getIdpPingFn(ctx context.Context, p *idpPingProxy) (*platformclientv2.Pingidentity, *platformclientv2.APIResponse, error) { + return p.identityProviderApi.GetIdentityprovidersPing() +} + +// updateIdpPingFn is an implementation of the function to update a Genesys Cloud idp ping +func updateIdpPingFn(ctx context.Context, p *idpPingProxy, id string, idpPing *platformclientv2.Pingidentity) (*platformclientv2.Identityprovider, *platformclientv2.APIResponse, error) { + return p.identityProviderApi.PutIdentityprovidersPing(*idpPing) +} + +// deleteIdpPingFn is an implementation function for deleting a Genesys Cloud idp ping +func deleteIdpPingFn(ctx context.Context, p *idpPingProxy, id string) (response *platformclientv2.APIResponse, err error) { + _, resp, err := p.identityProviderApi.DeleteIdentityprovidersPing() + if err != nil { + return resp, fmt.Errorf("Failed to delete idp ping: %s", err) + } + + return resp, err +} diff --git a/genesyscloud/idp_ping/resource_genesyscloud_idp_ping.go b/genesyscloud/idp_ping/resource_genesyscloud_idp_ping.go new file mode 100644 index 000000000..7fb4ba610 --- /dev/null +++ b/genesyscloud/idp_ping/resource_genesyscloud_idp_ping.go @@ -0,0 +1,155 @@ +package idp_ping + +import ( + "context" + "fmt" + "log" + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + "terraform-provider-genesyscloud/genesyscloud/util" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" + + "terraform-provider-genesyscloud/genesyscloud/consistency_checker" + + "terraform-provider-genesyscloud/genesyscloud/util/constants" + "terraform-provider-genesyscloud/genesyscloud/util/lists" + "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" +) + +/* +The resource_genesyscloud_idp_ping.go contains all of the methods that perform the core logic for a resource. +*/ + +// getAllAuthIdpPing retrieves all of the idp ping via Terraform in the Genesys Cloud and is used for the exporter +func getAllAuthIdpPings(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { + proxy := getIdpPingProxy(clientConfig) + resources := make(resourceExporter.ResourceIDMetaMap) + + _, resp, err := proxy.getIdpPing(ctx) + if err != nil { + if util.IsStatus404(resp) { + // Don't export if config doesn't exist + return resources, nil + } + return nil, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to get IDP Ping error: %s", err), resp) + } + + resources["0"] = &resourceExporter.ResourceMeta{Name: "ping"} + return resources, nil +} + +// createIdpPing is used by the idp_ping resource to create Genesys cloud idp ping +func createIdpPing(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + log.Printf("Creating IDP Ping") + d.SetId("ping") + return updateIdpPing(ctx, d, meta) +} + +// readIdpPing is used by the idp_ping resource to read an idp ping from genesys cloud +func readIdpPing(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getIdpPingProxy(sdkConfig) + + log.Printf("Reading idp ping") + + cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceIdpPing(), constants.DefaultConsistencyChecks, resourceName) + + return util.WithRetriesForReadCustomTimeout(ctx, d.Timeout(schema.TimeoutRead), d, func() *retry.RetryError { + pingIdentity, resp, getErr := proxy.getIdpPing(ctx) + if getErr != nil { + if util.IsStatus404(resp) { + createIdpPing(ctx, d, meta) + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read IDP Ping: %s", getErr), resp)) + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read IDP Ping: %s", getErr), resp)) + } + + resourcedata.SetNillableValue(d, "name", pingIdentity.Name) + resourcedata.SetNillableValue(d, "disabled", pingIdentity.Disabled) + resourcedata.SetNillableValue(d, "issuer_uri", pingIdentity.IssuerURI) + resourcedata.SetNillableValue(d, "target_uri", pingIdentity.SsoTargetURI) + resourcedata.SetNillableValue(d, "relying_party_identifier", pingIdentity.RelyingPartyIdentifier) + resourcedata.SetNillableValue(d, "slo_uri", pingIdentity.SloURI) + resourcedata.SetNillableValue(d, "slo_binding", pingIdentity.SloBinding) + + if pingIdentity.Certificate != nil { + d.Set("certificates", lists.StringListToInterfaceList([]string{*pingIdentity.Certificate})) + } else if pingIdentity.Certificates != nil { + d.Set("certificates", lists.StringListToInterfaceList(*pingIdentity.Certificates)) + } else { + d.Set("certificates", nil) + } + + log.Printf("Read idp ping") + return cc.CheckState(d) + }) +} + +// updateIdpPing is used by the idp_ping resource to update an idp ping in Genesys Cloud +func updateIdpPing(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getIdpPingProxy(sdkConfig) + + idpPing := getIdpPingFromResourceData(d) + + certificates := lists.BuildSdkStringListFromInterfaceArray(d, "certificates") + if certificates != nil { + if len(*certificates) == 1 { + idpPing.Certificate = &(*certificates)[0] + } + idpPing.Certificates = certificates + } + + log.Printf("Updating idp ping") + _, resp, err := proxy.updateIdpPing(ctx, d.Id(), &idpPing) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to update IDP Ping %s error: %s", d.Id(), err), resp) + } + + log.Printf("Updated idp ping") + return readIdpPing(ctx, d, meta) +} + +// deleteIdpPing is used by the idp_ping resource to delete an idp ping from Genesys cloud +func deleteIdpPing(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getIdpPingProxy(sdkConfig) + + resp, err := proxy.deleteIdpPing(ctx, d.Id()) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to delete IDP Ping %s error: %s", d.Id(), err), resp) + } + + return util.WithRetries(ctx, 60*time.Second, func() *retry.RetryError { + _, resp, err := proxy.getIdpPing(ctx) + + if err != nil { + if util.IsStatus404(resp) { + // IDP Ping deleted + log.Printf("Deleted IDP Ping") + return nil + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Error deleting IDP Ping: %s", err), resp)) + } + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("IDP Ping still exists"), resp)) + }) +} + +// getIdpPingFromResourceData maps data from schema ResourceData object to a platformclientv2.Pingidentity +func getIdpPingFromResourceData(d *schema.ResourceData) platformclientv2.Pingidentity { + return platformclientv2.Pingidentity{ + Name: platformclientv2.String(d.Get("name").(string)), + Disabled: platformclientv2.Bool(d.Get("disabled").(bool)), + IssuerURI: platformclientv2.String(d.Get("issuer_uri").(string)), + SsoTargetURI: platformclientv2.String(d.Get("target_uri").(string)), + RelyingPartyIdentifier: platformclientv2.String(d.Get("relying_party_identifier").(string)), + SloURI: platformclientv2.String(d.Get("slo_uri").(string)), + SloBinding: platformclientv2.String(d.Get("slo_binding").(string)), + } +} diff --git a/genesyscloud/idp_ping/resource_genesyscloud_idp_ping_init_test.go b/genesyscloud/idp_ping/resource_genesyscloud_idp_ping_init_test.go new file mode 100644 index 000000000..684a37221 --- /dev/null +++ b/genesyscloud/idp_ping/resource_genesyscloud_idp_ping_init_test.go @@ -0,0 +1,46 @@ +package idp_ping + +import ( + "sync" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +/* + The genesyscloud_idp_ping_init_test.go file is used to initialize the resources + used in testing the idp_ping resource. +*/ + +// providerResources holds a map of all registered resources +var providerResources map[string]*schema.Resource + +type registerTestInstance struct { + resourceMapMutex sync.RWMutex +} + +// registerTestResources registers all resources used in the tests +func (r *registerTestInstance) registerTestResources() { + r.resourceMapMutex.Lock() + defer r.resourceMapMutex.Unlock() + + providerResources[resourceName] = ResourceIdpPing() +} + +// initTestResources initializes all test_data resources. +func initTestResources() { + providerResources = make(map[string]*schema.Resource) + + regInstance := ®isterTestInstance{} + + regInstance.registerTestResources() +} + +// TestMain is a "setup" function called by the testing framework when run the test_data +func TestMain(m *testing.M) { + // Run setup function before starting the test_data suite for the idp_ping package + initTestResources() + + // Run the test_data suite for the idp_ping package + m.Run() +} diff --git a/genesyscloud/idp_ping/resource_genesyscloud_idp_ping_schema.go b/genesyscloud/idp_ping/resource_genesyscloud_idp_ping_schema.go new file mode 100644 index 000000000..de778f1c2 --- /dev/null +++ b/genesyscloud/idp_ping/resource_genesyscloud_idp_ping_schema.go @@ -0,0 +1,103 @@ +package idp_ping + +import ( + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" +) + +/* +resource_genesycloud_idp_ping_schema.go holds four functions within it: + +1. The registration code that registers the Datasource, Resource and Exporter for the package. +2. The resource schema definitions for the idp_ping resource. +3. The datasource schema definitions for the idp_ping datasource. +4. The resource exporter configuration for the idp_ping exporter. +*/ +const resourceName = "genesyscloud_idp_ping" + +// SetRegistrar registers all of the resources, datasources and exporters in the package +func SetRegistrar(regInstance registrar.Registrar) { + regInstance.RegisterResource(resourceName, ResourceIdpPing()) + regInstance.RegisterExporter(resourceName, IdpPingExporter()) +} + +// ResourceIdpPing registers the genesyscloud_idp_ping resource with Terraform +func ResourceIdpPing() *schema.Resource { + return &schema.Resource{ + Description: `Genesys Cloud Single Sign-on Ping Identity Provider. See this page for detailed configuration instructions: https://help.mypurecloud.com/articles/add-ping-identity-single-sign-provider/`, + + CreateContext: provider.CreateWithPooledClient(createIdpPing), + ReadContext: provider.ReadWithPooledClient(readIdpPing), + UpdateContext: provider.UpdateWithPooledClient(updateIdpPing), + DeleteContext: provider.DeleteWithPooledClient(deleteIdpPing), + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + SchemaVersion: 1, + Timeouts: &schema.ResourceTimeout{ + Update: schema.DefaultTimeout(8 * time.Minute), + Read: schema.DefaultTimeout(8 * time.Minute), + }, + Schema: map[string]*schema.Schema{ + `name`: { + Description: `Name of the provider`, + Optional: true, + Type: schema.TypeString, + }, + `disabled`: { + Description: `True if Ping is disabled.`, + Optional: true, + Type: schema.TypeBool, + Default: false, + }, + `issuer_uri`: { + Description: `Issuer URI provided by Ping.`, + Required: true, + Type: schema.TypeString, + }, + `target_uri`: { + Description: `Target URI provided by Ping.`, + Optional: true, + Type: schema.TypeString, + }, + `slo_uri`: { + Description: `Provided on app creation.`, + Optional: true, + Type: schema.TypeString, + }, + `slo_binding`: { + Description: `Valid values: HTTP Redirect, HTTP Post`, + Optional: true, + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice([]string{`HTTP Redirect`, `HTTP Post`}, false), + }, + `relying_party_identifier`: { + Description: `String used to identify Genesys Cloud to Ping.`, + Optional: true, + Type: schema.TypeString, + }, + `certificates`: { + Description: `PEM or DER encoded public X.509 certificates for SAML signature validation.`, + Required: true, + Type: schema.TypeList, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + }, + } +} + +// IdpPingExporter returns the resourceExporter object used to hold the genesyscloud_idp_ping exporter's config +func IdpPingExporter() *resourceExporter.ResourceExporter { + return &resourceExporter.ResourceExporter{ + GetResourcesFunc: provider.GetAllWithPooledClient(getAllAuthIdpPings), + RefAttrs: map[string]*resourceExporter.RefAttrSettings{ + // TODO: Add any reference attributes here + }, + } +} diff --git a/genesyscloud/resource_genesyscloud_idp_ping_test.go b/genesyscloud/idp_ping/resource_genesyscloud_idp_ping_test.go similarity index 74% rename from genesyscloud/resource_genesyscloud_idp_ping_test.go rename to genesyscloud/idp_ping/resource_genesyscloud_idp_ping_test.go index 1211c8230..68f07dc76 100644 --- a/genesyscloud/resource_genesyscloud_idp_ping_test.go +++ b/genesyscloud/idp_ping/resource_genesyscloud_idp_ping_test.go @@ -1,4 +1,4 @@ -package genesyscloud +package idp_ping import ( "fmt" @@ -7,103 +7,136 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "testing" + "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceIdpPing(t *testing.T) { var ( + name1 = "Test ping " + uuid.NewString() uri1 = "https://test.com/1" uri2 = "https://test.com/2" relyingPartyID1 = "test-id1" relyingPartyID2 = "test-id2" + uri3 = "https://example.com" + slo_binding1 = "HTTP Redirect" + slo_binding2 = "HTTP Post" ) resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) }, - ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + ProviderFactories: provider.GetProviderFactories(providerResources, nil), Steps: []resource.TestStep{ { // Create Config: generateIdpPingResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1)), uri1, uri2, util.NullValue, // No relying party ID util.NullValue, // Not disabled + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "name", name1), util.ValidateStringInArray("genesyscloud_idp_ping.ping", "certificates", util.TestCert1), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "issuer_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "target_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "relying_party_identifier", ""), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "slo_binding", slo_binding1), ), }, { // Update with new values Config: generateIdpPingResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert2)), uri2, uri1, strconv.Quote(relyingPartyID1), util.TrueValue, // disabled + uri3, + slo_binding2, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "name", name1), util.ValidateStringInArray("genesyscloud_idp_ping.ping", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "relying_party_identifier", relyingPartyID1), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "disabled", util.TrueValue), + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "slo_binding", slo_binding2), ), }, { // Update with multiple certs Config: generateIdpPingResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1), strconv.Quote(util.TestCert2)), uri2, uri1, strconv.Quote(relyingPartyID2), util.FalseValue, // disabled + uri3, + slo_binding1, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "name", name1), util.ValidateStringInArray("genesyscloud_idp_ping.ping", "certificates", util.TestCert1), util.ValidateStringInArray("genesyscloud_idp_ping.ping", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "relying_party_identifier", relyingPartyID2), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "slo_binding", slo_binding1), ), }, { // Update to one cert in array Config: generateIdpPingResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1)), uri2, uri1, strconv.Quote(relyingPartyID2), util.FalseValue, // disabled + uri3, + slo_binding2, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "name", name1), util.ValidateStringInArray("genesyscloud_idp_ping.ping", "certificates", util.TestCert1), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "certificates.#", "1"), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "issuer_uri", uri2), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "relying_party_identifier", relyingPartyID2), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "slo_binding", slo_binding2), ), }, { // Update back to two certs Config: generateIdpPingResource( + name1, util.GenerateStringArray(strconv.Quote(util.TestCert1), strconv.Quote(util.TestCert2)), uri2, uri1, strconv.Quote(relyingPartyID2), util.FalseValue, // disabled + uri3, + slo_binding2, ), Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "name", name1), util.ValidateStringInArray("genesyscloud_idp_ping.ping", "certificates", util.TestCert1), util.ValidateStringInArray("genesyscloud_idp_ping.ping", "certificates", util.TestCert2), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "certificates.#", "2"), @@ -111,6 +144,8 @@ func TestAccResourceIdpPing(t *testing.T) { resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "target_uri", uri1), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "relying_party_identifier", relyingPartyID2), resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "disabled", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "slo_uri", uri3), + resource.TestCheckResourceAttr("genesyscloud_idp_ping.ping", "slo_binding", slo_binding2), ), }, { @@ -125,19 +160,25 @@ func TestAccResourceIdpPing(t *testing.T) { } func generateIdpPingResource( + name string, certs string, issuerURI string, targetURI string, partyID string, - disabled string) string { + disabled string, + sloURI string, + sloBinding string) string { return fmt.Sprintf(`resource "genesyscloud_idp_ping" "ping" { + name = "%s" certificates = %s issuer_uri = "%s" target_uri = "%s" relying_party_identifier = %s disabled = %s + slo_uri = "%s" + slo_binding = "%s" } - `, certs, issuerURI, targetURI, partyID, disabled) + `, name, certs, issuerURI, targetURI, partyID, disabled, sloURI, sloBinding) } func testVerifyIdpPingDestroyed(state *terraform.State) error { diff --git a/genesyscloud/idp_salesforce/genesyscloud_idp_salesforce_proxy.go b/genesyscloud/idp_salesforce/genesyscloud_idp_salesforce_proxy.go index 0610597c8..12d674558 100644 --- a/genesyscloud/idp_salesforce/genesyscloud_idp_salesforce_proxy.go +++ b/genesyscloud/idp_salesforce/genesyscloud_idp_salesforce_proxy.go @@ -2,7 +2,8 @@ package idp_salesforce import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce.go b/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce.go index eadc684c1..7408150da 100644 --- a/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce.go +++ b/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce.go @@ -3,10 +3,6 @@ package idp_salesforce import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -16,6 +12,11 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/lists" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce_test.go b/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce_test.go index d891e5601..2d5e43a9a 100644 --- a/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce_test.go +++ b/genesyscloud/idp_salesforce/resource_genesyscloud_idp_salesforce_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceIdpSalesforce(t *testing.T) { diff --git a/genesyscloud/integration/genesyscloud_integration_proxy.go b/genesyscloud/integration/genesyscloud_integration_proxy.go index 5f40e21a4..d88f700c7 100644 --- a/genesyscloud/integration/genesyscloud_integration_proxy.go +++ b/genesyscloud/integration/genesyscloud_integration_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/integration/resource_genesyscloud_integration.go b/genesyscloud/integration/resource_genesyscloud_integration.go index d164f75a6..e801c945b 100644 --- a/genesyscloud/integration/resource_genesyscloud_integration.go +++ b/genesyscloud/integration/resource_genesyscloud_integration.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/integration/resource_genesyscloud_integration_test.go b/genesyscloud/integration/resource_genesyscloud_integration_test.go index 4f0476236..41a195fd3 100644 --- a/genesyscloud/integration/resource_genesyscloud_integration_test.go +++ b/genesyscloud/integration/resource_genesyscloud_integration_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/integration/resource_genesyscloud_integration_utils.go b/genesyscloud/integration/resource_genesyscloud_integration_utils.go index b28c17d00..24e2b6385 100644 --- a/genesyscloud/integration/resource_genesyscloud_integration_utils.go +++ b/genesyscloud/integration/resource_genesyscloud_integration_utils.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/integration_action/genesyscloud_integration_action_proxy.go b/genesyscloud/integration_action/genesyscloud_integration_action_proxy.go index bc7f7591a..2f6fbffce 100644 --- a/genesyscloud/integration_action/genesyscloud_integration_action_proxy.go +++ b/genesyscloud/integration_action/genesyscloud_integration_action_proxy.go @@ -4,8 +4,9 @@ import ( "context" "encoding/json" "errors" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "net/http" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/integration_action/resource_genesyscloud_integration_action.go b/genesyscloud/integration_action/resource_genesyscloud_integration_action.go index b2d9139c9..7ba76039e 100644 --- a/genesyscloud/integration_action/resource_genesyscloud_integration_action.go +++ b/genesyscloud/integration_action/resource_genesyscloud_integration_action.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/integration_action/resource_genesyscloud_integration_action_test.go b/genesyscloud/integration_action/resource_genesyscloud_integration_action_test.go index 24fe588ff..5f5cf9478 100644 --- a/genesyscloud/integration_action/resource_genesyscloud_integration_action_test.go +++ b/genesyscloud/integration_action/resource_genesyscloud_integration_action_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/integration_action/resource_genesyscloud_integration_action_utils.go b/genesyscloud/integration_action/resource_genesyscloud_integration_action_utils.go index f74621600..7d6362e49 100644 --- a/genesyscloud/integration_action/resource_genesyscloud_integration_action_utils.go +++ b/genesyscloud/integration_action/resource_genesyscloud_integration_action_utils.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" ) diff --git a/genesyscloud/integration_credential/genesyscloud_integration_credential_proxy.go b/genesyscloud/integration_credential/genesyscloud_integration_credential_proxy.go index 31f0da8df..f74d2148f 100644 --- a/genesyscloud/integration_credential/genesyscloud_integration_credential_proxy.go +++ b/genesyscloud/integration_credential/genesyscloud_integration_credential_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/integration_credential/resource_genesyscloud_integration_credential.go b/genesyscloud/integration_credential/resource_genesyscloud_integration_credential.go index e82c6ca79..f0cae5e89 100644 --- a/genesyscloud/integration_credential/resource_genesyscloud_integration_credential.go +++ b/genesyscloud/integration_credential/resource_genesyscloud_integration_credential.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_test.go b/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_test.go index f401541ac..2b3c6ca3c 100644 --- a/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_test.go +++ b/genesyscloud/integration_credential/resource_genesyscloud_integration_credential_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/integration_custom_auth_action/genesyscloud_integration_custom_auth_action_proxy.go b/genesyscloud/integration_custom_auth_action/genesyscloud_integration_custom_auth_action_proxy.go index dda4e4553..a38118540 100644 --- a/genesyscloud/integration_custom_auth_action/genesyscloud_integration_custom_auth_action_proxy.go +++ b/genesyscloud/integration_custom_auth_action/genesyscloud_integration_custom_auth_action_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "strings" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action.go b/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action.go index 8839fee9b..6e33849ea 100644 --- a/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action.go +++ b/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_test.go b/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_test.go index 3d2e51163..9e9ec4361 100644 --- a/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_test.go +++ b/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_test.go @@ -15,7 +15,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type customAuthActionResource struct { diff --git a/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_utils.go b/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_utils.go index 209c4e24d..0dc80f639 100644 --- a/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_utils.go +++ b/genesyscloud/integration_custom_auth_action/resource_genesyscloud_integration_custom_auth_action_utils.go @@ -6,7 +6,7 @@ import ( integrationAction "terraform-provider-genesyscloud/genesyscloud/integration_action" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/journey_outcome_predictor/genesyscloud_journey_outcome_predictor_proxy.go b/genesyscloud/journey_outcome_predictor/genesyscloud_journey_outcome_predictor_proxy.go index e5846292b..6d1a11ce6 100644 --- a/genesyscloud/journey_outcome_predictor/genesyscloud_journey_outcome_predictor_proxy.go +++ b/genesyscloud/journey_outcome_predictor/genesyscloud_journey_outcome_predictor_proxy.go @@ -2,7 +2,8 @@ package journey_outcome_predictor import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor.go b/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor.go index cda54b354..ba39ce936 100644 --- a/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor.go +++ b/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor_test.go b/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor_test.go index 98872d160..fdcbbd1ec 100644 --- a/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor_test.go +++ b/genesyscloud/journey_outcome_predictor/resource_genesyscloud_journey_outcome_predictor_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceJourneyOutcomePredictor(t *testing.T) { diff --git a/genesyscloud/journey_views/genesyscloud_journey_views_proxy.go b/genesyscloud/journey_views/genesyscloud_journey_views_proxy.go index 4964990b3..5503209a0 100644 --- a/genesyscloud/journey_views/genesyscloud_journey_views_proxy.go +++ b/genesyscloud/journey_views/genesyscloud_journey_views_proxy.go @@ -2,8 +2,9 @@ package journey_views import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *journeyViewsProxy diff --git a/genesyscloud/journey_views/resource_genesyscloud_journey_views.go b/genesyscloud/journey_views/resource_genesyscloud_journey_views.go index 2d6b4f702..2ec96bddd 100644 --- a/genesyscloud/journey_views/resource_genesyscloud_journey_views.go +++ b/genesyscloud/journey_views/resource_genesyscloud_journey_views.go @@ -3,10 +3,6 @@ package journey_views import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -14,6 +10,11 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func createJourneyView(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { diff --git a/genesyscloud/journey_views/resource_genesyscloud_journey_views_test.go b/genesyscloud/journey_views/resource_genesyscloud_journey_views_test.go index 8116ced64..6e0588a7e 100644 --- a/genesyscloud/journey_views/resource_genesyscloud_journey_views_test.go +++ b/genesyscloud/journey_views/resource_genesyscloud_journey_views_test.go @@ -2,14 +2,15 @@ package journey_views import ( "fmt" - "github.com/google/uuid" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "strings" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "testing" + + "github.com/google/uuid" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceJourneyViewsBasic(t *testing.T) { diff --git a/genesyscloud/journey_views/resource_genesyscloud_journey_views_utils.go b/genesyscloud/journey_views/resource_genesyscloud_journey_views_utils.go index 7c8254f7d..a6e3b35fb 100644 --- a/genesyscloud/journey_views/resource_genesyscloud_journey_views_utils.go +++ b/genesyscloud/journey_views/resource_genesyscloud_journey_views_utils.go @@ -2,9 +2,10 @@ package journey_views import ( "errors" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func buildElements(d *schema.ResourceData) (*[]platformclientv2.Journeyviewelement, error) { diff --git a/genesyscloud/oauth_client/resource_genesyscloud_oauth_client.go b/genesyscloud/oauth_client/resource_genesyscloud_oauth_client.go index 851bf78cc..3693ad9a0 100644 --- a/genesyscloud/oauth_client/resource_genesyscloud_oauth_client.go +++ b/genesyscloud/oauth_client/resource_genesyscloud_oauth_client.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllOAuthClients(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_proxy.go b/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_proxy.go index f4b0416f6..673342dc7 100644 --- a/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_proxy.go +++ b/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_proxy.go @@ -5,7 +5,7 @@ import ( "log" "sync" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *oauthClientProxy diff --git a/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_utils.go b/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_utils.go index dcdacc228..ef33c44ea 100644 --- a/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_utils.go +++ b/genesyscloud/oauth_client/resource_genesyscloud_oauth_client_utils.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func buildOAuthRedirectURIs(d *schema.ResourceData) *[]string { diff --git a/genesyscloud/oauth_client/resource_genesyscloude_oauth_client_unit_test.go b/genesyscloud/oauth_client/resource_genesyscloude_oauth_client_unit_test.go index 2f8b9e9fb..f4a20d830 100644 --- a/genesyscloud/oauth_client/resource_genesyscloude_oauth_client_unit_test.go +++ b/genesyscloud/oauth_client/resource_genesyscloude_oauth_client_unit_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/stretchr/testify/assert" ) diff --git a/genesyscloud/organization_authentication_settings/genesyscloud_organization_authentication_settings_proxy.go b/genesyscloud/organization_authentication_settings/genesyscloud_organization_authentication_settings_proxy.go index bd316f7db..b4a1f3920 100644 --- a/genesyscloud/organization_authentication_settings/genesyscloud_organization_authentication_settings_proxy.go +++ b/genesyscloud/organization_authentication_settings/genesyscloud_organization_authentication_settings_proxy.go @@ -3,7 +3,8 @@ package organization_authentication_settings import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings.go b/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings.go index 00e0e5f2f..18f951c6b 100644 --- a/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings.go +++ b/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings.go @@ -3,9 +3,6 @@ package organization_authentication_settings import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -13,6 +10,10 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/constants" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" + "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" diff --git a/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_unit_test.go b/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_unit_test.go index 2d65d7a8b..6d9e2a9c3 100644 --- a/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_unit_test.go +++ b/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_unit_test.go @@ -2,14 +2,15 @@ package organization_authentication_settings import ( "context" + "net/http" + "terraform-provider-genesyscloud/genesyscloud/provider" + "testing" + "github.com/google/go-cmp/cmp" "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/stretchr/testify/assert" - "net/http" - "terraform-provider-genesyscloud/genesyscloud/provider" - "testing" ) // Unit Test diff --git a/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_utils.go b/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_utils.go index d981238fd..cdd63df6a 100644 --- a/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_utils.go +++ b/genesyscloud/organization_authentication_settings/resource_genesyscloud_organization_authentication_settings_utils.go @@ -5,7 +5,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/orgauthorization_pairing/genesyscloud_orgauthorization_pairing_proxy.go b/genesyscloud/orgauthorization_pairing/genesyscloud_orgauthorization_pairing_proxy.go index 5cfb68125..dda0b1368 100644 --- a/genesyscloud/orgauthorization_pairing/genesyscloud_orgauthorization_pairing_proxy.go +++ b/genesyscloud/orgauthorization_pairing/genesyscloud_orgauthorization_pairing_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *orgauthorizationPairingProxy diff --git a/genesyscloud/orgauthorization_pairing/resource_genesyscloud_orgauthorization_pairing.go b/genesyscloud/orgauthorization_pairing/resource_genesyscloud_orgauthorization_pairing.go index 5f4bc6923..87c15d137 100644 --- a/genesyscloud/orgauthorization_pairing/resource_genesyscloud_orgauthorization_pairing.go +++ b/genesyscloud/orgauthorization_pairing/resource_genesyscloud_orgauthorization_pairing.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func createOrgauthorizationPairing(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { diff --git a/genesyscloud/outbound/data_source_genesyscloud_outbound_cattemptlimit.go b/genesyscloud/outbound/data_source_genesyscloud_outbound_cattemptlimit.go index 25a84f122..a76adebbc 100644 --- a/genesyscloud/outbound/data_source_genesyscloud_outbound_cattemptlimit.go +++ b/genesyscloud/outbound/data_source_genesyscloud_outbound_cattemptlimit.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func DataSourceOutboundAttemptLimit() *schema.Resource { diff --git a/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign.go b/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign.go index 391bbdbf2..a6b3bae39 100644 --- a/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign.go +++ b/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceOutboundMessagingcampaign() *schema.Resource { diff --git a/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign_test.go b/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign_test.go index a95ebc65b..56192696e 100644 --- a/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign_test.go +++ b/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var TrueValue = "true" diff --git a/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign.go b/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign.go index b497d5851..1c1a11c11 100644 --- a/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign.go +++ b/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) const ( diff --git a/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign_test.go b/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign_test.go index c0d206474..7f4e83de3 100644 --- a/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign_test.go +++ b/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" obCallableTimeset "terraform-provider-genesyscloud/genesyscloud/outbound_callabletimeset" obContactList "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list" diff --git a/genesyscloud/outbound_attempt_limit/data_source_genesyscloud_outbound_attemptlimit.go b/genesyscloud/outbound_attempt_limit/data_source_genesyscloud_outbound_attemptlimit.go index 1d330796b..36308b5a8 100644 --- a/genesyscloud/outbound_attempt_limit/data_source_genesyscloud_outbound_attemptlimit.go +++ b/genesyscloud/outbound_attempt_limit/data_source_genesyscloud_outbound_attemptlimit.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func DataSourceOutboundAttemptLimit() *schema.Resource { diff --git a/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit.go b/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit.go index febb736c6..501055d4f 100644 --- a/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit.go +++ b/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) const ( diff --git a/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit_test.go b/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit_test.go index d9d1292be..53880070f 100644 --- a/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit_test.go +++ b/genesyscloud/outbound_attempt_limit/resource_genesyscloud_outbound_attemptlimit_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // func init() { diff --git a/genesyscloud/outbound_callabletimeset/genesyscloud_outbound_callabletimeset_proxy.go b/genesyscloud/outbound_callabletimeset/genesyscloud_outbound_callabletimeset_proxy.go index 96f564262..9e07b4c83 100644 --- a/genesyscloud/outbound_callabletimeset/genesyscloud_outbound_callabletimeset_proxy.go +++ b/genesyscloud/outbound_callabletimeset/genesyscloud_outbound_callabletimeset_proxy.go @@ -6,7 +6,7 @@ import ( "log" "strings" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset.go b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset.go index c9eb25331..3252e41c7 100644 --- a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset.go +++ b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_test.go b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_test.go index 12f28a9d2..f899b1fea 100644 --- a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_test.go +++ b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceOutboundCallabletimeset(t *testing.T) { diff --git a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_utils.go b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_utils.go index acba89881..7186d9656 100644 --- a/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_utils.go +++ b/genesyscloud/outbound_callabletimeset/resource_genesyscloud_outbound_callabletimeset_utils.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_callanalysisresponseset/genesyscloud_outbound_callanalysisresponseset_proxy.go b/genesyscloud/outbound_callanalysisresponseset/genesyscloud_outbound_callanalysisresponseset_proxy.go index 5eded85c3..d2be5cd95 100644 --- a/genesyscloud/outbound_callanalysisresponseset/genesyscloud_outbound_callanalysisresponseset_proxy.go +++ b/genesyscloud/outbound_callanalysisresponseset/genesyscloud_outbound_callanalysisresponseset_proxy.go @@ -3,8 +3,9 @@ package outbound_callanalysisresponseset import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset.go b/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset.go index 90744ea1f..4a78aa3ef 100644 --- a/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset.go +++ b/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset.go @@ -3,10 +3,6 @@ package outbound_callanalysisresponseset import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -15,6 +11,11 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_test.go b/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_test.go index 74cd9f5fd..7083040f3 100644 --- a/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_test.go +++ b/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceOutboundCallAnalysisResponseSet(t *testing.T) { diff --git a/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_utils.go b/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_utils.go index d48a46401..766684c0d 100644 --- a/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_utils.go +++ b/genesyscloud/outbound_callanalysisresponseset/resource_genesyscloud_outbound_callanalysisresponseset_utils.go @@ -2,10 +2,11 @@ package outbound_callanalysisresponseset import ( "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "strings" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getResponseSetFromResourceData(d *schema.ResourceData) platformclientv2.Responseset { diff --git a/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_init_test.go b/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_init_test.go index 03bdbd559..fe001444c 100644 --- a/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_init_test.go +++ b/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_init_test.go @@ -16,7 +16,7 @@ import ( telephonyProvidersEdgesSite "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site" "testing" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_proxy.go b/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_proxy.go index 8105cebb3..c73561bab 100644 --- a/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_proxy.go +++ b/genesyscloud/outbound_campaign/genesyscloud_outbound_campaign_proxy.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign.go b/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign.go index bdcd48c47..26ca8308c 100644 --- a/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign.go +++ b/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_test.go b/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_test.go index 2ada8f3fa..55a7c5004 100644 --- a/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_test.go +++ b/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_test.go @@ -23,7 +23,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // Add a special generator DEVENGAGE-1646. Basically, the API makes it look like you need a full phone_columns field here. However, the API ignores the type because the devs reused the phone_columns object. However, diff --git a/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_utils.go b/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_utils.go index 6f8fdc95a..dbd2b3d46 100644 --- a/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_utils.go +++ b/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_utils.go @@ -18,7 +18,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_campaignrule/data_source_genesyscloud_outbound_campaignrule.go b/genesyscloud/outbound_campaignrule/data_source_genesyscloud_outbound_campaignrule.go index e6694ebb2..9bd8ae0b5 100644 --- a/genesyscloud/outbound_campaignrule/data_source_genesyscloud_outbound_campaignrule.go +++ b/genesyscloud/outbound_campaignrule/data_source_genesyscloud_outbound_campaignrule.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceOutboundCampaignruleRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { diff --git a/genesyscloud/outbound_campaignrule/genesyscloud_outbound_campaignrule_proxy.go b/genesyscloud/outbound_campaignrule/genesyscloud_outbound_campaignrule_proxy.go index 0af2b5ba4..9d5fce2b3 100644 --- a/genesyscloud/outbound_campaignrule/genesyscloud_outbound_campaignrule_proxy.go +++ b/genesyscloud/outbound_campaignrule/genesyscloud_outbound_campaignrule_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule.go b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule.go index f94ae8fe3..b94076b68 100644 --- a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule.go +++ b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllAuthCampaignRules(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_test.go b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_test.go index 2a1726d2f..2e4353e1e 100644 --- a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_test.go +++ b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceOutboundCampaignRuleBasic(t *testing.T) { diff --git a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_unit_test.go b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_unit_test.go index aa5a5196c..314548cf4 100644 --- a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_unit_test.go +++ b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_unit_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/stretchr/testify/assert" ) diff --git a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_utils.go b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_utils.go index 0d3240299..152bef57b 100644 --- a/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_utils.go +++ b/genesyscloud/outbound_campaignrule/resource_genesyscloud_outbound_campaignrule_utils.go @@ -5,7 +5,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getCampaignruleFromResourceData(d *schema.ResourceData) platformclientv2.Campaignrule { diff --git a/genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contactlist.go b/genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contactlist.go index 3c2f58501..b3fb96131 100644 --- a/genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contactlist.go +++ b/genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contactlist.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func DataSourceOutboundContactList() *schema.Resource { diff --git a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist.go b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist.go index 144afc54a..3e0b05fdf 100644 --- a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist.go +++ b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) const ( diff --git a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist_test.go b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist_test.go index fd80cce10..a07bfdedf 100644 --- a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist_test.go +++ b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceOutboundContactListBasic(t *testing.T) { diff --git a/genesyscloud/outbound_contact_list_contact/genesyscloud_outbound_contact_list_contact_proxy.go b/genesyscloud/outbound_contact_list_contact/genesyscloud_outbound_contact_list_contact_proxy.go index 021e5b804..805bdb53b 100644 --- a/genesyscloud/outbound_contact_list_contact/genesyscloud_outbound_contact_list_contact_proxy.go +++ b/genesyscloud/outbound_contact_list_contact/genesyscloud_outbound_contact_list_contact_proxy.go @@ -2,8 +2,9 @@ package outbound_contact_list_contact import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *contactProxy diff --git a/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact.go b/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact.go index d8e4cdab6..5aa60af40 100644 --- a/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact.go +++ b/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact.go @@ -3,10 +3,6 @@ package outbound_contact_list_contact import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -15,6 +11,11 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllContacts(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_utils.go b/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_utils.go index 797624746..e7bf542f0 100644 --- a/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_utils.go +++ b/genesyscloud/outbound_contact_list_contact/resource_genesyscloud_outbound_contact_list_contact_utils.go @@ -2,11 +2,12 @@ package outbound_contact_list_contact import ( "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "strings" utillists "terraform-provider-genesyscloud/genesyscloud/util/lists" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // buildWritableContactFromResourceData used to build the request body for contact creation diff --git a/genesyscloud/outbound_contactlistfilter/genesyscloud_outbound_contactlistfilter_proxy.go b/genesyscloud/outbound_contactlistfilter/genesyscloud_outbound_contactlistfilter_proxy.go index b1e9651bb..f31cd1302 100644 --- a/genesyscloud/outbound_contactlistfilter/genesyscloud_outbound_contactlistfilter_proxy.go +++ b/genesyscloud/outbound_contactlistfilter/genesyscloud_outbound_contactlistfilter_proxy.go @@ -3,8 +3,9 @@ package outbound_contactlistfilter import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter.go b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter.go index 135ed9a44..ec48254e9 100644 --- a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter.go +++ b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter.go @@ -3,10 +3,6 @@ package outbound_contactlistfilter import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -15,6 +11,11 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_test.go b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_test.go index 385842ec2..2b11c3dae 100644 --- a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_test.go +++ b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceOutboundContactListFilter(t *testing.T) { diff --git a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_utils.go b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_utils.go index ae8aa6042..c76d07fdc 100644 --- a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_utils.go +++ b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_utils.go @@ -2,11 +2,12 @@ package outbound_contactlistfilter import ( "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "strings" "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getContactlistfilterFromResourceData(d *schema.ResourceData) platformclientv2.Contactlistfilter { diff --git a/genesyscloud/outbound_dnclist/genesyscloud_outbound_dnclist_proxy.go b/genesyscloud/outbound_dnclist/genesyscloud_outbound_dnclist_proxy.go index dc051f755..1e2833edc 100644 --- a/genesyscloud/outbound_dnclist/genesyscloud_outbound_dnclist_proxy.go +++ b/genesyscloud/outbound_dnclist/genesyscloud_outbound_dnclist_proxy.go @@ -3,10 +3,11 @@ package outbound_dnclist import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/util" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *outboundDnclistProxy diff --git a/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist.go b/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist.go index 5a98e1aa7..d77595ba2 100644 --- a/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist.go +++ b/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllOutboundDncLists(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_test.go b/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_test.go index 1eed72464..5b24ce8af 100644 --- a/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_test.go +++ b/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) const NullValue = "null" diff --git a/genesyscloud/outbound_filespecificationtemplate/genesyscloud_outbound_filespecificationtemplate_proxy.go b/genesyscloud/outbound_filespecificationtemplate/genesyscloud_outbound_filespecificationtemplate_proxy.go index 189cc266b..31a27000f 100644 --- a/genesyscloud/outbound_filespecificationtemplate/genesyscloud_outbound_filespecificationtemplate_proxy.go +++ b/genesyscloud/outbound_filespecificationtemplate/genesyscloud_outbound_filespecificationtemplate_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate.go b/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate.go index 8aaed672a..01905de0f 100644 --- a/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate.go +++ b/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllFileSpecificationTemplates(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_test.go b/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_test.go index 7e272fa62..36765840d 100644 --- a/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_test.go +++ b/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceOutboundFileSpecificationTemplate(t *testing.T) { diff --git a/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_utils.go b/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_utils.go index f765fa485..db00f47d2 100644 --- a/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_utils.go +++ b/genesyscloud/outbound_filespecificationtemplate/resource_genesyscloud_outbound_filespecificationtemplate_utils.go @@ -1,9 +1,10 @@ package outbound_filespecificationtemplate import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getFilespecificationtemplateFromResourceData(d *schema.ResourceData) platformclientv2.Filespecificationtemplate { diff --git a/genesyscloud/outbound_ruleset/genesyscloud_outbound_ruleset_proxy.go b/genesyscloud/outbound_ruleset/genesyscloud_outbound_ruleset_proxy.go index 5e12b64ee..303e62e84 100644 --- a/genesyscloud/outbound_ruleset/genesyscloud_outbound_ruleset_proxy.go +++ b/genesyscloud/outbound_ruleset/genesyscloud_outbound_ruleset_proxy.go @@ -6,7 +6,7 @@ import ( "log" "strings" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset.go b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset.go index 37cfa4574..932a5cda7 100644 --- a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset.go +++ b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_test.go b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_test.go index d25b21570..36f0b7f28 100644 --- a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_test.go +++ b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" obContactList "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list" ) diff --git a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_unit_test.go b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_unit_test.go index d39433a83..9013a7365 100644 --- a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_unit_test.go +++ b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_unit_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestUnitDoesRuleConditionsRefDeletedSkill(t *testing.T) { diff --git a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_utils.go b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_utils.go index 6266b7a65..fd89ccf42 100644 --- a/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_utils.go +++ b/genesyscloud/outbound_ruleset/resource_genesyscloud_outbound_ruleset_utils.go @@ -9,7 +9,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_init_test.go b/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_init_test.go index 35029a3e7..c9d70d283 100644 --- a/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_init_test.go +++ b/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_init_test.go @@ -12,7 +12,7 @@ import ( edgeSite "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site" "testing" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_proxy.go b/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_proxy.go index 85532bf50..d3fec81b8 100644 --- a/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_proxy.go +++ b/genesyscloud/outbound_sequence/genesyscloud_outbound_sequence_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence.go b/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence.go index 5bb9e88d7..375c4cfcc 100644 --- a/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence.go +++ b/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_test.go b/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_test.go index 3740a0da7..1ed0faccd 100644 --- a/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_test.go +++ b/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceOutboundSequence(t *testing.T) { diff --git a/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_utils.go b/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_utils.go index 3040db3dc..e0118f77f 100644 --- a/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_utils.go +++ b/genesyscloud/outbound_sequence/resource_genesyscloud_outbound_sequence_utils.go @@ -6,7 +6,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_settings/genesyscloud_outbound_settings_proxy.go b/genesyscloud/outbound_settings/genesyscloud_outbound_settings_proxy.go index 1c30b0a12..e3f9843ea 100644 --- a/genesyscloud/outbound_settings/genesyscloud_outbound_settings_proxy.go +++ b/genesyscloud/outbound_settings/genesyscloud_outbound_settings_proxy.go @@ -3,7 +3,8 @@ package outbound_settings import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings.go b/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings.go index 0febb5174..1a62d1dd3 100644 --- a/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings.go +++ b/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings.go @@ -3,10 +3,6 @@ package outbound_settings import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -15,6 +11,11 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/constants" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings_utils.go b/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings_utils.go index 06c3989a6..65af76bfe 100644 --- a/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings_utils.go +++ b/genesyscloud/outbound_settings/resource_genesyscloud_outbound_settings_utils.go @@ -1,11 +1,12 @@ package outbound_settings import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/tfexporter_state" "terraform-provider-genesyscloud/genesyscloud/util/lists" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func buildOutboundSettingsAutomaticTimeZoneMapping(d *schema.ResourceData) *platformclientv2.Automatictimezonemappingsettings { diff --git a/genesyscloud/outbound_wrapupcode_mappings/genesyscloud_wrapupcode_mappings_proxy.go b/genesyscloud/outbound_wrapupcode_mappings/genesyscloud_wrapupcode_mappings_proxy.go index 16e688455..c706d4d96 100644 --- a/genesyscloud/outbound_wrapupcode_mappings/genesyscloud_wrapupcode_mappings_proxy.go +++ b/genesyscloud/outbound_wrapupcode_mappings/genesyscloud_wrapupcode_mappings_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *outboundWrapupCodeMappingsProxy diff --git a/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcode_mappings_utils.go b/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcode_mappings_utils.go index 1785d9808..8303ab14b 100644 --- a/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcode_mappings_utils.go +++ b/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcode_mappings_utils.go @@ -4,7 +4,7 @@ import ( lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // flattenOutboundWrapupCodeMappings maps a Genesys Cloud Wrapupcodemapping to a schema.Set diff --git a/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcodemappings.go b/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcodemappings.go index cccca5eb1..bab81ed6e 100644 --- a/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcodemappings.go +++ b/genesyscloud/outbound_wrapupcode_mappings/resource_genesyscloud_outbound_wrapupcodemappings.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // getOutboundWrapupCodeMappings is used by the exporter to return all wrapupcode mappings diff --git a/genesyscloud/process_automation_trigger/data_source_genesyscloud_processautomation_trigger.go b/genesyscloud/process_automation_trigger/data_source_genesyscloud_processautomation_trigger.go index 0a8ee565b..e321312d8 100644 --- a/genesyscloud/process_automation_trigger/data_source_genesyscloud_processautomation_trigger.go +++ b/genesyscloud/process_automation_trigger/data_source_genesyscloud_processautomation_trigger.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type ProcessAutomationTriggers struct { diff --git a/genesyscloud/process_automation_trigger/process_automation_triggers_proxy.go b/genesyscloud/process_automation_trigger/process_automation_triggers_proxy.go index 3f6b07371..a2eb9daa3 100644 --- a/genesyscloud/process_automation_trigger/process_automation_triggers_proxy.go +++ b/genesyscloud/process_automation_trigger/process_automation_triggers_proxy.go @@ -11,7 +11,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func postProcessAutomationTrigger(pat *ProcessAutomationTrigger, api *platformclientv2.IntegrationsApi) (*ProcessAutomationTrigger, *platformclientv2.APIResponse, error) { diff --git a/genesyscloud/process_automation_trigger/process_automations_triggers_struct.go b/genesyscloud/process_automation_trigger/process_automations_triggers_struct.go index 539b80dfd..947625597 100644 --- a/genesyscloud/process_automation_trigger/process_automations_triggers_struct.go +++ b/genesyscloud/process_automation_trigger/process_automations_triggers_struct.go @@ -3,7 +3,7 @@ package process_automation_trigger import ( "encoding/json" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type ProcessAutomationTrigger struct { diff --git a/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger.go b/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger.go index b6878f8a7..b301d73a0 100644 --- a/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger.go +++ b/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger.go @@ -2,17 +2,18 @@ package process_automation_trigger import ( "context" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/constants" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "fmt" "log" "time" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger_test.go b/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger_test.go index e2905376f..363fcab19 100644 --- a/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger_test.go +++ b/genesyscloud/process_automation_trigger/resource_genesyscloud_processautomation_trigger_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceProcessAutomationTrigger(t *testing.T) { diff --git a/genesyscloud/provider/division.go b/genesyscloud/provider/division.go index 9fefad4a8..e13afe209 100644 --- a/genesyscloud/provider/division.go +++ b/genesyscloud/provider/division.go @@ -1,9 +1,10 @@ package provider import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "sync" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type JsonMap map[string]interface{} diff --git a/genesyscloud/provider/provider.go b/genesyscloud/provider/provider.go index 346a29ffb..52f3704ee 100644 --- a/genesyscloud/provider/provider.go +++ b/genesyscloud/provider/provider.go @@ -3,7 +3,6 @@ package provider import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "log" "net/http" "os" @@ -12,10 +11,12 @@ import ( "strings" "time" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func init() { diff --git a/genesyscloud/provider/sdk_client_pool.go b/genesyscloud/provider/sdk_client_pool.go index 0123f541c..944661c5c 100644 --- a/genesyscloud/provider/sdk_client_pool.go +++ b/genesyscloud/provider/sdk_client_pool.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // SDKClientPool holds a Pool of client configs for the Genesys Cloud SDK. One should be diff --git a/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_init_test.go b/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_init_test.go index 35700f2f1..21bafbcb0 100644 --- a/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_init_test.go +++ b/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_init_test.go @@ -14,7 +14,7 @@ import ( "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_proxy.go b/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_proxy.go index 345294b53..43a61e614 100644 --- a/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_proxy.go +++ b/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_proxy.go @@ -7,7 +7,7 @@ import ( "net/http" "net/url" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy.go b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy.go index fc0777536..b89e8e7ce 100644 --- a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy.go +++ b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_test.go b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_test.go index 0c1b4c0a8..9b7bcc10a 100644 --- a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_test.go +++ b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_test.go @@ -22,7 +22,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_utils.go b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_utils.go index 62037798c..c3f69f1e3 100644 --- a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_utils.go +++ b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_utils.go @@ -10,7 +10,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/resource_cache/datasource_cache.go b/genesyscloud/resource_cache/datasource_cache.go index 20559e103..231874c09 100644 --- a/genesyscloud/resource_cache/datasource_cache.go +++ b/genesyscloud/resource_cache/datasource_cache.go @@ -8,7 +8,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // Cache for Data Sources diff --git a/genesyscloud/resource_exporter/resource_exporter.go b/genesyscloud/resource_exporter/resource_exporter.go index 81d28fbd1..33c97cf31 100644 --- a/genesyscloud/resource_exporter/resource_exporter.go +++ b/genesyscloud/resource_exporter/resource_exporter.go @@ -2,14 +2,15 @@ package resource_exporter import ( "context" - "github.com/hashicorp/go-cty/cty" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "regexp" "strings" "sync" + "github.com/hashicorp/go-cty/cty" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" + lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" diff --git a/genesyscloud/resource_exporter/resource_exporter_custom.go b/genesyscloud/resource_exporter/resource_exporter_custom.go index 70c976f12..3543dd4b4 100644 --- a/genesyscloud/resource_exporter/resource_exporter_custom.go +++ b/genesyscloud/resource_exporter/resource_exporter_custom.go @@ -3,11 +3,12 @@ package resource_exporter import ( "encoding/json" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "regexp" "strings" "terraform-provider-genesyscloud/genesyscloud/util/constants" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/resource_genesyscloud_architect_schedules.go b/genesyscloud/resource_genesyscloud_architect_schedules.go index e8feb700c..038f0db78 100644 --- a/genesyscloud/resource_genesyscloud_architect_schedules.go +++ b/genesyscloud/resource_genesyscloud_architect_schedules.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/leekchan/timeutil" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllArchitectSchedules(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_auth_division.go b/genesyscloud/resource_genesyscloud_auth_division.go index 557ba05d2..59374191b 100644 --- a/genesyscloud/resource_genesyscloud_auth_division.go +++ b/genesyscloud/resource_genesyscloud_auth_division.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllAuthDivisions(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_auth_division_test.go b/genesyscloud/resource_genesyscloud_auth_division_test.go index cebf83c42..fab7c0fb0 100644 --- a/genesyscloud/resource_genesyscloud_auth_division_test.go +++ b/genesyscloud/resource_genesyscloud_auth_division_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceAuthDivisionBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_idp_generic.go b/genesyscloud/resource_genesyscloud_idp_generic.go deleted file mode 100644 index 8db0dad77..000000000 --- a/genesyscloud/resource_genesyscloud_idp_generic.go +++ /dev/null @@ -1,277 +0,0 @@ -package genesyscloud - -import ( - "context" - "fmt" - "log" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" - "terraform-provider-genesyscloud/genesyscloud/util/constants" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - - "terraform-provider-genesyscloud/genesyscloud/consistency_checker" - - resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" - lists "terraform-provider-genesyscloud/genesyscloud/util/lists" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" -) - -func getAllIdpGeneric(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(clientConfig) - resources := make(resourceExporter.ResourceIDMetaMap) - - _, resp, getErr := idpAPI.GetIdentityprovidersGeneric() - if getErr != nil { - if util.IsStatus404(resp) { - // Don't export if config doesn't exist - return resources, nil - } - return nil, util.BuildAPIDiagnosticError("genesyscloud_idp_generic", fmt.Sprintf("Failed to get IDP Generic error: %s", getErr), resp) - } - - resources["0"] = &resourceExporter.ResourceMeta{Name: "generic"} - return resources, nil -} - -func IdpGenericExporter() *resourceExporter.ResourceExporter { - return &resourceExporter.ResourceExporter{ - GetResourcesFunc: provider.GetAllWithPooledClient(getAllIdpGeneric), - RefAttrs: map[string]*resourceExporter.RefAttrSettings{}, // No references - } -} - -func ResourceIdpGeneric() *schema.Resource { - return &schema.Resource{ - Description: "Genesys Cloud Single Sign-on Generic Identity Provider. See this page for detailed configuration instructions: https://help.mypurecloud.com/articles/add-a-generic-single-sign-on-provider/", - - CreateContext: provider.CreateWithPooledClient(createIdpGeneric), - ReadContext: provider.ReadWithPooledClient(readIdpGeneric), - UpdateContext: provider.UpdateWithPooledClient(updateIdpGeneric), - DeleteContext: provider.DeleteWithPooledClient(deleteIdpGeneric), - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - SchemaVersion: 1, - Timeouts: &schema.ResourceTimeout{ - Update: schema.DefaultTimeout(8 * time.Minute), - Read: schema.DefaultTimeout(8 * time.Minute), - }, - Schema: map[string]*schema.Schema{ - "name": { - Description: "Name of the provider.", - Type: schema.TypeString, - Required: true, - }, - "certificates": { - Description: "PEM or DER encoded public X.509 certificates for SAML signature validation.", - Type: schema.TypeList, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "issuer_uri": { - Description: "Issuer URI provided by the provider.", - Type: schema.TypeString, - Required: true, - }, - "target_uri": { - Description: "Target URI provided by the provider.", - Type: schema.TypeString, - Optional: true, - }, - "relying_party_identifier": { - Description: "String used to identify Genesys Cloud to the identity provider.", - Type: schema.TypeString, - Optional: true, - }, - "disabled": { - Description: "True if Generic provider is disabled.", - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "logo_image_data": { - Description: "Base64 encoded SVG image.", - Type: schema.TypeString, - Optional: true, - }, - "endpoint_compression": { - Description: "True if the Genesys Cloud authentication request should be compressed.", - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "name_identifier_format": { - Description: "SAML name identifier format. (urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified | urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress | urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName | urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName | urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos | urn:oasis:names:tc:SAML:2.0:nameid-format:entity | urn:oasis:names:tc:SAML:2.0:nameid-format:persistent | urn:oasis:names:tc:SAML:2.0:nameid-format:transient)", - Type: schema.TypeString, - Optional: true, - Default: "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", - ValidateFunc: validation.StringInSlice([]string{ - "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", - "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", - "urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName", - "urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName", - "urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos", - "urn:oasis:names:tc:SAML:2.0:nameid-format:entity", - "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent", - "urn:oasis:names:tc:SAML:2.0:nameid-format:transient", - }, false), - }, - }, - } -} - -func createIdpGeneric(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - log.Printf("Creating IDP Generic") - d.SetId("generic") - return updateIdpGeneric(ctx, d, meta) -} - -func readIdpGeneric(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(sdkConfig) - cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceIdpGeneric(), constants.DefaultConsistencyChecks, "genesyscloud_idp_generic") - - log.Printf("Reading IDP Generic") - - return util.WithRetriesForReadCustomTimeout(ctx, d.Timeout(schema.TimeoutRead), d, func() *retry.RetryError { - generic, resp, getErr := idpAPI.GetIdentityprovidersGeneric() - if getErr != nil { - if util.IsStatus404(resp) { - createIdpGeneric(ctx, d, meta) - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_generic", fmt.Sprintf("Failed to read IDP Generic: %s", getErr), resp)) - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_generic", fmt.Sprintf("Failed to read IDP Generic: %s", getErr), resp)) - } - - if generic.Name != nil { - d.Set("name", *generic.Name) - } else { - d.Set("name", nil) - } - - if generic.Certificate != nil { - d.Set("certificates", lists.StringListToInterfaceList([]string{*generic.Certificate})) - } else if generic.Certificates != nil { - d.Set("certificates", lists.StringListToInterfaceList(*generic.Certificates)) - } else { - d.Set("certificates", nil) - } - - if generic.IssuerURI != nil { - d.Set("issuer_uri", *generic.IssuerURI) - } else { - d.Set("issuer_uri", nil) - } - - if generic.SsoTargetURI != nil { - d.Set("target_uri", *generic.SsoTargetURI) - } else { - d.Set("target_uri", nil) - } - - if generic.RelyingPartyIdentifier != nil { - d.Set("relying_party_identifier", *generic.RelyingPartyIdentifier) - } else { - d.Set("relying_party_identifier", nil) - } - - if generic.Disabled != nil { - d.Set("disabled", *generic.Disabled) - } else { - d.Set("disabled", nil) - } - - if generic.LogoImageData != nil { - d.Set("logo_image_data", *generic.LogoImageData) - } else { - d.Set("logo_image_data", nil) - } - - if generic.EndpointCompression != nil { - d.Set("endpoint_compression", *generic.EndpointCompression) - } else { - d.Set("endpoint_compression", nil) - } - - if generic.NameIdentifierFormat != nil { - d.Set("name_identifier_format", *generic.NameIdentifierFormat) - } else { - d.Set("name_identifier_format", nil) - } - - log.Printf("Read IDP Generic") - return cc.CheckState(d) - }) -} - -func updateIdpGeneric(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - name := d.Get("name").(string) - issuerUri := d.Get("issuer_uri").(string) - targetUri := d.Get("target_uri").(string) - relyingPartyID := d.Get("relying_party_identifier").(string) - disabled := d.Get("disabled").(bool) - logoImageData := d.Get("logo_image_data").(string) - endpointCompression := d.Get("endpoint_compression").(bool) - nameIdentifierFormat := d.Get("name_identifier_format").(string) - - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(sdkConfig) - - log.Printf("Updating IDP Generic") - update := platformclientv2.Genericsaml{ - Name: &name, - IssuerURI: &issuerUri, - SsoTargetURI: &targetUri, - RelyingPartyIdentifier: &relyingPartyID, - Disabled: &disabled, - LogoImageData: &logoImageData, - EndpointCompression: &endpointCompression, - NameIdentifierFormat: &nameIdentifierFormat, - } - - certificates := lists.BuildSdkStringListFromInterfaceArray(d, "certificates") - if certificates != nil { - if len(*certificates) == 1 { - update.Certificate = &(*certificates)[0] - } - update.Certificates = certificates - } - - _, resp, err := idpAPI.PutIdentityprovidersGeneric(update) - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_idp_generic", fmt.Sprintf("Failed to update IDP Generic %s error: %s", d.Id(), err), resp) - } - - log.Printf("Updated IDP Generic") - return readIdpGeneric(ctx, d, meta) -} - -func deleteIdpGeneric(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(sdkConfig) - - log.Printf("Deleting IDP Generic") - _, resp, err := idpAPI.DeleteIdentityprovidersGeneric() - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_idp_generic", fmt.Sprintf("Failed to delete IDP Generic %s error: %s", d.Id(), err), resp) - } - - return util.WithRetries(ctx, 60*time.Second, func() *retry.RetryError { - _, resp, err := idpAPI.GetIdentityprovidersGeneric() - if err != nil { - if util.IsStatus404(resp) { - // IDP Generic deleted - log.Printf("Deleted IDP Generic") - return nil - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_generic", fmt.Sprintf("Error deleting IDP Generic: %s", err), resp)) - } - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_generic", fmt.Sprintf("IDP Generic still exists"), resp)) - }) -} diff --git a/genesyscloud/resource_genesyscloud_idp_gsuite.go b/genesyscloud/resource_genesyscloud_idp_gsuite.go deleted file mode 100644 index 75a412cdc..000000000 --- a/genesyscloud/resource_genesyscloud_idp_gsuite.go +++ /dev/null @@ -1,212 +0,0 @@ -package genesyscloud - -import ( - "context" - "fmt" - "log" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" - "terraform-provider-genesyscloud/genesyscloud/util/constants" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - - "terraform-provider-genesyscloud/genesyscloud/consistency_checker" - - resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" - lists "terraform-provider-genesyscloud/genesyscloud/util/lists" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" -) - -func getAllIdpGsuite(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(clientConfig) - resources := make(resourceExporter.ResourceIDMetaMap) - - _, resp, getErr := idpAPI.GetIdentityprovidersGsuite() - if getErr != nil { - if util.IsStatus404(resp) { - // Don't export if config doesn't exist - return resources, nil - } - return nil, util.BuildAPIDiagnosticError("genesyscloud_idp_gsuite", fmt.Sprintf("Failed to get IDP GSuite error: %s", getErr), resp) - } - - resources["0"] = &resourceExporter.ResourceMeta{Name: "gsuite"} - return resources, nil -} - -func IdpGsuiteExporter() *resourceExporter.ResourceExporter { - return &resourceExporter.ResourceExporter{ - GetResourcesFunc: provider.GetAllWithPooledClient(getAllIdpGsuite), - RefAttrs: map[string]*resourceExporter.RefAttrSettings{}, // No references - } -} - -func ResourceIdpGsuite() *schema.Resource { - return &schema.Resource{ - Description: "Genesys Cloud Single Sign-on GSuite Identity Provider. See this page for detailed configuration instructions: https://help.mypurecloud.com/articles/add-google-g-suite-single-sign-provider/", - - CreateContext: provider.CreateWithPooledClient(createIdpGsuite), - ReadContext: provider.ReadWithPooledClient(readIdpGsuite), - UpdateContext: provider.UpdateWithPooledClient(updateIdpGsuite), - DeleteContext: provider.DeleteWithPooledClient(deleteIdpGsuite), - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - SchemaVersion: 1, - Timeouts: &schema.ResourceTimeout{ - Update: schema.DefaultTimeout(8 * time.Minute), - Read: schema.DefaultTimeout(8 * time.Minute), - }, - Schema: map[string]*schema.Schema{ - "certificates": { - Description: "PEM or DER encoded public X.509 certificates for SAML signature validation.", - Type: schema.TypeList, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "issuer_uri": { - Description: "Issuer URI provided by GSuite.", - Type: schema.TypeString, - Required: true, - }, - "target_uri": { - Description: "Target URI provided by GSuite.", - Type: schema.TypeString, - Optional: true, - }, - "relying_party_identifier": { - Description: "String used to identify Genesys Cloud to GSuite.", - Type: schema.TypeString, - Optional: true, - }, - "disabled": { - Description: "True if GSuite is disabled.", - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - }, - } -} - -func createIdpGsuite(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - log.Printf("Creating IDP GSuite") - d.SetId("gsuite") - return updateIdpGsuite(ctx, d, meta) -} - -func readIdpGsuite(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(sdkConfig) - cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceIdpGsuite(), constants.DefaultConsistencyChecks, "genesyscloud_idp_gsuite") - - log.Printf("Reading IDP GSuite") - - return util.WithRetriesForReadCustomTimeout(ctx, d.Timeout(schema.TimeoutRead), d, func() *retry.RetryError { - gsuite, resp, getErr := idpAPI.GetIdentityprovidersGsuite() - if getErr != nil { - if util.IsStatus404(resp) { - createIdpGsuite(ctx, d, meta) - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_gsuite", fmt.Sprintf("Failed to read IDP GSuite: %s", getErr), resp)) - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_gsuite", fmt.Sprintf("Failed to read IDP GSuite: %s", getErr), resp)) - } - - if gsuite.Certificate != nil { - d.Set("certificates", lists.StringListToInterfaceList([]string{*gsuite.Certificate})) - } else if gsuite.Certificates != nil { - d.Set("certificates", lists.StringListToInterfaceList(*gsuite.Certificates)) - } else { - d.Set("certificates", nil) - } - - if gsuite.IssuerURI != nil { - d.Set("issuer_uri", *gsuite.IssuerURI) - } else { - d.Set("issuer_uri", nil) - } - - if gsuite.SsoTargetURI != nil { - d.Set("target_uri", *gsuite.SsoTargetURI) - } else { - d.Set("target_uri", nil) - } - - if gsuite.RelyingPartyIdentifier != nil { - d.Set("relying_party_identifier", *gsuite.RelyingPartyIdentifier) - } else { - d.Set("relying_party_identifier", nil) - } - - if gsuite.Disabled != nil { - d.Set("disabled", *gsuite.Disabled) - } else { - d.Set("disabled", nil) - } - - log.Printf("Read IDP GSuite") - return cc.CheckState(d) - }) -} - -func updateIdpGsuite(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - issuerUri := d.Get("issuer_uri").(string) - targetUri := d.Get("target_uri").(string) - relyingPartyID := d.Get("relying_party_identifier").(string) - disabled := d.Get("disabled").(bool) - - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(sdkConfig) - - log.Printf("Updating IDP GSuite") - update := platformclientv2.Gsuite{ - IssuerURI: &issuerUri, - SsoTargetURI: &targetUri, - RelyingPartyIdentifier: &relyingPartyID, - Disabled: &disabled, - } - - certificates := lists.BuildSdkStringListFromInterfaceArray(d, "certificates") - if certificates != nil { - if len(*certificates) == 1 { - update.Certificate = &(*certificates)[0] - } - update.Certificates = certificates - } - - _, resp, err := idpAPI.PutIdentityprovidersGsuite(update) - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_idp_gsuite", fmt.Sprintf("Failed to update IDP GSuite %s error: %s", d.Id(), err), resp) - } - - log.Printf("Updated IDP GSuite") - return readIdpGsuite(ctx, d, meta) -} - -func deleteIdpGsuite(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(sdkConfig) - - log.Printf("Deleting IDP GSuite") - _, resp, err := idpAPI.DeleteIdentityprovidersGsuite() - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_idp_gsuite", fmt.Sprintf("Failed to delete IDP GSuite %s error: %s", d.Id(), err), resp) - } - - return util.WithRetries(ctx, 60*time.Second, func() *retry.RetryError { - _, resp, err := idpAPI.GetIdentityprovidersGsuite() - if err != nil { - if util.IsStatus404(resp) { - // IDP GSuite deleted - log.Printf("Deleted IDP GSuite") - return nil - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_gsuite", fmt.Sprintf("Error deleting IDP GSuite: %s", err), resp)) - } - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_gsuite", fmt.Sprintf("IDP GSuite still exists"), resp)) - }) -} diff --git a/genesyscloud/resource_genesyscloud_idp_onelogin.go b/genesyscloud/resource_genesyscloud_idp_onelogin.go deleted file mode 100644 index 8191969da..000000000 --- a/genesyscloud/resource_genesyscloud_idp_onelogin.go +++ /dev/null @@ -1,199 +0,0 @@ -package genesyscloud - -import ( - "context" - "fmt" - "log" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" - "terraform-provider-genesyscloud/genesyscloud/util/constants" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - - "terraform-provider-genesyscloud/genesyscloud/consistency_checker" - - resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" - lists "terraform-provider-genesyscloud/genesyscloud/util/lists" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" -) - -func getAllIdpOnelogin(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(clientConfig) - resources := make(resourceExporter.ResourceIDMetaMap) - - _, resp, getErr := idpAPI.GetIdentityprovidersOnelogin() - if getErr != nil { - if util.IsStatus404(resp) { - // Don't export if config doesn't exist - return resources, nil - } - return nil, util.BuildAPIDiagnosticError("genesyscloud_idp_onelogin", fmt.Sprintf("Failed to get IDP Onelogin error: %s", getErr), resp) - } - - resources["0"] = &resourceExporter.ResourceMeta{Name: "onelogin"} - return resources, nil -} - -func IdpOneloginExporter() *resourceExporter.ResourceExporter { - return &resourceExporter.ResourceExporter{ - GetResourcesFunc: provider.GetAllWithPooledClient(getAllIdpOnelogin), - RefAttrs: map[string]*resourceExporter.RefAttrSettings{}, // No references - } -} - -func ResourceIdpOnelogin() *schema.Resource { - return &schema.Resource{ - Description: "Genesys Cloud Single Sign-on OneLogin Identity Provider. See this page for detailed configuration instructions: https://help.mypurecloud.com/articles/add-onelogin-as-single-sign-on-provider/", - - CreateContext: provider.CreateWithPooledClient(createIdpOnelogin), - ReadContext: provider.ReadWithPooledClient(readIdpOnelogin), - UpdateContext: provider.UpdateWithPooledClient(updateIdpOnelogin), - DeleteContext: provider.DeleteWithPooledClient(deleteIdpOnelogin), - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - SchemaVersion: 1, - Timeouts: &schema.ResourceTimeout{ - Update: schema.DefaultTimeout(8 * time.Minute), - Read: schema.DefaultTimeout(8 * time.Minute), - }, - Schema: map[string]*schema.Schema{ - "certificates": { - Description: "PEM or DER encoded public X.509 certificates for SAML signature validation.", - Type: schema.TypeList, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "issuer_uri": { - Description: "Issuer URI provided by OneLogin.", - Type: schema.TypeString, - Required: true, - }, - "target_uri": { - Description: "Target URI provided by OneLogin.", - Type: schema.TypeString, - Optional: true, - }, - "disabled": { - Description: "True if OneLogin is disabled.", - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - }, - } -} - -func createIdpOnelogin(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - log.Printf("Creating IDP Onelogin") - d.SetId("onelogin") - return updateIdpOnelogin(ctx, d, meta) -} - -func readIdpOnelogin(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(sdkConfig) - cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceIdpOnelogin(), constants.DefaultConsistencyChecks, "genesyscloud_idp_onelogin") - - log.Printf("Reading IDP Onelogin") - - return util.WithRetriesForReadCustomTimeout(ctx, d.Timeout(schema.TimeoutRead), d, func() *retry.RetryError { - onelogin, resp, getErr := idpAPI.GetIdentityprovidersOnelogin() - if getErr != nil { - if util.IsStatus404(resp) { - createIdpOnelogin(ctx, d, meta) - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_onelogin", fmt.Sprintf("Failed to read IDP Onelogin: %s", getErr), resp)) - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_onelogin", fmt.Sprintf("Failed to read IDP Onelogin: %s", getErr), resp)) - } - - if onelogin.Certificate != nil { - d.Set("certificates", lists.StringListToInterfaceList([]string{*onelogin.Certificate})) - } else if onelogin.Certificates != nil { - d.Set("certificates", lists.StringListToInterfaceList(*onelogin.Certificates)) - } else { - d.Set("certificates", nil) - } - - if onelogin.IssuerURI != nil { - d.Set("issuer_uri", *onelogin.IssuerURI) - } else { - d.Set("issuer_uri", nil) - } - - if onelogin.SsoTargetURI != nil { - d.Set("target_uri", *onelogin.SsoTargetURI) - } else { - d.Set("target_uri", nil) - } - - if onelogin.Disabled != nil { - d.Set("disabled", *onelogin.Disabled) - } else { - d.Set("disabled", nil) - } - - log.Printf("Read IDP Onelogin") - return cc.CheckState(d) - }) -} - -func updateIdpOnelogin(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - issuerUri := d.Get("issuer_uri").(string) - targetUri := d.Get("target_uri").(string) - disabled := d.Get("disabled").(bool) - - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(sdkConfig) - - log.Printf("Updating IDP Onelogin") - update := platformclientv2.Onelogin{ - IssuerURI: &issuerUri, - SsoTargetURI: &targetUri, - Disabled: &disabled, - } - - certificates := lists.BuildSdkStringListFromInterfaceArray(d, "certificates") - if certificates != nil { - if len(*certificates) == 1 { - update.Certificate = &(*certificates)[0] - } - update.Certificates = certificates - } - - _, resp, err := idpAPI.PutIdentityprovidersOnelogin(update) - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_idp_onelogin", fmt.Sprintf("Failed to update IDP Onelogin %s error: %s", d.Id(), err), resp) - } - - log.Printf("Updated IDP Onelogin") - return readIdpOnelogin(ctx, d, meta) -} - -func deleteIdpOnelogin(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(sdkConfig) - - log.Printf("Deleting IDP Onelogin") - _, resp, err := idpAPI.DeleteIdentityprovidersOnelogin() - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_idp_onelogin", fmt.Sprintf("Failed to updadeletete IDP Onelogin %s error: %s", d.Id(), err), resp) - } - - return util.WithRetries(ctx, 60*time.Second, func() *retry.RetryError { - _, resp, err := idpAPI.GetIdentityprovidersOnelogin() - if err != nil { - if util.IsStatus404(resp) { - // IDP Onelogin deleted - log.Printf("Deleted IDP Onelogin") - return nil - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_onelogin", fmt.Sprintf("Error deleting IDP Onelogin: %s", err), resp)) - } - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_onelogin", fmt.Sprintf("IDP Onelogin still exists"), resp)) - }) -} diff --git a/genesyscloud/resource_genesyscloud_idp_ping.go b/genesyscloud/resource_genesyscloud_idp_ping.go deleted file mode 100644 index 5be98daf0..000000000 --- a/genesyscloud/resource_genesyscloud_idp_ping.go +++ /dev/null @@ -1,212 +0,0 @@ -package genesyscloud - -import ( - "context" - "fmt" - "log" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" - "terraform-provider-genesyscloud/genesyscloud/util/constants" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - - "terraform-provider-genesyscloud/genesyscloud/consistency_checker" - - resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" - lists "terraform-provider-genesyscloud/genesyscloud/util/lists" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" -) - -func getAllIdpPing(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(clientConfig) - resources := make(resourceExporter.ResourceIDMetaMap) - - _, resp, getErr := idpAPI.GetIdentityprovidersPing() - if getErr != nil { - if util.IsStatus404(resp) { - // Don't export if config doesn't exist - return resources, nil - } - return nil, util.BuildAPIDiagnosticError("genesyscloud_idp_ping", fmt.Sprintf("Failed to get IDP Ping error: %s", getErr), resp) - } - - resources["0"] = &resourceExporter.ResourceMeta{Name: "ping"} - return resources, nil -} - -func IdpPingExporter() *resourceExporter.ResourceExporter { - return &resourceExporter.ResourceExporter{ - GetResourcesFunc: provider.GetAllWithPooledClient(getAllIdpPing), - RefAttrs: map[string]*resourceExporter.RefAttrSettings{}, // No references - } -} - -func ResourceIdpPing() *schema.Resource { - return &schema.Resource{ - Description: "Genesys Cloud Single Sign-on Ping Identity Provider. See this page for detailed configuration instructions: https://help.mypurecloud.com/articles/add-ping-identity-single-sign-provider/", - - CreateContext: provider.CreateWithPooledClient(createIdpPing), - ReadContext: provider.ReadWithPooledClient(readIdpPing), - UpdateContext: provider.UpdateWithPooledClient(updateIdpPing), - DeleteContext: provider.DeleteWithPooledClient(deleteIdpPing), - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - SchemaVersion: 1, - Timeouts: &schema.ResourceTimeout{ - Update: schema.DefaultTimeout(8 * time.Minute), - Read: schema.DefaultTimeout(8 * time.Minute), - }, - Schema: map[string]*schema.Schema{ - "certificates": { - Description: "PEM or DER encoded public X.509 certificates for SAML signature validation.", - Type: schema.TypeList, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "issuer_uri": { - Description: "Issuer URI provided by Ping.", - Type: schema.TypeString, - Required: true, - }, - "target_uri": { - Description: "Target URI provided by Ping.", - Type: schema.TypeString, - Optional: true, - }, - "relying_party_identifier": { - Description: "String used to identify Genesys Cloud to Ping.", - Type: schema.TypeString, - Optional: true, - }, - "disabled": { - Description: "True if Ping is disabled.", - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - }, - } -} - -func createIdpPing(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - log.Printf("Creating IDP Ping") - d.SetId("ping") - return updateIdpPing(ctx, d, meta) -} - -func readIdpPing(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(sdkConfig) - cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceIdpPing(), constants.DefaultConsistencyChecks, "genesyscloud_idp_ping") - - log.Printf("Reading IDP Ping") - - return util.WithRetriesForReadCustomTimeout(ctx, d.Timeout(schema.TimeoutRead), d, func() *retry.RetryError { - ping, resp, getErr := idpAPI.GetIdentityprovidersPing() - if getErr != nil { - if util.IsStatus404(resp) { - createIdpPing(ctx, d, meta) - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_ping", fmt.Sprintf("Failed to read IDP Ping: %s", getErr), resp)) - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_ping", fmt.Sprintf("Failed to read IDP Ping: %s", getErr), resp)) - } - - if ping.Certificate != nil { - d.Set("certificates", lists.StringListToInterfaceList([]string{*ping.Certificate})) - } else if ping.Certificates != nil { - d.Set("certificates", lists.StringListToInterfaceList(*ping.Certificates)) - } else { - d.Set("certificates", nil) - } - - if ping.IssuerURI != nil { - d.Set("issuer_uri", *ping.IssuerURI) - } else { - d.Set("issuer_uri", nil) - } - - if ping.SsoTargetURI != nil { - d.Set("target_uri", *ping.SsoTargetURI) - } else { - d.Set("target_uri", nil) - } - - if ping.RelyingPartyIdentifier != nil { - d.Set("relying_party_identifier", *ping.RelyingPartyIdentifier) - } else { - d.Set("relying_party_identifier", nil) - } - - if ping.Disabled != nil { - d.Set("disabled", *ping.Disabled) - } else { - d.Set("disabled", nil) - } - - log.Printf("Read IDP Ping") - return cc.CheckState(d) - }) -} - -func updateIdpPing(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - issuerUri := d.Get("issuer_uri").(string) - targetUri := d.Get("target_uri").(string) - relyingPartyID := d.Get("relying_party_identifier").(string) - disabled := d.Get("disabled").(bool) - - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(sdkConfig) - - log.Printf("Updating IDP Ping") - update := platformclientv2.Pingidentity{ - IssuerURI: &issuerUri, - SsoTargetURI: &targetUri, - RelyingPartyIdentifier: &relyingPartyID, - Disabled: &disabled, - } - - certificates := lists.BuildSdkStringListFromInterfaceArray(d, "certificates") - if certificates != nil { - if len(*certificates) == 1 { - update.Certificate = &(*certificates)[0] - } - update.Certificates = certificates - } - - _, resp, err := idpAPI.PutIdentityprovidersPing(update) - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_idp_ping", fmt.Sprintf("Failed to update IDP Ping %s error: %s", d.Id(), err), resp) - } - - log.Printf("Updated IDP Ping") - return readIdpPing(ctx, d, meta) -} - -func deleteIdpPing(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - idpAPI := platformclientv2.NewIdentityProviderApiWithConfig(sdkConfig) - - log.Printf("Deleting IDP Ping") - _, resp, err := idpAPI.DeleteIdentityprovidersPing() - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_idp_ping", fmt.Sprintf("Failed to delete IDP Ping %s error: %s", d.Id(), err), resp) - } - - return util.WithRetries(ctx, 60*time.Second, func() *retry.RetryError { - _, resp, err := idpAPI.GetIdentityprovidersPing() - if err != nil { - if util.IsStatus404(resp) { - // IDP Ping deleted - log.Printf("Deleted IDP Ping") - return nil - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_ping", fmt.Sprintf("Error deleting IDP Ping: %s", err), resp)) - } - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_idp_ping", fmt.Sprintf("IDP Ping still exists"), resp)) - }) -} diff --git a/genesyscloud/resource_genesyscloud_init.go b/genesyscloud/resource_genesyscloud_init.go index d526a8439..d2a1a248f 100644 --- a/genesyscloud/resource_genesyscloud_init.go +++ b/genesyscloud/resource_genesyscloud_init.go @@ -42,10 +42,6 @@ func registerResources(l registrar.Registrar) { l.RegisterResource("genesyscloud_location", ResourceLocation()) l.RegisterResource("genesyscloud_auth_division", ResourceAuthDivision()) - l.RegisterResource("genesyscloud_idp_generic", ResourceIdpGeneric()) - l.RegisterResource("genesyscloud_idp_gsuite", ResourceIdpGsuite()) - l.RegisterResource("genesyscloud_idp_onelogin", ResourceIdpOnelogin()) - l.RegisterResource("genesyscloud_idp_ping", ResourceIdpPing()) l.RegisterResource("genesyscloud_journey_action_map", ResourceJourneyActionMap()) l.RegisterResource("genesyscloud_journey_action_template", ResourceJourneyActionTemplate()) l.RegisterResource("genesyscloud_journey_outcome", ResourceJourneyOutcome()) @@ -72,10 +68,6 @@ func registerResources(l registrar.Registrar) { func registerExporters(l registrar.Registrar) { l.RegisterExporter("genesyscloud_auth_division", AuthDivisionExporter()) - l.RegisterExporter("genesyscloud_idp_generic", IdpGenericExporter()) - l.RegisterExporter("genesyscloud_idp_gsuite", IdpGsuiteExporter()) - l.RegisterExporter("genesyscloud_idp_onelogin", IdpOneloginExporter()) - l.RegisterExporter("genesyscloud_idp_ping", IdpPingExporter()) l.RegisterExporter("genesyscloud_journey_action_map", JourneyActionMapExporter()) l.RegisterExporter("genesyscloud_journey_action_template", JourneyActionTemplateExporter()) l.RegisterExporter("genesyscloud_journey_outcome", JourneyOutcomeExporter()) diff --git a/genesyscloud/resource_genesyscloud_init_test.go b/genesyscloud/resource_genesyscloud_init_test.go index 79c141fed..c1d69a24d 100644 --- a/genesyscloud/resource_genesyscloud_init_test.go +++ b/genesyscloud/resource_genesyscloud_init_test.go @@ -15,7 +15,7 @@ import ( "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( @@ -41,10 +41,6 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_routing_queue"] = routingQueue.ResourceRoutingQueue() providerResources["genesyscloud_location"] = ResourceLocation() providerResources["genesyscloud_auth_division"] = ResourceAuthDivision() - providerResources["genesyscloud_idp_generic"] = ResourceIdpGeneric() - providerResources["genesyscloud_idp_gsuite"] = ResourceIdpGsuite() - providerResources["genesyscloud_idp_onelogin"] = ResourceIdpOnelogin() - providerResources["genesyscloud_idp_ping"] = ResourceIdpPing() providerResources["genesyscloud_journey_action_map"] = ResourceJourneyActionMap() providerResources["genesyscloud_journey_action_template"] = ResourceJourneyActionTemplate() providerResources["genesyscloud_journey_outcome"] = ResourceJourneyOutcome() diff --git a/genesyscloud/resource_genesyscloud_journey_action_map.go b/genesyscloud/resource_genesyscloud_journey_action_map.go index 7e1c583f0..2b9100ec4 100644 --- a/genesyscloud/resource_genesyscloud_journey_action_map.go +++ b/genesyscloud/resource_genesyscloud_journey_action_map.go @@ -25,7 +25,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( @@ -134,15 +134,16 @@ var ( ValidateFunc: validation.StringInSlice([]string{"containsAll", "containsAny", "notContainsAll", "notContainsAny", "equal", "notEqual", "greaterThan", "greaterThanOrEqual", "lessThan", "lessThanOrEqual", "startsWith", "endsWith"}, false), }, "stream_type": { - Description: "The stream type for which this condition can be satisfied. Valid values: Web, Custom, Conversation.", + Description: "The stream type for which this condition can be satisfied. Valid values: Web, App.", Type: schema.TypeString, Required: true, - ValidateFunc: validation.StringInSlice([]string{"Web", "Custom", "Conversation"}, false), + ValidateFunc: validation.StringInSlice([]string{"Web", "App" /*,"Custom", "Conversation" */}, false), // Custom and Conversation seem not to be supported by the API despite the documentation (DEVENGSD-607) }, "session_type": { - Description: "The session type for which this condition can be satisfied.", + Description: "The session type for which this condition can be satisfied. Valid values: web, app.", Type: schema.TypeString, Required: true, + ValidateFunc: validation.StringInSlice([]string{"web", "app"}, false), // custom value seems not to be supported by the API despite the documentation }, "event_name": { Description: "The name of the event for which this condition can be satisfied.", diff --git a/genesyscloud/resource_genesyscloud_journey_action_map_test.go b/genesyscloud/resource_genesyscloud_journey_action_map_test.go index 22fa108ea..69f62eaa6 100644 --- a/genesyscloud/resource_genesyscloud_journey_action_map_test.go +++ b/genesyscloud/resource_genesyscloud_journey_action_map_test.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) const resourceName = "genesyscloud_journey_action_map" diff --git a/genesyscloud/resource_genesyscloud_journey_action_template.go b/genesyscloud/resource_genesyscloud_journey_action_template.go index ecd418113..c7b55a10f 100644 --- a/genesyscloud/resource_genesyscloud_journey_action_template.go +++ b/genesyscloud/resource_genesyscloud_journey_action_template.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_journey_action_template_test.go b/genesyscloud/resource_genesyscloud_journey_action_template_test.go index dd0cc9444..4fe521163 100644 --- a/genesyscloud/resource_genesyscloud_journey_action_template_test.go +++ b/genesyscloud/resource_genesyscloud_journey_action_template_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) const ActionTemplateResourceName = "genesyscloud_journey_action_template" diff --git a/genesyscloud/resource_genesyscloud_journey_outcome.go b/genesyscloud/resource_genesyscloud_journey_outcome.go index 40a1019ff..4e8ffe106 100644 --- a/genesyscloud/resource_genesyscloud_journey_outcome.go +++ b/genesyscloud/resource_genesyscloud_journey_outcome.go @@ -22,7 +22,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_journey_outcome_test.go b/genesyscloud/resource_genesyscloud_journey_outcome_test.go index 5f52a59bd..f89e638ce 100644 --- a/genesyscloud/resource_genesyscloud_journey_outcome_test.go +++ b/genesyscloud/resource_genesyscloud_journey_outcome_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceJourneyOutcome(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_journey_segment.go b/genesyscloud/resource_genesyscloud_journey_segment.go index 453d1191e..e4735692e 100644 --- a/genesyscloud/resource_genesyscloud_journey_segment.go +++ b/genesyscloud/resource_genesyscloud_journey_segment.go @@ -22,7 +22,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( @@ -162,16 +162,16 @@ var ( Required: true, }, "stream_type": { - Description: "The stream type for which this pattern can be matched on.Valid values: Web, Custom, Conversation.", + Description: "The stream type for which this pattern can be matched on. Valid values: Web, App.", Type: schema.TypeString, Required: true, - ValidateFunc: validation.StringInSlice([]string{"Web" /*, "Custom", "Conversation"*/}, false), // Custom and Conversation seem not to be supported by the API despite the documentation + ValidateFunc: validation.StringInSlice([]string{"Web", "App" /*, "Custom", "Conversation"*/}, false), // Custom and Conversation seem not to be supported by the API despite the documentation (DEVENGSD-607) }, "session_type": { - Description: "The session type for which this pattern can be matched on.", + Description: "The session type for which this pattern can be matched on. Valid values: web, app.", Type: schema.TypeString, Required: true, - ValidateFunc: validation.StringInSlice([]string{"web"}, false), // custom value seems not to be supported by the API despite the documentation + ValidateFunc: validation.StringInSlice([]string{"web", "app"}, false), // custom value seems not to be supported by the API despite the documentation }, "event_name": { Description: "The name of the event for which this pattern can be matched on.", diff --git a/genesyscloud/resource_genesyscloud_journey_segment_test.go b/genesyscloud/resource_genesyscloud_journey_segment_test.go index 7e0946b52..36dce3d5d 100644 --- a/genesyscloud/resource_genesyscloud_journey_segment_test.go +++ b/genesyscloud/resource_genesyscloud_journey_segment_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceJourneySegment(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_category.go b/genesyscloud/resource_genesyscloud_knowledge_category.go index dc097759d..6bdd76f52 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_category.go +++ b/genesyscloud/resource_genesyscloud_knowledge_category.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_knowledge_category_test.go b/genesyscloud/resource_genesyscloud_knowledge_category_test.go index 06ca7764f..795c60613 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_category_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_category_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceKnowledgeCategoryBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_document.go b/genesyscloud/resource_genesyscloud_knowledge_document.go index 7c91e51bf..c70f722ae 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_document.go +++ b/genesyscloud/resource_genesyscloud_knowledge_document.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_knowledge_document_test.go b/genesyscloud/resource_genesyscloud_knowledge_document_test.go index 0e47251ac..37a7b7e65 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_document_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_document_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceKnowledgeDocumentBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_document_variation.go b/genesyscloud/resource_genesyscloud_knowledge_document_variation.go index b0ed284f2..0a6906123 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_document_variation.go +++ b/genesyscloud/resource_genesyscloud_knowledge_document_variation.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_knowledge_document_variation_test.go b/genesyscloud/resource_genesyscloud_knowledge_document_variation_test.go index 72e6fbfc4..a61504e32 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_document_variation_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_document_variation_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceKnowledgeDocumentVariationBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_knowledgebase.go b/genesyscloud/resource_genesyscloud_knowledge_knowledgebase.go index 4e824d71e..ebf318da6 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_knowledgebase.go +++ b/genesyscloud/resource_genesyscloud_knowledge_knowledgebase.go @@ -9,6 +9,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/constants" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + "terraform-provider-genesyscloud/genesyscloud/validators" "time" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" @@ -17,8 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllKnowledgeKnowledgebases(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { @@ -112,10 +112,10 @@ func ResourceKnowledgeKnowledgebase() *schema.Resource { Optional: true, }, "core_language": { - Description: "Core language for knowledge base in which initial content must be created, language codes [en-US, en-UK, en-AU, de-DE] are supported currently, however the new DX knowledge will support all these language codes", - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{"en-US", "en-UK", "en-AU", "de-DE", "es-US", "es-ES", "fr-FR", "pt-BR", "nl-NL", "it-IT", "fr-CA"}, false), + Description: "Core language for knowledge base in which initial content must be created, language codes [en-US, en-UK, en-AU, de-DE] are supported currently, however the new DX knowledge will support all these language codes", + Type: schema.TypeString, + Required: true, + ValidateDiagFunc: validators.ValidateLanguageCode, }, "published": { Description: "Flag that indicates the knowledge base is published", diff --git a/genesyscloud/resource_genesyscloud_knowledge_knowledgebase_test.go b/genesyscloud/resource_genesyscloud_knowledge_knowledgebase_test.go index 798715ee1..460b02cd8 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_knowledgebase_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_knowledgebase_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceKnowledgeKnowledgebaseBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_label.go b/genesyscloud/resource_genesyscloud_knowledge_label.go index 9b622e0ae..0e62c1ed5 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_label.go +++ b/genesyscloud/resource_genesyscloud_knowledge_label.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_knowledge_label_test.go b/genesyscloud/resource_genesyscloud_knowledge_label_test.go index 146fa7f36..c9fa514c7 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_label_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_label_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceKnowledgeLabelBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_v1_category.go b/genesyscloud/resource_genesyscloud_knowledge_v1_category.go index b5af3291e..ebe0aad6e 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_v1_category.go +++ b/genesyscloud/resource_genesyscloud_knowledge_v1_category.go @@ -8,6 +8,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/constants" + "terraform-provider-genesyscloud/genesyscloud/validators" "time" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" @@ -18,8 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( @@ -144,10 +144,10 @@ func ResourceKnowledgeCategoryV1() *schema.Resource { Required: true, }, "language_code": { - Description: "language code of the category", - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{"en-US", "en-UK", "en-AU", "de-DE", "es-US", "es-ES", "fr-FR", "pt-BR", "nl-NL", "it-IT", "fr-CA"}, false), + Description: "language code of the category", + Type: schema.TypeString, + Required: true, + ValidateDiagFunc: validators.ValidateLanguageCode, }, "knowledge_category": { Description: "Knowledge category parent id", diff --git a/genesyscloud/resource_genesyscloud_knowledge_v1_category_test.go b/genesyscloud/resource_genesyscloud_knowledge_v1_category_test.go index 578c23b26..ccd7370f4 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_v1_category_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_v1_category_test.go @@ -8,7 +8,7 @@ package genesyscloud // "github.com/google/uuid" // "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" // "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" -// "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" +// "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" // ) // func TestAccResourceKnowledgeV1CategoryBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_knowledge_v1_document.go b/genesyscloud/resource_genesyscloud_knowledge_v1_document.go index a87a90384..44ac81ff3 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_v1_document.go +++ b/genesyscloud/resource_genesyscloud_knowledge_v1_document.go @@ -8,6 +8,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/constants" + "terraform-provider-genesyscloud/genesyscloud/validators" "time" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" @@ -22,7 +23,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( @@ -208,10 +209,10 @@ func ResourceKnowledgeDocumentV1() *schema.Resource { Required: true, }, "language_code": { - Description: "Language code", - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{"en-US", "en-UK", "en-AU", "de-DE", "es-US", "es-ES", "fr-FR", "pt-BR", "nl-NL", "it-IT", "fr-CA"}, false), + Description: "Language code", + Type: schema.TypeString, + Required: true, + ValidateDiagFunc: validators.ValidateLanguageCode, }, "knowledge_document": { Description: "Knowledge document request body", diff --git a/genesyscloud/resource_genesyscloud_knowledge_v1_document_test.go b/genesyscloud/resource_genesyscloud_knowledge_v1_document_test.go index b9ef197c6..33a0bc435 100644 --- a/genesyscloud/resource_genesyscloud_knowledge_v1_document_test.go +++ b/genesyscloud/resource_genesyscloud_knowledge_v1_document_test.go @@ -8,7 +8,7 @@ package genesyscloud // "github.com/google/uuid" // "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" // "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" -// "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" +// "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" // ) // func TestAccResourceKnowledgeV1DocumentBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_location.go b/genesyscloud/resource_genesyscloud_location.go index eb2ac88e0..910a0521e 100644 --- a/genesyscloud/resource_genesyscloud_location.go +++ b/genesyscloud/resource_genesyscloud_location.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/nyaruka/phonenumbers" ) diff --git a/genesyscloud/resource_genesyscloud_location_test.go b/genesyscloud/resource_genesyscloud_location_test.go index b34a8c149..464de7e88 100644 --- a/genesyscloud/resource_genesyscloud_location_test.go +++ b/genesyscloud/resource_genesyscloud_location_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceLocationBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_quality_forms_evaluation.go b/genesyscloud/resource_genesyscloud_quality_forms_evaluation.go index b048bda93..46d25aaf5 100644 --- a/genesyscloud/resource_genesyscloud_quality_forms_evaluation.go +++ b/genesyscloud/resource_genesyscloud_quality_forms_evaluation.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/resource_genesyscloud_quality_forms_evaluation_test.go b/genesyscloud/resource_genesyscloud_quality_forms_evaluation_test.go index bceeeff41..bec7ffa7e 100644 --- a/genesyscloud/resource_genesyscloud_quality_forms_evaluation_test.go +++ b/genesyscloud/resource_genesyscloud_quality_forms_evaluation_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceEvaluationFormBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_quality_forms_survey.go b/genesyscloud/resource_genesyscloud_quality_forms_survey.go index a8941b378..9684600e1 100644 --- a/genesyscloud/resource_genesyscloud_quality_forms_survey.go +++ b/genesyscloud/resource_genesyscloud_quality_forms_survey.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type SurveyFormStruct struct { diff --git a/genesyscloud/resource_genesyscloud_quality_forms_survey_test.go b/genesyscloud/resource_genesyscloud_quality_forms_survey_test.go index cf763718c..f09b650fe 100644 --- a/genesyscloud/resource_genesyscloud_quality_forms_survey_test.go +++ b/genesyscloud/resource_genesyscloud_quality_forms_survey_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceSurveyFormBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_routing_email_domain.go b/genesyscloud/resource_genesyscloud_routing_email_domain.go index e17c91191..f49449257 100644 --- a/genesyscloud/resource_genesyscloud_routing_email_domain.go +++ b/genesyscloud/resource_genesyscloud_routing_email_domain.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllRoutingEmailDomains(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_routing_email_domain_test.go b/genesyscloud/resource_genesyscloud_routing_email_domain_test.go index 016f54c20..b01929e81 100644 --- a/genesyscloud/resource_genesyscloud_routing_email_domain_test.go +++ b/genesyscloud/resource_genesyscloud_routing_email_domain_test.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceRoutingEmailDomainSub(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_routing_language.go b/genesyscloud/resource_genesyscloud_routing_language.go index e30132331..9340ff2b7 100644 --- a/genesyscloud/resource_genesyscloud_routing_language.go +++ b/genesyscloud/resource_genesyscloud_routing_language.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllRoutingLanguages(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_routing_language_test.go b/genesyscloud/resource_genesyscloud_routing_language_test.go index a3f416a09..5d0349c8a 100644 --- a/genesyscloud/resource_genesyscloud_routing_language_test.go +++ b/genesyscloud/resource_genesyscloud_routing_language_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceRoutingLanguageBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_routing_skill.go b/genesyscloud/resource_genesyscloud_routing_skill.go index 91ccf0574..33093ab37 100644 --- a/genesyscloud/resource_genesyscloud_routing_skill.go +++ b/genesyscloud/resource_genesyscloud_routing_skill.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllRoutingSkills(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_routing_skill_group.go b/genesyscloud/resource_genesyscloud_routing_skill_group.go index 6508806de..5e47d30c1 100644 --- a/genesyscloud/resource_genesyscloud_routing_skill_group.go +++ b/genesyscloud/resource_genesyscloud_routing_skill_group.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type SkillGroupsRequest struct { diff --git a/genesyscloud/resource_genesyscloud_routing_skill_group_test.go b/genesyscloud/resource_genesyscloud_routing_skill_group_test.go index 311e08fc7..3fdf5e580 100644 --- a/genesyscloud/resource_genesyscloud_routing_skill_group_test.go +++ b/genesyscloud/resource_genesyscloud_routing_skill_group_test.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func testAccCheckSkillConditions(resourceName string, targetSkillConditionJson string) resource.TestCheckFunc { diff --git a/genesyscloud/resource_genesyscloud_routing_skill_test.go b/genesyscloud/resource_genesyscloud_routing_skill_test.go index 551c061a6..e847a18ff 100644 --- a/genesyscloud/resource_genesyscloud_routing_skill_test.go +++ b/genesyscloud/resource_genesyscloud_routing_skill_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceRoutingSkillBasic(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_routing_wrapupcode.go b/genesyscloud/resource_genesyscloud_routing_wrapupcode.go index 962e28073..210584bb5 100644 --- a/genesyscloud/resource_genesyscloud_routing_wrapupcode.go +++ b/genesyscloud/resource_genesyscloud_routing_wrapupcode.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllRoutingWrapupCodes(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/resource_genesyscloud_routing_wrapupcode_test.go b/genesyscloud/resource_genesyscloud_routing_wrapupcode_test.go index d4becc64d..6fc78d61d 100644 --- a/genesyscloud/resource_genesyscloud_routing_wrapupcode_test.go +++ b/genesyscloud/resource_genesyscloud_routing_wrapupcode_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceRoutingWrapupcode(t *testing.T) { diff --git a/genesyscloud/resource_genesyscloud_user.go b/genesyscloud/resource_genesyscloud_user.go index 79baca358..0276edaae 100644 --- a/genesyscloud/resource_genesyscloud_user.go +++ b/genesyscloud/resource_genesyscloud_user.go @@ -2,7 +2,6 @@ package genesyscloud import ( "context" - "encoding/json" "fmt" "log" "strings" @@ -24,16 +23,10 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/nyaruka/phonenumbers" ) -type AgentUtilizationWithLabels struct { - Utilization map[string]routingUtilization.MediaUtilization `json:"utilization"` - LabelUtilizations map[string]routingUtilization.LabelUtilization `json:"labelUtilizations"` - Level string `json:"level"` -} - var ( contactTypeEmail = "EMAIL" @@ -417,7 +410,7 @@ func ResourceUser() *schema.Resource { Elem: routingUtilization.UtilizationSettingsResource, }, "label_utilizations": { - Description: "Label utilization settings. If not set, default label settings will be applied. This is in PREVIEW and should not be used unless the feature is available to your organization.", + Description: "Label utilization settings. If not set, default label settings will be applied.", Type: schema.TypeList, Optional: true, Computed: true, @@ -531,7 +524,7 @@ func createUser(ctx context.Context, d *schema.ResourceData, meta interface{}) d return diagErr } - diagErr = updateUserRoutingUtilization(d, usersAPI, sdkConfig) + diagErr = updateUserRoutingUtilization(d, usersAPI) if diagErr != nil { return diagErr } @@ -602,7 +595,7 @@ func readUser(ctx context.Context, d *schema.ResourceData, meta interface{}) dia d.Set("certifications", flattenUserCertifications(currentUser.Certifications)) d.Set("employer_info", flattenUserEmployerInfo(currentUser.EmployerInfo)) - if diagErr := readUserRoutingUtilization(d, sdkConfig); diagErr != nil { + if diagErr := readUserRoutingUtilization(d, usersAPI); diagErr != nil { return retry.NonRetryableError(fmt.Errorf("%v", diagErr)) } @@ -677,7 +670,7 @@ func updateUser(ctx context.Context, d *schema.ResourceData, meta interface{}) d return diagErr } - diagErr = updateUserRoutingUtilization(d, usersAPI, sdkConfig) + diagErr = updateUserRoutingUtilization(d, usersAPI) if diagErr != nil { return diagErr } @@ -1044,30 +1037,21 @@ func flattenUserEmployerInfo(empInfo *platformclientv2.Employerinfo) []interface }} } -func readUserRoutingUtilization(d *schema.ResourceData, sdkConfig *platformclientv2.Configuration) diag.Diagnostics { +func readUserRoutingUtilization(d *schema.ResourceData, usersAPI *platformclientv2.UsersApi) diag.Diagnostics { log.Printf("Getting user utilization") - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - apiClient := &routingAPI.Configuration.APIClient - - path := fmt.Sprintf("%s/api/v2/routing/users/%s/utilization", routingAPI.Configuration.BasePath, d.Id()) - headerParams := BuildHeaderParams(routingAPI) - response, err := apiClient.CallAPI(path, "GET", nil, headerParams, nil, nil, "", nil) - - if err != nil { - if util.IsStatus404(response) { + agentUtilization, resp, getErr := usersAPI.GetRoutingUserUtilization(d.Id()) + if getErr != nil { + if util.IsStatus404(resp) { d.SetId("") // User doesn't exist return nil } - return util.BuildAPIDiagnosticError("genesyscloud_user", fmt.Sprintf("Failed to read routing utilization for user %s error: %s", d.Id(), err), response) + return diag.Errorf("Failed to read Routing Utilization for user %s: %s", d.Id(), getErr) } - agentUtilization := &AgentUtilizationWithLabels{} - json.Unmarshal(response.RawBody, &agentUtilization) - if agentUtilization == nil { d.Set("routing_utilization", nil) - } else if agentUtilization.Level == "Organization" { + } else if *agentUtilization.Level == "Organization" { // If the settings are org-wide, set to empty to indicate no settings on the user d.Set("routing_utilization", []interface{}{}) } else { @@ -1075,8 +1059,8 @@ func readUserRoutingUtilization(d *schema.ResourceData, sdkConfig *platformclien if agentUtilization.Utilization != nil { for sdkType, schemaType := range routingUtilization.UtilizationMediaTypes { - if mediaSettings, ok := agentUtilization.Utilization[sdkType]; ok { - allSettings[schemaType] = routingUtilization.FlattenUtilizationSetting(mediaSettings) + if mediaSettings, ok := (*agentUtilization.Utilization)[sdkType]; ok { + allSettings[schemaType] = routingUtilization.FlattenMediaUtilization(mediaSettings) } } } @@ -1088,7 +1072,7 @@ func readUserRoutingUtilization(d *schema.ResourceData, sdkConfig *platformclien originalLabelUtilizations := originalSettings["label_utilizations"].([]interface{}) // Only add to the state the configured labels, in the configured order, but not any extras, to help terraform with matching new and old state. - filteredLabelUtilizations := routingUtilization.FilterAndFlattenLabelUtilizations(agentUtilization.LabelUtilizations, originalLabelUtilizations) + filteredLabelUtilizations := routingUtilization.FilterAndFlattenLabelUtilizations(*agentUtilization.LabelUtilizations, originalLabelUtilizations) allSettings["label_utilizations"] = filteredLabelUtilizations } else { @@ -1277,10 +1261,9 @@ func updateUserProfileSkills(d *schema.ResourceData, usersAPI *platformclientv2. return nil } -func updateUserRoutingUtilization(d *schema.ResourceData, usersAPI *platformclientv2.UsersApi, sdkConfig *platformclientv2.Configuration) diag.Diagnostics { +func updateUserRoutingUtilization(d *schema.ResourceData, usersAPI *platformclientv2.UsersApi) diag.Diagnostics { if d.HasChange("routing_utilization") { if utilConfig := d.Get("routing_utilization").([]interface{}); utilConfig != nil { - var err error log.Printf("Updating user utilization for user %s", d.Id()) @@ -1289,30 +1272,18 @@ func updateUserRoutingUtilization(d *schema.ResourceData, usersAPI *platformclie allSettings := utilConfig[0].(map[string]interface{}) labelUtilizations := allSettings["label_utilizations"].([]interface{}) - if labelUtilizations != nil && len(labelUtilizations) > 0 { - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - apiClient := &routingAPI.Configuration.APIClient - - path := fmt.Sprintf("%s/api/v2/routing/users/%s/utilization", routingAPI.Configuration.BasePath, d.Id()) - headerParams := BuildHeaderParams(routingAPI) - requestPayload := make(map[string]interface{}) - requestPayload["utilization"] = buildMediaTypeUtilizations(allSettings) - - requestPayload["labelUtilizations"] = routingUtilization.BuildLabelUtilizationsRequest(labelUtilizations) - _, err = apiClient.CallAPI(path, "PUT", requestPayload, headerParams, nil, nil, "", nil) - } else { - sdkSettings := make(map[string]platformclientv2.Mediautilization) - for sdkType, schemaType := range routingUtilization.UtilizationMediaTypes { - if mediaSettings, ok := allSettings[schemaType]; ok && len(mediaSettings.([]interface{})) > 0 { - sdkSettings[sdkType] = routingUtilization.BuildSdkMediaUtilization(mediaSettings.([]interface{})) - } + sdkSettings := make(map[string]platformclientv2.Mediautilization) + for sdkType, schemaType := range routingUtilization.UtilizationMediaTypes { + if mediaSettings, ok := allSettings[schemaType]; ok && len(mediaSettings.([]interface{})) > 0 { + sdkSettings[sdkType] = routingUtilization.BuildSdkMediaUtilization(mediaSettings.([]interface{})) } - - _, _, err = usersAPI.PutRoutingUserUtilization(d.Id(), platformclientv2.Utilizationrequest{ - Utilization: &sdkSettings, - }) } + _, _, err := usersAPI.PutRoutingUserUtilization(d.Id(), platformclientv2.Utilizationrequest{ + Utilization: &sdkSettings, + LabelUtilizations: routingUtilization.BuildSdkLabelUtilizations(labelUtilizations), + }) + if err != nil { return util.BuildDiagnosticError("genesyscloud_user", fmt.Sprintf("Failed to update Routing Utilization for user %s", d.Id()), err) } diff --git a/genesyscloud/resource_genesyscloud_user_test.go b/genesyscloud/resource_genesyscloud_user_test.go index c064114ea..4dd536e5f 100644 --- a/genesyscloud/resource_genesyscloud_user_test.go +++ b/genesyscloud/resource_genesyscloud_user_test.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceUserBasic(t *testing.T) { @@ -709,7 +709,7 @@ func TestAccResourceUserEmployerInfo(t *testing.T) { }) } -func TestAccResourceUserroutingUtil(t *testing.T) { +func TestAccResourceUserroutingUtilBasic(t *testing.T) { t.Parallel() var ( userResource1 = "test-user-util" @@ -864,12 +864,7 @@ func TestAccResourceUserroutingUtilWithLabels(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { - util.TestAccPreCheck(t) - if err := routingUtilizationLabel.CheckIfLabelsAreEnabled(); err != nil { - t.Skipf("%v", err) // be sure to skip the test and not fail it - } - }, + PreCheck: func() { util.TestAccPreCheck(t) }, ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), Steps: []resource.TestStep{ { diff --git a/genesyscloud/resource_genesyscloud_widget_deployment.go b/genesyscloud/resource_genesyscloud_widget_deployment.go index 54ef064af..989d19d87 100644 --- a/genesyscloud/resource_genesyscloud_widget_deployment.go +++ b/genesyscloud/resource_genesyscloud_widget_deployment.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) const ( diff --git a/genesyscloud/resource_genesyscloud_widget_deployment_test.go b/genesyscloud/resource_genesyscloud_widget_deployment_test.go index 2f4b56c25..cc8519ce1 100644 --- a/genesyscloud/resource_genesyscloud_widget_deployment_test.go +++ b/genesyscloud/resource_genesyscloud_widget_deployment_test.go @@ -11,7 +11,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type widgetDeploymentConfig struct { diff --git a/genesyscloud/responsemanagement_library/genesyscloud_responsemanagement_library_proxy.go b/genesyscloud/responsemanagement_library/genesyscloud_responsemanagement_library_proxy.go index 9478205ec..644d5de5b 100644 --- a/genesyscloud/responsemanagement_library/genesyscloud_responsemanagement_library_proxy.go +++ b/genesyscloud/responsemanagement_library/genesyscloud_responsemanagement_library_proxy.go @@ -3,8 +3,9 @@ package responsemanagement_library import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library.go b/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library.go index 2970dd174..0d922993b 100644 --- a/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library.go +++ b/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library.go @@ -3,9 +3,6 @@ package responsemanagement_library import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" @@ -13,6 +10,10 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" "time" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" + "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" diff --git a/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library_test.go b/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library_test.go index 2724c81d1..6473a47d1 100644 --- a/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library_test.go +++ b/genesyscloud/responsemanagement_library/resource_genesyscloud_responsemanagement_library_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceResponseManagementLibrary(t *testing.T) { diff --git a/genesyscloud/responsemanagement_response/genesyscloud_responsemanagement_response_proxy.go b/genesyscloud/responsemanagement_response/genesyscloud_responsemanagement_response_proxy.go index 70921cbd8..15aa5c24e 100644 --- a/genesyscloud/responsemanagement_response/genesyscloud_responsemanagement_response_proxy.go +++ b/genesyscloud/responsemanagement_response/genesyscloud_responsemanagement_response_proxy.go @@ -3,8 +3,9 @@ package responsemanagement_response import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response.go b/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response.go index 5e7dec46c..2de69e6cb 100644 --- a/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response.go +++ b/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response.go @@ -3,10 +3,6 @@ package responsemanagement_response import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -15,6 +11,11 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_test.go b/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_test.go index c9dbca7a6..1a12a384a 100644 --- a/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_test.go +++ b/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_test.go @@ -16,7 +16,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceResponseManagementResponseFooterField(t *testing.T) { diff --git a/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_utils.go b/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_utils.go index f2dd8555f..45d6bb6f3 100644 --- a/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_utils.go +++ b/genesyscloud/responsemanagement_response/resource_genesyscloud_responsemanagement_response_utils.go @@ -1,11 +1,12 @@ package responsemanagement_response import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/lists" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getResponseFromResourceData(d *schema.ResourceData) platformclientv2.Response { diff --git a/genesyscloud/responsemanagement_responseasset/genesyscloud_responsemanagement_responseasset_proxy.go b/genesyscloud/responsemanagement_responseasset/genesyscloud_responsemanagement_responseasset_proxy.go index fe64370e1..8495f4910 100644 --- a/genesyscloud/responsemanagement_responseasset/genesyscloud_responsemanagement_responseasset_proxy.go +++ b/genesyscloud/responsemanagement_responseasset/genesyscloud_responsemanagement_responseasset_proxy.go @@ -6,7 +6,7 @@ import ( "log" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset.go b/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset.go index 94a4a0c2e..b0e7d9470 100644 --- a/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset.go +++ b/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset.go @@ -3,10 +3,6 @@ package responsemanagement_responseasset import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -15,6 +11,11 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" "terraform-provider-genesyscloud/genesyscloud/util/files" "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset_test.go b/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset_test.go index 7cb665c73..8d222e26e 100644 --- a/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset_test.go +++ b/genesyscloud/responsemanagement_responseasset/resource_genesyscloud_responsemanagement_responseasset_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceResponseManagementResponseAsset(t *testing.T) { diff --git a/genesyscloud/routing_email_route/genesyscloud_routing_email_route_proxy.go b/genesyscloud/routing_email_route/genesyscloud_routing_email_route_proxy.go index 6c8df29b3..ac6ac1328 100644 --- a/genesyscloud/routing_email_route/genesyscloud_routing_email_route_proxy.go +++ b/genesyscloud/routing_email_route/genesyscloud_routing_email_route_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route.go b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route.go index 8bdffc449..d2910fa3e 100644 --- a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route.go +++ b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go index 4cec51ca3..075bd7b7c 100644 --- a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go +++ b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceRoutingEmailRoute(t *testing.T) { diff --git a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_utils.go b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_utils.go index c47783f4b..7c5b58343 100644 --- a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_utils.go +++ b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_utils.go @@ -8,7 +8,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/routing_queue/data_source_genesyscloud_routing_queue.go b/genesyscloud/routing_queue/data_source_genesyscloud_routing_queue.go index cd47befaa..08fa4fb5b 100644 --- a/genesyscloud/routing_queue/data_source_genesyscloud_routing_queue.go +++ b/genesyscloud/routing_queue/data_source_genesyscloud_routing_queue.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/routing_queue/genesyscloud_routing_queue_proxy.go b/genesyscloud/routing_queue/genesyscloud_routing_queue_proxy.go index 3a06aa969..2d27a41d0 100644 --- a/genesyscloud/routing_queue/genesyscloud_routing_queue_proxy.go +++ b/genesyscloud/routing_queue/genesyscloud_routing_queue_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue.go b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue.go index 46ae0cba6..4ee275d58 100644 --- a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue.go +++ b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue.go @@ -25,7 +25,7 @@ import ( "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var bullseyeExpansionTypeTimeout = "TIMEOUT_SECONDS" diff --git a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go index 20252e1db..c1a359274 100644 --- a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go +++ b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go @@ -20,7 +20,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/routing_queue_conditional_group_routing/genesyscloud_routing_queue_conditional_group_routing_proxy.go b/genesyscloud/routing_queue_conditional_group_routing/genesyscloud_routing_queue_conditional_group_routing_proxy.go index 8072bfcc7..c30bd06f0 100644 --- a/genesyscloud/routing_queue_conditional_group_routing/genesyscloud_routing_queue_conditional_group_routing_proxy.go +++ b/genesyscloud/routing_queue_conditional_group_routing/genesyscloud_routing_queue_conditional_group_routing_proxy.go @@ -3,9 +3,10 @@ package routing_queue_conditional_group_routing import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // internalProxy holds a proxy instance that can be used throughout the package diff --git a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing.go b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing.go index a0d3b94a3..3877f16fd 100644 --- a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing.go +++ b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing.go @@ -3,10 +3,6 @@ package routing_queue_conditional_group_routing import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "strings" consistencyChecker "terraform-provider-genesyscloud/genesyscloud/consistency_checker" @@ -16,6 +12,11 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" featureToggles "terraform-provider-genesyscloud/genesyscloud/util/feature_toggles" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_test.go b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_test.go index dadf085c8..e910fb72c 100644 --- a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_test.go +++ b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_test.go @@ -18,7 +18,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_unit_test.go b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_unit_test.go index 16b682245..fc4f84f7f 100644 --- a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_unit_test.go +++ b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_unit_test.go @@ -2,14 +2,15 @@ package routing_queue_conditional_group_routing import ( "context" + "net/http" + "terraform-provider-genesyscloud/genesyscloud/provider" + "testing" + "github.com/google/go-cmp/cmp" "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/stretchr/testify/assert" - "net/http" - "terraform-provider-genesyscloud/genesyscloud/provider" - "testing" ) func TestUnitResourceRoutingQueueConditionalGroupRoutingUpdate(t *testing.T) { diff --git a/genesyscloud/routing_queue_outbound_email_address/genesyscloud_routing_queue_outbound_email_address_proxy.go b/genesyscloud/routing_queue_outbound_email_address/genesyscloud_routing_queue_outbound_email_address_proxy.go index e12da7114..b79e9f767 100644 --- a/genesyscloud/routing_queue_outbound_email_address/genesyscloud_routing_queue_outbound_email_address_proxy.go +++ b/genesyscloud/routing_queue_outbound_email_address/genesyscloud_routing_queue_outbound_email_address_proxy.go @@ -3,9 +3,10 @@ package routing_queue_outbound_email_address import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // internalProxy holds a proxy instance that can be used throughout the package diff --git a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address.go b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address.go index e94fdaee1..e9f412963 100644 --- a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address.go +++ b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address.go @@ -3,10 +3,6 @@ package routing_queue_outbound_email_address import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "strings" consistencyChecker "terraform-provider-genesyscloud/genesyscloud/consistency_checker" @@ -16,6 +12,11 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" featureToggles "terraform-provider-genesyscloud/genesyscloud/util/feature_toggles" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* @@ -37,7 +38,7 @@ func getAllAuthRoutingQueueOutboundEmailAddress(ctx context.Context, clientConfi } for _, queue := range *queues { - if queue.OutboundEmailAddress != nil && *queue.OutboundEmailAddress != nil { + if queue.OutboundEmailAddress != nil && !isQueueEmailAddressEmpty(*queue.OutboundEmailAddress) { resources[*queue.Id] = &resourceExporter.ResourceMeta{Name: *queue.Name + "-email-address"} } } diff --git a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_schema.go b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_schema.go index f78e264c3..3a1c71f69 100644 --- a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_schema.go +++ b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_schema.go @@ -1,10 +1,11 @@ package routing_queue_outbound_email_address import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) const resourceName = "genesyscloud_routing_queue_outbound_email_address" diff --git a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_test.go b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_test.go index cfac071ce..534bd35bf 100644 --- a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_test.go +++ b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_test.go @@ -2,10 +2,6 @@ package routing_queue_outbound_email_address import ( "fmt" - "github.com/google/uuid" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "os" "strings" @@ -17,6 +13,11 @@ import ( featureToggles "terraform-provider-genesyscloud/genesyscloud/util/feature_toggles" "testing" "time" + + "github.com/google/uuid" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceRoutingQueueOutboundEmailAddress(t *testing.T) { diff --git a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_unit_test.go b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_unit_test.go index 6ef38582c..00f239f42 100644 --- a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_unit_test.go +++ b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_unit_test.go @@ -2,13 +2,14 @@ package routing_queue_outbound_email_address import ( "context" - "github.com/google/uuid" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" - "github.com/stretchr/testify/assert" "net/http" "terraform-provider-genesyscloud/genesyscloud/provider" "testing" + + "github.com/google/uuid" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" + "github.com/stretchr/testify/assert" ) func TestUnitResourceRoutingQueueOutboundEmailAddressUpdate(t *testing.T) { diff --git a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_utils.go b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_utils.go new file mode 100644 index 000000000..e6c7a51e2 --- /dev/null +++ b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_utils.go @@ -0,0 +1,25 @@ +package routing_queue_outbound_email_address + +import "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" + +func isQueueEmailAddressEmpty(qea *platformclientv2.Queueemailaddress) bool { + if qea == nil { + return true + } + + // Compare relevant fields of the struct + if qea.Domain == nil || qea.Domain.Id == nil || *qea.Domain.Id == "" { + return true + } + + if qea.Route != nil && *qea.Route != nil { + routeId := (*qea.Route).Id + if routeId == nil || *routeId == "" { + return true + } + } else { + return true + } + + return false +} diff --git a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_utils_unit_test.go b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_utils_unit_test.go new file mode 100644 index 000000000..bf9230f0c --- /dev/null +++ b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_utils_unit_test.go @@ -0,0 +1,30 @@ +package routing_queue_outbound_email_address + +import ( + "testing" + + "github.com/google/uuid" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" + "github.com/stretchr/testify/assert" +) + +func TestUnitResourceRoutingQueueOutboundEmailAddressEmpty(t *testing.T) { + address := platformclientv2.Queueemailaddress{} + result := isQueueEmailAddressEmpty(&address) + assert.Equal(t, true, result) +} + +func TestUnitResourceRoutingQueueOutboundEmailAddressNotEmpty(t *testing.T) { + tDomainId := uuid.NewString() + tRouteId := uuid.NewString() + + route := &platformclientv2.Inboundroute{ + Id: &tRouteId, + } + address := platformclientv2.Queueemailaddress{ + Domain: &platformclientv2.Domainentityref{Id: &tDomainId}, + Route: &route, + } + result := isQueueEmailAddressEmpty(&address) + assert.Equal(t, false, result) +} diff --git a/genesyscloud/routing_settings/genesyscloud_routing_settings_proxy.go b/genesyscloud/routing_settings/genesyscloud_routing_settings_proxy.go index 111dcf6f1..00fc3df53 100644 --- a/genesyscloud/routing_settings/genesyscloud_routing_settings_proxy.go +++ b/genesyscloud/routing_settings/genesyscloud_routing_settings_proxy.go @@ -2,7 +2,8 @@ package routing_settings import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *routingSettingsProxy diff --git a/genesyscloud/routing_settings/resource_genesyscloud_routing_settings.go b/genesyscloud/routing_settings/resource_genesyscloud_routing_settings.go index 3f4a4f2e8..24faf3c06 100644 --- a/genesyscloud/routing_settings/resource_genesyscloud_routing_settings.go +++ b/genesyscloud/routing_settings/resource_genesyscloud_routing_settings.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllRoutingSettings(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/routing_sms_addresses/genesyscloud_routing_sms_addresses_proxy.go b/genesyscloud/routing_sms_addresses/genesyscloud_routing_sms_addresses_proxy.go index 4da161286..85212774a 100644 --- a/genesyscloud/routing_sms_addresses/genesyscloud_routing_sms_addresses_proxy.go +++ b/genesyscloud/routing_sms_addresses/genesyscloud_routing_sms_addresses_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // Type definitions for each func on our proxy so we can easily mock them out later diff --git a/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses.go b/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses.go index d578d8b0c..1da47bc0d 100644 --- a/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses.go +++ b/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) const resourceName = "genesyscloud_routing_sms_address" diff --git a/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses_test.go b/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses_test.go index 4d4185ee8..5ea01bb2c 100644 --- a/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses_test.go +++ b/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceRoutingSmsAddressesProdOrg(t *testing.T) { diff --git a/genesyscloud/routing_utilization/genesyscloud_routing_utilization_proxy.go b/genesyscloud/routing_utilization/genesyscloud_routing_utilization_proxy.go index 776d9664a..401e954ef 100644 --- a/genesyscloud/routing_utilization/genesyscloud_routing_utilization_proxy.go +++ b/genesyscloud/routing_utilization/genesyscloud_routing_utilization_proxy.go @@ -2,27 +2,22 @@ package routing_utilization import ( "context" - "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *routingUtilizationProxy -type getRoutingUtilizationFunc func(ctx context.Context, p *routingUtilizationProxy) (*platformclientv2.APIResponse, error) +type getRoutingUtilizationFunc func(ctx context.Context, p *routingUtilizationProxy) (*platformclientv2.Utilizationresponse, *platformclientv2.APIResponse, error) type updateRoutingUtilizationFunc func(ctx context.Context, p *routingUtilizationProxy, request *platformclientv2.Utilizationrequest) (*platformclientv2.Utilizationresponse, *platformclientv2.APIResponse, error) type deleteRoutingUtilizationFunc func(ctx context.Context, p *routingUtilizationProxy) (*platformclientv2.APIResponse, error) -type updateDirectlyFunc func(ctx context.Context, p *routingUtilizationProxy, d *schema.ResourceData, utilizationRequest []interface{}) (*platformclientv2.APIResponse, error) - type routingUtilizationProxy struct { clientConfig *platformclientv2.Configuration routingApi *platformclientv2.RoutingApi getRoutingUtilizationAttr getRoutingUtilizationFunc updateRoutingUtilizationAttr updateRoutingUtilizationFunc deleteRoutingUtilizationAttr deleteRoutingUtilizationFunc - - updateDirectlyAttr updateDirectlyFunc } func newRoutingUtilizationProxy(clientConfig *platformclientv2.Configuration) *routingUtilizationProxy { @@ -33,8 +28,6 @@ func newRoutingUtilizationProxy(clientConfig *platformclientv2.Configuration) *r getRoutingUtilizationAttr: getRoutingUtilizationFn, updateRoutingUtilizationAttr: updateRoutingUtilizationFn, deleteRoutingUtilizationAttr: deleteRoutingUtilizationFn, - - updateDirectlyAttr: updateDirectlyFn, } } @@ -45,31 +38,20 @@ func getRoutingUtilizationProxy(clientConfig *platformclientv2.Configuration) *r return internalProxy } -func (p *routingUtilizationProxy) getRoutingUtilization(ctx context.Context) (*platformclientv2.APIResponse, error) { +func (p *routingUtilizationProxy) getRoutingUtilization(ctx context.Context) (*platformclientv2.Utilizationresponse, *platformclientv2.APIResponse, error) { return p.getRoutingUtilizationAttr(ctx, p) } + func (p *routingUtilizationProxy) updateRoutingUtilization(ctx context.Context, request *platformclientv2.Utilizationrequest) (*platformclientv2.Utilizationresponse, *platformclientv2.APIResponse, error) { return p.updateRoutingUtilizationAttr(ctx, p, request) } + func (p *routingUtilizationProxy) deleteRoutingUtilization(ctx context.Context) (*platformclientv2.APIResponse, error) { return p.deleteRoutingUtilizationAttr(ctx, p) } -func (p *routingUtilizationProxy) updateDirectly(ctx context.Context, d *schema.ResourceData, utilizationRequest []interface{}) (*platformclientv2.APIResponse, error) { - return p.updateDirectlyAttr(ctx, p, d, utilizationRequest) -} - -// Calling the Utilization API directly while the label feature is not available. -// Once it is, this code can go back to using platformclientv2's RoutingApi to make the call. -func getRoutingUtilizationFn(ctx context.Context, p *routingUtilizationProxy) (*platformclientv2.APIResponse, error) { - apiClient := &p.routingApi.Configuration.APIClient - path := fmt.Sprintf("%s/api/v2/routing/utilization", p.routingApi.Configuration.BasePath) - headerParams := buildHeaderParams(p.routingApi) - resp, err := apiClient.CallAPI(path, "GET", nil, headerParams, nil, nil, "", nil) - if err != nil { - return resp, fmt.Errorf("failed to get routing utilization %s ", err) - } - return resp, nil +func getRoutingUtilizationFn(ctx context.Context, p *routingUtilizationProxy) (*platformclientv2.Utilizationresponse, *platformclientv2.APIResponse, error) { + return p.routingApi.GetRoutingUtilization() } func updateRoutingUtilizationFn(ctx context.Context, p *routingUtilizationProxy, utilizationRequest *platformclientv2.Utilizationrequest) (*platformclientv2.Utilizationresponse, *platformclientv2.APIResponse, error) { @@ -79,21 +61,3 @@ func updateRoutingUtilizationFn(ctx context.Context, p *routingUtilizationProxy, func deleteRoutingUtilizationFn(ctx context.Context, p *routingUtilizationProxy) (*platformclientv2.APIResponse, error) { return p.routingApi.DeleteRoutingUtilization() } - -// If the resource has label(s), calls the Utilization API directly. -// This code can go back to using platformclientv2's RoutingApi to make the call once label utilization is available in platformclientv2's RoutingApi -func updateDirectlyFn(ctx context.Context, p *routingUtilizationProxy, d *schema.ResourceData, utilizationRequest []interface{}) (*platformclientv2.APIResponse, error) { - apiClient := &p.routingApi.Configuration.APIClient - - path := fmt.Sprintf("%s/api/v2/routing/utilization", p.routingApi.Configuration.BasePath) - headerParams := buildHeaderParams(p.routingApi) - requestPayload := make(map[string]interface{}) - requestPayload["utilization"] = buildSdkMediaUtilizations(d) - requestPayload["labelUtilizations"] = BuildLabelUtilizationsRequest(utilizationRequest) - - resp, err := apiClient.CallAPI(path, "PUT", requestPayload, headerParams, nil, nil, "", nil) - if err != nil { - return resp, fmt.Errorf("error updating directly %s", err) - } - return resp, nil -} diff --git a/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization.go b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization.go index 27acc28ba..5c3a56c49 100644 --- a/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization.go +++ b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization.go @@ -2,20 +2,21 @@ package routing_utilization import ( "context" - "encoding/json" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "log" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/constants" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "terraform-provider-genesyscloud/genesyscloud/consistency_checker" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" - resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllRoutingUtilization(_ context.Context, _ *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { @@ -32,17 +33,14 @@ func createRoutingUtilization(ctx context.Context, d *schema.ResourceData, meta } func readRoutingUtilization(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - // Calling the Utilization API directly while the label feature is not available. - // Once it is, this code can go back to using platformclientv2's RoutingApi to make the call. sdkConfig := meta.(*provider.ProviderMeta).ClientConfig proxy := getRoutingUtilizationProxy(sdkConfig) cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceRoutingUtilization(), constants.DefaultConsistencyChecks, resourceName) - orgUtilization := &OrgUtilizationWithLabels{} log.Printf("Reading Routing Utilization") return util.WithRetriesForRead(ctx, d, func() *retry.RetryError { - resp, err := proxy.getRoutingUtilization(ctx) + orgUtilization, resp, err := proxy.getRoutingUtilization(ctx) if err != nil { if util.IsStatus404(resp) { return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read Routing Utilization: %s", err), resp)) @@ -50,12 +48,10 @@ func readRoutingUtilization(ctx context.Context, d *schema.ResourceData, meta in return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read Routing Utilization: %s", err), resp)) } - err = json.Unmarshal(resp.RawBody, &orgUtilization) - if orgUtilization.Utilization != nil { for sdkType, schemaType := range UtilizationMediaTypes { - if mediaSettings, ok := orgUtilization.Utilization[sdkType]; ok { - _ = d.Set(schemaType, FlattenUtilizationSetting(mediaSettings)) + if mediaSettings, ok := (*orgUtilization.Utilization)[sdkType]; ok { + _ = d.Set(schemaType, FlattenMediaUtilization(mediaSettings)) } else { _ = d.Set(schemaType, nil) } @@ -64,8 +60,8 @@ func readRoutingUtilization(ctx context.Context, d *schema.ResourceData, meta in if orgUtilization.LabelUtilizations != nil { originalLabelUtilizations := d.Get("label_utilizations").([]interface{}) - // Only add to the state the configured labels, in the configured order, but not any extras, to help terraform with matching new and old state. - flattenedLabelUtilizations := FilterAndFlattenLabelUtilizations(orgUtilization.LabelUtilizations, originalLabelUtilizations) + // Only add the configured labels to the state, in the configured order, but not any extras, to help terraform with matching new and old state. + flattenedLabelUtilizations := FilterAndFlattenLabelUtilizations(*orgUtilization.LabelUtilizations, originalLabelUtilizations) _ = d.Set("label_utilizations", flattenedLabelUtilizations) } @@ -78,32 +74,21 @@ func updateRoutingUtilization(ctx context.Context, d *schema.ResourceData, meta sdkConfig := meta.(*provider.ProviderMeta).ClientConfig proxy := getRoutingUtilizationProxy(sdkConfig) - labelUtilizations := d.Get("label_utilizations").([]interface{}) - var resp *platformclientv2.APIResponse - var err error - log.Printf("Updating Routing Utilization") // Retrying on 409s because if a label is created immediately before the utilization update, it can lead to a conflict while the utilization is being updated to handle the new label. diagErr := util.RetryWhen(util.IsStatus409, func() (*platformclientv2.APIResponse, diag.Diagnostics) { - // If the resource has label(s), calls the Utilization API directly. - // This code can go back to using platformclientv2's RoutingApi to make the call once label utilization is available in platformclientv2's RoutingApi. - if labelUtilizations != nil && len(labelUtilizations) > 0 { - resp, err := proxy.updateDirectly(ctx, d, labelUtilizations) - if err != nil { - return resp, util.BuildAPIDiagnosticError(resourceName, "Failed to update routing utilization directly", resp) - } - } else { - _, resp, err = proxy.updateRoutingUtilization(ctx, &platformclientv2.Utilizationrequest{ - Utilization: buildSdkMediaUtilizations(d), - }) - } + _, resp, err := proxy.updateRoutingUtilization(ctx, &platformclientv2.Utilizationrequest{ + Utilization: BuildSdkMediaUtilizations(d), + LabelUtilizations: BuildSdkLabelUtilizations(d.Get("label_utilizations").([]interface{})), + }) if err != nil { return resp, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to update Routing Utilization %s error: %s", d.Id(), err), resp) } return resp, nil }) + if diagErr != nil { return diagErr } diff --git a/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_schema.go b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_schema.go index 0ebba6209..f956e6216 100644 --- a/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_schema.go +++ b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_schema.go @@ -2,13 +2,14 @@ package routing_utilization import ( "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "strings" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) const resourceName = "genesyscloud_routing_utilization" @@ -19,22 +20,6 @@ func SetRegistrar(regInstance registrar.Registrar) { regInstance.RegisterExporter(resourceName, RoutingUtilizationExporter()) } -type MediaUtilization struct { - MaximumCapacity int32 `json:"maximumCapacity"` - InterruptableMediaTypes []string `json:"interruptableMediaTypes"` - IncludeNonAcd bool `json:"includeNonAcd"` -} - -type LabelUtilization struct { - MaximumCapacity int32 `json:"maximumCapacity"` - InterruptingLabelIds []string `json:"interruptingLabelIds"` -} - -type OrgUtilizationWithLabels struct { - Utilization map[string]MediaUtilization `json:"utilization"` - LabelUtilizations map[string]LabelUtilization `json:"labelUtilizations"` -} - var ( // Map of SDK media type name to schema media type name UtilizationMediaTypes = map[string]string{ @@ -149,7 +134,7 @@ func ResourceRoutingUtilization() *schema.Resource { Elem: UtilizationSettingsResource, }, "label_utilizations": { - Description: "Label utilization settings. If not set, default label settings will be applied. This is in PREVIEW and should not be used unless the feature is available to your organization.", + Description: "Label utilization settings. If not set, default label settings will be applied.", Type: schema.TypeList, Optional: true, Computed: true, diff --git a/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_test.go b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_test.go index 0e5019ce6..c568a4018 100644 --- a/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_test.go +++ b/genesyscloud/routing_utilization/resource_genesyscloud_routing_utilization_test.go @@ -14,10 +14,10 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) -func TestAccResourceBasicRoutingUtilization(t *testing.T) { +func TestAccResourceRoutingUtilizationBasic(t *testing.T) { t.Parallel() var ( maxCapacity1 = "3" @@ -114,12 +114,7 @@ func TestAccResourceRoutingUtilizationWithLabels(t *testing.T) { } resource.Test(t, resource.TestCase{ - PreCheck: func() { - util.TestAccPreCheck(t) - if err := routingUtilizationLabel.CheckIfLabelsAreEnabled(); err != nil { - t.Skipf("%v", err) // be sure to skip the test and not fail it - } - }, + PreCheck: func() { util.TestAccPreCheck(t) }, ProviderFactories: provider.GetProviderFactories(providerResources, nil), Steps: []resource.TestStep{ { @@ -295,7 +290,7 @@ func CleanupRoutingUtilizationLabel() error { const pageSize = 100 labels, _, getErr := routingAPI.GetRoutingUtilizationLabels(pageSize, pageNum, "", "") if getErr != nil { - log.Printf("failed to get page %v of routing email domains: %v", pageNum, getErr) + log.Printf("failed to get page %v of utilization labels: %v", pageNum, getErr) return getErr } @@ -307,7 +302,7 @@ func CleanupRoutingUtilizationLabel() error { if label.Id != nil && strings.HasPrefix(*label.Name, "Terraform") { _, err := routingAPI.DeleteRoutingUtilizationLabel(*label.Id, true) if err != nil { - log.Printf("Failed to delete routing email domain %s: %s", *label.Id, err) + log.Printf("Failed to delete utilization label %s: %s", *label.Id, err) continue } time.Sleep(5 * time.Second) diff --git a/genesyscloud/routing_utilization/resource_routing_utilization_utils.go b/genesyscloud/routing_utilization/resource_routing_utilization_utils.go index 060d857b8..4bd91ef27 100644 --- a/genesyscloud/routing_utilization/resource_routing_utilization_utils.go +++ b/genesyscloud/routing_utilization/resource_routing_utilization_utils.go @@ -2,14 +2,15 @@ package routing_utilization import ( "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "sort" "strings" "terraform-provider-genesyscloud/genesyscloud/util/lists" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) -func buildSdkMediaUtilizations(d *schema.ResourceData) *map[string]platformclientv2.Mediautilization { +func BuildSdkMediaUtilizations(d *schema.ResourceData) *map[string]platformclientv2.Mediautilization { settings := make(map[string]platformclientv2.Mediautilization) for sdkType, schemaType := range UtilizationMediaTypes { @@ -41,33 +42,36 @@ func BuildSdkMediaUtilization(settings []interface{}) platformclientv2.Mediautil } } -func BuildLabelUtilizationsRequest(labelUtilizations []interface{}) map[string]LabelUtilization { - request := make(map[string]LabelUtilization) +func BuildSdkLabelUtilizations(labelUtilizations []interface{}) *map[string]platformclientv2.Labelutilizationrequest { + request := make(map[string]platformclientv2.Labelutilizationrequest) + for _, labelUtilization := range labelUtilizations { labelUtilizationMap := labelUtilization.(map[string]interface{}) + maxCapacity := labelUtilizationMap["maximum_capacity"].(int) interruptingLabelIds := lists.SetToStringList(labelUtilizationMap["interrupting_label_ids"].(*schema.Set)) - request[labelUtilizationMap["label_id"].(string)] = LabelUtilization{ - MaximumCapacity: int32(labelUtilizationMap["maximum_capacity"].(int)), - InterruptingLabelIds: *interruptingLabelIds, + request[labelUtilizationMap["label_id"].(string)] = platformclientv2.Labelutilizationrequest{ + MaximumCapacity: &maxCapacity, + InterruptingLabelIds: interruptingLabelIds, } } - return request + + return &request } -func FlattenUtilizationSetting(settings MediaUtilization) []interface{} { +func FlattenMediaUtilization(mediaUtilization platformclientv2.Mediautilization) []interface{} { settingsMap := make(map[string]interface{}) - settingsMap["maximum_capacity"] = settings.MaximumCapacity - settingsMap["include_non_acd"] = settings.IncludeNonAcd - if settings.InterruptableMediaTypes != nil { - settingsMap["interruptible_media_types"] = lists.StringListToSet(settings.InterruptableMediaTypes) + settingsMap["maximum_capacity"] = mediaUtilization.MaximumCapacity + settingsMap["include_non_acd"] = mediaUtilization.IncludeNonAcd + if mediaUtilization.InterruptableMediaTypes != nil { + settingsMap["interruptible_media_types"] = lists.StringListToSet(*mediaUtilization.InterruptableMediaTypes) } return []interface{}{settingsMap} } -func FilterAndFlattenLabelUtilizations(labelUtilizations map[string]LabelUtilization, originalLabelUtilizations []interface{}) []interface{} { +func FilterAndFlattenLabelUtilizations(labelUtilizations map[string]platformclientv2.Labelutilizationresponse, originalLabelUtilizations []interface{}) []interface{} { flattenedLabelUtilizations := make([]interface{}, 0) for _, originalLabelUtilization := range originalLabelUtilizations { @@ -85,13 +89,13 @@ func FilterAndFlattenLabelUtilizations(labelUtilizations map[string]LabelUtiliza return flattenedLabelUtilizations } -func flattenLabelUtilization(labelId string, labelUtilization LabelUtilization) map[string]interface{} { +func flattenLabelUtilization(labelId string, labelUtilization platformclientv2.Labelutilizationresponse) map[string]interface{} { utilizationMap := make(map[string]interface{}) utilizationMap["label_id"] = labelId utilizationMap["maximum_capacity"] = labelUtilization.MaximumCapacity if labelUtilization.InterruptingLabelIds != nil { - utilizationMap["interrupting_label_ids"] = lists.StringListToSet(labelUtilization.InterruptingLabelIds) + utilizationMap["interrupting_label_ids"] = lists.StringListToSet(*labelUtilization.InterruptingLabelIds) } return utilizationMap @@ -118,18 +122,3 @@ func getSdkUtilizationTypes() []string { sort.Strings(types) return types } - -// TODO: remove when routing skill group is refactored -func buildHeaderParams(routingAPI *platformclientv2.RoutingApi) map[string]string { - headerParams := make(map[string]string) - - for key := range routingAPI.Configuration.DefaultHeader { - headerParams[key] = routingAPI.Configuration.DefaultHeader[key] - } - - headerParams["Authorization"] = "Bearer " + routingAPI.Configuration.AccessToken - headerParams["Content-Type"] = "application/json" - headerParams["Accept"] = "application/json" - - return headerParams -} diff --git a/genesyscloud/routing_utilization_label/data_source_genesyscloud_routing_utilization_label_test.go b/genesyscloud/routing_utilization_label/data_source_genesyscloud_routing_utilization_label_test.go index d30634274..857060d3b 100644 --- a/genesyscloud/routing_utilization_label/data_source_genesyscloud_routing_utilization_label_test.go +++ b/genesyscloud/routing_utilization_label/data_source_genesyscloud_routing_utilization_label_test.go @@ -18,12 +18,7 @@ func TestAccDataSourceRoutingUtilizationLabel(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { - util.TestAccPreCheck(t) - if err := CheckIfLabelsAreEnabled(); err != nil { - t.Skipf("%v", err) // be sure to skip the test and not fail it - } - }, + PreCheck: func() { util.TestAccPreCheck(t) }, ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), Steps: []resource.TestStep{ { diff --git a/genesyscloud/routing_utilization_label/genesyscloud_routing_utilization_label_proxy.go b/genesyscloud/routing_utilization_label/genesyscloud_routing_utilization_label_proxy.go index fc19feb6c..ee8f5de3b 100644 --- a/genesyscloud/routing_utilization_label/genesyscloud_routing_utilization_label_proxy.go +++ b/genesyscloud/routing_utilization_label/genesyscloud_routing_utilization_label_proxy.go @@ -6,7 +6,7 @@ import ( "log" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *routingUtilizationLabelProxy @@ -127,7 +127,7 @@ func getRoutingUtilizationLabelByNameFn(ctx context.Context, p *routingUtilizati return nil, false, resp, fmt.Errorf("error retrieving routing utilization label by name %s", err) } - if labels == nil || len(*labels) == 0{ + if labels == nil || len(*labels) == 0 { return nil, true, resp, fmt.Errorf("no routing utilization labels found with name %s", name) } diff --git a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label.go b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label.go index c4ca7d422..755e6c358 100644 --- a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label.go +++ b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllRoutingUtilizationLabels(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_schema.go b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_schema.go index 92761f50a..39ad5e9e8 100644 --- a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_schema.go +++ b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_schema.go @@ -1,11 +1,14 @@ package routing_utilization_label import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "fmt" + "strings" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) const resourceName = "genesyscloud_routing_utilization_label" @@ -19,7 +22,7 @@ func SetRegistrar(regInstance registrar.Registrar) { func ResourceRoutingUtilizationLabel() *schema.Resource { return &schema.Resource{ - Description: "Genesys Cloud Routing Utilization Label. This resource is not yet widely available. Only use it if the feature is enabled.", + Description: "Genesys Cloud Routing Utilization Label.", CreateContext: provider.CreateWithPooledClient(createRoutingUtilizationLabel), ReadContext: provider.ReadWithPooledClient(readRoutingUtilizationLabel), @@ -33,7 +36,12 @@ func ResourceRoutingUtilizationLabel() *schema.Resource { "name": { Description: "Label name.", Type: schema.TypeString, - Required: true, + ValidateFunc: validation.All( + validation.StringIsNotEmpty, + stringDoesNotStartOrEndWithSpaces, + validation.StringDoesNotContainAny("*"), + ), + Required: true, }, }, } @@ -45,10 +53,14 @@ func DataSourceRoutingUtilizationLabel() *schema.Resource { ReadContext: provider.ReadWithPooledClient(dataSourceRoutingUtilizationLabelRead), Schema: map[string]*schema.Schema{ "name": { - Description: "Label name.", - Type: schema.TypeString, - ValidateFunc: validation.StringDoesNotContainAny("*"), - Required: true, + Description: "Label name.", + Type: schema.TypeString, + ValidateFunc: validation.All( + validation.StringIsNotEmpty, + stringDoesNotStartOrEndWithSpaces, + validation.StringDoesNotContainAny("*"), + ), + Required: true, }, }, } @@ -59,3 +71,16 @@ func RoutingUtilizationLabelExporter() *resourceExporter.ResourceExporter { GetResourcesFunc: provider.GetAllWithPooledClient(getAllRoutingUtilizationLabels), } } + +func stringDoesNotStartOrEndWithSpaces(input interface{}, k string) ([]string, []error) { + inputAsString, ok := input.(string) + if !ok { + return nil, []error{fmt.Errorf("expected type of %q to be string", k)} + } + + if len(strings.TrimSpace(inputAsString)) != len(inputAsString) { + return nil, []error{fmt.Errorf("expected %q to not start or end with spaces", k)} + } + + return nil, nil +} diff --git a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_test.go b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_test.go index 793fb3f3f..ca7b09718 100644 --- a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_test.go +++ b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_test.go @@ -2,6 +2,7 @@ package routing_utilization_label import ( "fmt" + "regexp" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "testing" @@ -9,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceRoutingUtilizationLabelBasic(t *testing.T) { @@ -20,12 +21,7 @@ func TestAccResourceRoutingUtilizationLabelBasic(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { - util.TestAccPreCheck(t) - if err := CheckIfLabelsAreEnabled(); err != nil { - t.Skipf("%v", err) // be sure to skip the test and not fail it - } - }, + PreCheck: func() { util.TestAccPreCheck(t) }, ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), Steps: []resource.TestStep{ { @@ -61,6 +57,36 @@ func TestAccResourceRoutingUtilizationLabelBasic(t *testing.T) { }) } +func TestAccResourceRoutingUtilizationLabelInvalidNames(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { util.TestAccPreCheck(t) }, + ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + Steps: []resource.TestStep{ + { + Config: GenerateRoutingUtilizationLabelResource("resource", " abc", ""), + ExpectError: regexp.MustCompile("to not start or end with spaces"), + }, + { + Config: GenerateRoutingUtilizationLabelResource("resource", "abc ", ""), + ExpectError: regexp.MustCompile("to not start or end with spaces"), + }, + { + Config: GenerateRoutingUtilizationLabelResource("resource", " abc ", ""), + ExpectError: regexp.MustCompile("to not start or end with spaces"), + }, + { + Config: GenerateRoutingUtilizationLabelResource("resource", "abc*", ""), + ExpectError: regexp.MustCompile("expected value of name to not contain any of"), + }, + { + Config: GenerateRoutingUtilizationLabelResource("resource", "", ""), + ExpectError: regexp.MustCompile("to not be an empty string"), + }, + }, + CheckDestroy: validateTestLabelDestroyed, + }) +} + func validateTestLabelDestroyed(state *terraform.State) error { routingApi := platformclientv2.NewRoutingApi() diff --git a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_utils.go b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_utils.go index 22322c59d..dcdae7656 100644 --- a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_utils.go +++ b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_utils.go @@ -2,9 +2,7 @@ package routing_utilization_label import ( "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "strings" - "terraform-provider-genesyscloud/genesyscloud/provider" ) func GenerateRoutingUtilizationLabelResource(resourceID string, name string, dependsOnResource string) string { @@ -21,20 +19,6 @@ func GenerateRoutingUtilizationLabelResource(resourceID string, name string, dep `, resourceID, name, dependsOn) } -func CheckIfLabelsAreEnabled() error { // remove once the feature is globally enabled - sdkConfig, err := provider.AuthorizeSdk() - if err != nil { - return err - } - - api := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - _, resp, _ := api.GetRoutingUtilizationLabels(100, 1, "", "") - if resp.StatusCode == 501 { - return fmt.Errorf("feature is not yet implemented in this org.") - } - return nil -} - func GenerateLabelUtilization( labelResource string, maxCapacity string, diff --git a/genesyscloud/scripts/genesyscloud_scripts_proxy.go b/genesyscloud/scripts/genesyscloud_scripts_proxy.go index 7f5a53860..03f44c83e 100644 --- a/genesyscloud/scripts/genesyscloud_scripts_proxy.go +++ b/genesyscloud/scripts/genesyscloud_scripts_proxy.go @@ -14,7 +14,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/files" "time" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/scripts/resource_genesyscloud_script.go b/genesyscloud/scripts/resource_genesyscloud_script.go index 53df15885..62d706f9c 100644 --- a/genesyscloud/scripts/resource_genesyscloud_script.go +++ b/genesyscloud/scripts/resource_genesyscloud_script.go @@ -12,7 +12,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/constants" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/genesyscloud/scripts/resource_genesyscloud_script_test.go b/genesyscloud/scripts/resource_genesyscloud_script_test.go index 23d3a7471..12c06e057 100644 --- a/genesyscloud/scripts/resource_genesyscloud_script_test.go +++ b/genesyscloud/scripts/resource_genesyscloud_script_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/station/data_source_genesyscloud_station_test.go b/genesyscloud/station/data_source_genesyscloud_station_test.go index 7ec255d4c..981c82bf6 100644 --- a/genesyscloud/station/data_source_genesyscloud_station_test.go +++ b/genesyscloud/station/data_source_genesyscloud_station_test.go @@ -62,7 +62,6 @@ func TestAccDataSourceStation(t *testing.T) { State: stateActive, SiteId: fmt.Sprintf("\"%s\"", defaultSiteId), PhoneBaseSettingsId: "genesyscloud_telephony_providers_edges_phonebasesettings." + phoneBaseSettingsRes + ".id", - LineAddresses: nil, // no line addresses WebRtcUserId: "genesyscloud_user." + userRes1 + ".id", DependsOn: "", // no depends on }, diff --git a/genesyscloud/station/genesyscloud_station_init_test.go b/genesyscloud/station/genesyscloud_station_init_test.go index 9641ffcb3..0eb7ec81f 100644 --- a/genesyscloud/station/genesyscloud_station_init_test.go +++ b/genesyscloud/station/genesyscloud_station_init_test.go @@ -6,7 +6,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" "testing" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" gcloud "terraform-provider-genesyscloud/genesyscloud" edgePhone "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_phone" diff --git a/genesyscloud/station/genesyscloud_station_proxy.go b/genesyscloud/station/genesyscloud_station_proxy.go index 7486790e1..8e744bdf8 100644 --- a/genesyscloud/station/genesyscloud_station_proxy.go +++ b/genesyscloud/station/genesyscloud_station_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // internalProxy holds a proxy instance that can be used throughout the package diff --git a/genesyscloud/task_management_workbin/genesyscloud_task_management_workbin_proxy.go b/genesyscloud/task_management_workbin/genesyscloud_task_management_workbin_proxy.go index acbe12980..dcce50592 100644 --- a/genesyscloud/task_management_workbin/genesyscloud_task_management_workbin_proxy.go +++ b/genesyscloud/task_management_workbin/genesyscloud_task_management_workbin_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin.go b/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin.go index 5b4c8a5f5..394e23a79 100644 --- a/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin.go +++ b/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin_test.go b/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin_test.go index b468918ea..731c143e8 100644 --- a/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin_test.go +++ b/genesyscloud/task_management_workbin/resource_genesyscloud_task_management_workbin_test.go @@ -12,7 +12,7 @@ import ( gcloud "terraform-provider-genesyscloud/genesyscloud" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workitem/genesyscloud_task_management_workitem_proxy.go b/genesyscloud/task_management_workitem/genesyscloud_task_management_workitem_proxy.go index 82aa8f0c4..cc3cd86d5 100644 --- a/genesyscloud/task_management_workitem/genesyscloud_task_management_workitem_proxy.go +++ b/genesyscloud/task_management_workitem/genesyscloud_task_management_workitem_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem.go b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem.go index 9f5494392..3abfa846d 100644 --- a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem.go +++ b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_test.go b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_test.go index c9d31132c..ae67f2425 100644 --- a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_test.go +++ b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_test.go @@ -23,7 +23,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_unit_test.go b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_unit_test.go index 591301bbb..6c53bb3dc 100644 --- a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_unit_test.go +++ b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_unit_test.go @@ -16,7 +16,7 @@ import ( lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_utils.go b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_utils.go index 6d3ab7ebf..505faf533 100644 --- a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_utils.go +++ b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_utils.go @@ -9,7 +9,7 @@ import ( lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workitem_schema/genesyscloud_task_management_workitem_schema_proxy.go b/genesyscloud/task_management_workitem_schema/genesyscloud_task_management_workitem_schema_proxy.go index a93f33c34..309470b2d 100644 --- a/genesyscloud/task_management_workitem_schema/genesyscloud_task_management_workitem_schema_proxy.go +++ b/genesyscloud/task_management_workitem_schema/genesyscloud_task_management_workitem_schema_proxy.go @@ -8,7 +8,7 @@ import ( "log" "net/http" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema.go b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema.go index f96eba1df..5ed7bd9f5 100644 --- a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema.go +++ b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_test.go b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_test.go index f043ef040..3599174c3 100644 --- a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_test.go +++ b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_test.go @@ -15,7 +15,7 @@ import ( lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_unit_test.go b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_unit_test.go index d9914e3b1..7b5452778 100644 --- a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_unit_test.go +++ b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_unit_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/stretchr/testify/assert" ) diff --git a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_utils.go b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_utils.go index 7594a8ccf..d7a5f0056 100644 --- a/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_utils.go +++ b/genesyscloud/task_management_workitem_schema/resource_genesyscloud_task_management_workitem_schema_utils.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) const ( diff --git a/genesyscloud/task_management_worktype/data_source_genesyscloud_task_management_unit_test.go b/genesyscloud/task_management_worktype/data_source_genesyscloud_task_management_unit_test.go index 6cfd137aa..0fa5a999a 100644 --- a/genesyscloud/task_management_worktype/data_source_genesyscloud_task_management_unit_test.go +++ b/genesyscloud/task_management_worktype/data_source_genesyscloud_task_management_unit_test.go @@ -2,12 +2,13 @@ package task_management_worktype import ( "context" + "terraform-provider-genesyscloud/genesyscloud/provider" + "testing" + "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/stretchr/testify/assert" - "terraform-provider-genesyscloud/genesyscloud/provider" - "testing" ) // TestUnitataSourceTaskManagementWorktypeStatus tests the retrieve of a status id. diff --git a/genesyscloud/task_management_worktype/genesyscloud_task_management_worktype_proxy.go b/genesyscloud/task_management_worktype/genesyscloud_task_management_worktype_proxy.go index 5f5417369..c24b2bab2 100644 --- a/genesyscloud/task_management_worktype/genesyscloud_task_management_worktype_proxy.go +++ b/genesyscloud/task_management_worktype/genesyscloud_task_management_worktype_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype.go b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype.go index df9a05aa0..a322ff5c5 100644 --- a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype.go +++ b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/consistency_checker" diff --git a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_test.go b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_test.go index f796b484d..90bf04a63 100644 --- a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_test.go +++ b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_test.go @@ -18,7 +18,7 @@ import ( workitemSchema "terraform-provider-genesyscloud/genesyscloud/task_management_workitem_schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_unit_test.go b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_unit_test.go index aefbe1a22..4af168184 100644 --- a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_unit_test.go +++ b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_unit_test.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/stretchr/testify/assert" ) diff --git a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go index 79284a9b9..45a292407 100644 --- a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go +++ b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_utils.go @@ -7,7 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/team/genesyscloud_team_proxy.go b/genesyscloud/team/genesyscloud_team_proxy.go index 2880ca8c0..7feba34d9 100644 --- a/genesyscloud/team/genesyscloud_team_proxy.go +++ b/genesyscloud/team/genesyscloud_team_proxy.go @@ -6,7 +6,7 @@ import ( "log" "terraform-provider-genesyscloud/genesyscloud/util" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* @@ -129,6 +129,7 @@ func createTeamFn(ctx context.Context, p *teamProxy, team *platformclientv2.Team func getAllTeamFn(ctx context.Context, p *teamProxy, name string) (*[]platformclientv2.Team, *platformclientv2.APIResponse, error) { var ( after string + err error allTeams []platformclientv2.Team response *platformclientv2.APIResponse ) @@ -152,7 +153,7 @@ func getAllTeamFn(ctx context.Context, p *teamProxy, name string) (*[]platformcl break } - after, err := util.GetQueryParamValueFromUri(*teams.NextUri, "after") + after, err = util.GetQueryParamValueFromUri(*teams.NextUri, "after") if err != nil { return nil, resp, fmt.Errorf("unable to parse after cursor from teams next uri: %v", err) } diff --git a/genesyscloud/team/resource_genesyscloud_team.go b/genesyscloud/team/resource_genesyscloud_team.go index 2c6d8414e..dd3f6fbcd 100644 --- a/genesyscloud/team/resource_genesyscloud_team.go +++ b/genesyscloud/team/resource_genesyscloud_team.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" diff --git a/genesyscloud/team/resource_genesyscloud_team_test.go b/genesyscloud/team/resource_genesyscloud_team_test.go index 03bede55f..edf5e83db 100644 --- a/genesyscloud/team/resource_genesyscloud_team_test.go +++ b/genesyscloud/team/resource_genesyscloud_team_test.go @@ -2,15 +2,16 @@ package team import ( "fmt" - "github.com/google/uuid" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "math/rand" "strings" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "testing" + "github.com/google/uuid" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" + gcloud "terraform-provider-genesyscloud/genesyscloud" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" diff --git a/genesyscloud/team/resource_genesyscloud_team_unit_test.go b/genesyscloud/team/resource_genesyscloud_team_unit_test.go index 3b3e670cb..c3e8650ea 100644 --- a/genesyscloud/team/resource_genesyscloud_team_unit_test.go +++ b/genesyscloud/team/resource_genesyscloud_team_unit_test.go @@ -11,7 +11,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/stretchr/testify/assert" ) diff --git a/genesyscloud/team/resource_genesyscloud_team_utils.go b/genesyscloud/team/resource_genesyscloud_team_utils.go index 8c926b239..6f5a7f976 100644 --- a/genesyscloud/team/resource_genesyscloud_team_utils.go +++ b/genesyscloud/team/resource_genesyscloud_team_utils.go @@ -3,14 +3,16 @@ package team import ( "context" "fmt" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "strings" "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/chunks" "terraform-provider-genesyscloud/genesyscloud/util/lists" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // getTeamFromResourceData maps data from schema ResourceData object to a platformclientv2.Team diff --git a/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings.go b/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings.go index e81844e03..6d4a7a125 100644 --- a/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings.go +++ b/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings.go @@ -22,7 +22,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) const ( diff --git a/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings_test.go b/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings_test.go index d0a1ecab1..e2210b361 100644 --- a/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings_test.go +++ b/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceTrunkBaseSettings(t *testing.T) { diff --git a/genesyscloud/telephony_providers_edges_did/genesyscloud_telephony_providers_edges_did_proxy.go b/genesyscloud/telephony_providers_edges_did/genesyscloud_telephony_providers_edges_did_proxy.go index 553f33454..931f3d720 100644 --- a/genesyscloud/telephony_providers_edges_did/genesyscloud_telephony_providers_edges_did_proxy.go +++ b/genesyscloud/telephony_providers_edges_did/genesyscloud_telephony_providers_edges_did_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/telephony_providers_edges_did_pool/genesyscloud_telephony_providers_edges_did_pool_proxy.go b/genesyscloud/telephony_providers_edges_did_pool/genesyscloud_telephony_providers_edges_did_pool_proxy.go index 65d2cdb54..be410c042 100644 --- a/genesyscloud/telephony_providers_edges_did_pool/genesyscloud_telephony_providers_edges_did_pool_proxy.go +++ b/genesyscloud/telephony_providers_edges_did_pool/genesyscloud_telephony_providers_edges_did_pool_proxy.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool.go b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool.go index a0a870405..b666afff3 100644 --- a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool.go +++ b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) // getAllDidPools retrieves all DID pools and is used for the exporter diff --git a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_test.go b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_test.go index 184070128..8ae609857 100644 --- a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_test.go +++ b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceDidPoolBasic(t *testing.T) { diff --git a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_utils.go b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_utils.go index 2f7ffa5c9..bc4f14a10 100644 --- a/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_utils.go +++ b/genesyscloud/telephony_providers_edges_did_pool/resource_genesyscloud_telephony_providers_edges_did_pool_utils.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type DidPoolStruct struct { diff --git a/genesyscloud/telephony_providers_edges_edge_group/genesyscloud_telephony_providers_edges_edge_group_proxy.go b/genesyscloud/telephony_providers_edges_edge_group/genesyscloud_telephony_providers_edges_edge_group_proxy.go index 6db0ceb02..8dbbf2440 100644 --- a/genesyscloud/telephony_providers_edges_edge_group/genesyscloud_telephony_providers_edges_edge_group_proxy.go +++ b/genesyscloud/telephony_providers_edges_edge_group/genesyscloud_telephony_providers_edges_edge_group_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *edgeGroupProxy diff --git a/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group.go b/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group.go index 45882bed4..77616d81c 100644 --- a/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group.go +++ b/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func createEdgeGroup(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { diff --git a/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_test.go b/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_test.go index 6c0968e95..c0d722626 100644 --- a/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_test.go +++ b/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceEdgeGroup(t *testing.T) { diff --git a/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_utils.go b/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_utils.go index 6089618c0..1b3883f0a 100644 --- a/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_utils.go +++ b/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_utils.go @@ -6,7 +6,7 @@ import ( lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func buildSdkTrunkBases(d *schema.ResourceData) *[]platformclientv2.Trunkbase { diff --git a/genesyscloud/telephony_providers_edges_extension_pool/genesyscloud_telephony_providers_edges_extension_pool_proxy.go b/genesyscloud/telephony_providers_edges_extension_pool/genesyscloud_telephony_providers_edges_extension_pool_proxy.go index 21de47b35..1cea85894 100644 --- a/genesyscloud/telephony_providers_edges_extension_pool/genesyscloud_telephony_providers_edges_extension_pool_proxy.go +++ b/genesyscloud/telephony_providers_edges_extension_pool/genesyscloud_telephony_providers_edges_extension_pool_proxy.go @@ -3,7 +3,7 @@ package telephony_providers_edges_extension_pool import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *extensionPoolProxy diff --git a/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool.go b/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool.go index 4cbe729b1..49c20d856 100644 --- a/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool.go +++ b/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllExtensionPools(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool_test.go b/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool_test.go index 84a0d93a0..80d602e94 100644 --- a/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool_test.go +++ b/genesyscloud/telephony_providers_edges_extension_pool/resource_genesyscloud_telephony_providers_edges_extension_pool_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type extensionPoolStruct struct { diff --git a/genesyscloud/telephony_providers_edges_linebasesettings/data_source_genesyscloud_telephony_providers_edges_linebasesettings.go b/genesyscloud/telephony_providers_edges_linebasesettings/data_source_genesyscloud_telephony_providers_edges_linebasesettings.go index 912f7a8b7..90d8bdd81 100644 --- a/genesyscloud/telephony_providers_edges_linebasesettings/data_source_genesyscloud_telephony_providers_edges_linebasesettings.go +++ b/genesyscloud/telephony_providers_edges_linebasesettings/data_source_genesyscloud_telephony_providers_edges_linebasesettings.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceLineBaseSettingsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { diff --git a/genesyscloud/telephony_providers_edges_phone/data_source_genesyscloud_telephony_providers_edges_phone_test.go b/genesyscloud/telephony_providers_edges_phone/data_source_genesyscloud_telephony_providers_edges_phone_test.go index 1d3ed67b6..9d3bb4dc6 100644 --- a/genesyscloud/telephony_providers_edges_phone/data_source_genesyscloud_telephony_providers_edges_phone_test.go +++ b/genesyscloud/telephony_providers_edges_phone/data_source_genesyscloud_telephony_providers_edges_phone_test.go @@ -66,7 +66,6 @@ func TestAccDataSourcePhone(t *testing.T) { stateActive, fmt.Sprintf("\"%s\"", defaultSiteId), "genesyscloud_telephony_providers_edges_phonebasesettings." + phoneBaseSettingsRes + ".id", - nil, // no line addresses "genesyscloud_user." + userRes1 + ".id", "", // no depends on }, diff --git a/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_init_test.go b/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_init_test.go index ddfe3a1b9..8eaeab5cd 100644 --- a/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_init_test.go +++ b/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_init_test.go @@ -10,7 +10,7 @@ import ( edgeSite "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site" "testing" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_proxy.go b/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_proxy.go index 648447fb6..3ff4089c9 100644 --- a/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_proxy.go +++ b/genesyscloud/telephony_providers_edges_phone/genesyscloud_telephony_providers_edges_phone_proxy.go @@ -8,7 +8,7 @@ import ( rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go index 64cee7cfa..e989f2b5d 100644 --- a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go +++ b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllPhones(ctx context.Context, sdkConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { @@ -110,7 +110,7 @@ func readPhone(ctx context.Context, d *schema.ResourceData, meta interface{}) di } if currentPhone.Lines != nil { - _ = d.Set("line_addresses", flattenPhoneLines(currentPhone.Lines)) + resourcedata.SetNillableValueWithInterfaceArrayWithFunc(d, "line_properties", currentPhone.Lines, flattenLines) } _ = d.Set("properties", nil) diff --git a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_schema.go b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_schema.go index 489a269b7..7caff939d 100644 --- a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_schema.go +++ b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_schema.go @@ -30,6 +30,24 @@ func SetRegistrar(l registrar.Registrar) { // ResourcePhone registers the genesyscloud_telephony_providers_edges_phone resource with Terraform func ResourcePhone() *schema.Resource { + lineProperties := &schema.Resource{ + Schema: map[string]*schema.Schema{ + `line_address`: { + Description: `DID for standalone phones. Each phone number must be in an E.164 phone number format.`, + Optional: true, + Computed: true, + Type: schema.TypeList, + Elem: &schema.Schema{Type: schema.TypeString, ValidateDiagFunc: validators.ValidatePhoneNumber}, + }, + `remote_address`: { + Description: `Station remote property for phones. No validation is provided`, + Optional: true, + Type: schema.TypeList, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validation.StringIsNotEmpty}, + }, + }, + } + phoneCapabilities := &schema.Resource{ Schema: map[string]*schema.Schema{ "provisions": { @@ -135,13 +153,6 @@ func ResourcePhone() *schema.Resource { Type: schema.TypeString, Optional: true, }, - "line_addresses": { - Description: "Ordered list of Line DIDs for standalone phones. Each phone number must be in an E.164 phone number format.", - Type: schema.TypeList, - Optional: true, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateDiagFunc: validators.ValidatePhoneNumber}, - }, "properties": { Description: "phone properties", Type: schema.TypeString, @@ -149,6 +160,13 @@ func ResourcePhone() *schema.Resource { Computed: true, DiffSuppressFunc: util.SuppressEquivalentJsonDiffs, }, + "line_properties": { + Description: "line properties", + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: lineProperties, + }, "capabilities": { Description: "Phone Capabilities.", Type: schema.TypeList, diff --git a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go index c01d7e3ed..f9955feea 100644 --- a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go +++ b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go @@ -17,7 +17,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourcePhoneBasic(t *testing.T) { @@ -89,7 +89,6 @@ func TestAccResourcePhoneBasic(t *testing.T) { stateActive, fmt.Sprintf("\"%s\"", siteId), "genesyscloud_telephony_providers_edges_phonebasesettings." + phoneBaseSettingsRes + ".id", - nil, // no line addresses "genesyscloud_user." + userRes1 + ".id", "", // no depends on }, @@ -120,7 +119,6 @@ func TestAccResourcePhoneBasic(t *testing.T) { stateActive, fmt.Sprintf("\"%s\"", siteId), "genesyscloud_telephony_providers_edges_phonebasesettings." + phoneBaseSettingsRes2 + ".id", - nil, // no line addresses "genesyscloud_user." + userRes2 + ".id", "", // no depends_on }, @@ -187,10 +185,9 @@ func TestAccResourcePhoneBasic(t *testing.T) { } func TestAccResourcePhoneStandalone(t *testing.T) { - number := "+12005538112" - deleteDidPoolWithNumber(number) + lineAddresses := "+12005538112" + deleteDidPoolWithNumber(lineAddresses) didPoolResource1 := "test-didpool1" - lineAddresses := []string{number} phoneRes := "phone_standalone1234" name1 := "test-phone-standalone_" + uuid.NewString() stateActive := "active" @@ -257,8 +254,8 @@ func TestAccResourcePhoneStandalone(t *testing.T) { }, Config: didPool.GenerateDidPoolResource(&didPool.DidPoolStruct{ ResourceID: didPoolResource1, - StartPhoneNumber: lineAddresses[0], - EndPhoneNumber: lineAddresses[0], + StartPhoneNumber: lineAddresses, + EndPhoneNumber: lineAddresses, Description: util.NullValue, // No description Comments: util.NullValue, // No comments PoolProvider: util.NullValue, // No provider @@ -273,17 +270,16 @@ func TestAccResourcePhoneStandalone(t *testing.T) { stateActive, "genesyscloud_telephony_providers_edges_site." + siteRes + ".id", "genesyscloud_telephony_providers_edges_phonebasesettings." + phoneBaseSettingsRes + ".id", - lineAddresses, "", // no web rtc user "genesyscloud_telephony_providers_edges_did_pool." + didPoolResource1, - }, capabilities, generatePhoneProperties(uuid.NewString())), + }, capabilities, generateLineProperties(strconv.Quote(lineAddresses), ""), generatePhoneProperties(uuid.NewString())), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "name", name1), resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "state", stateActive), resource.TestCheckResourceAttrPair("genesyscloud_telephony_providers_edges_phone."+phoneRes, "site_id", "genesyscloud_telephony_providers_edges_site."+siteRes, "id"), resource.TestCheckResourceAttrPair("genesyscloud_telephony_providers_edges_phone."+phoneRes, "line_base_settings_id", "genesyscloud_telephony_providers_edges_phonebasesettings."+phoneBaseSettingsRes, "line_base_settings_id"), resource.TestCheckResourceAttrPair("genesyscloud_telephony_providers_edges_phone."+phoneRes, "phone_base_settings_id", "genesyscloud_telephony_providers_edges_phonebasesettings."+phoneBaseSettingsRes, "id"), - resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "line_addresses.0", lineAddresses[0]), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "line_properties.0.line_address.0", lineAddresses), resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.provisions", util.FalseValue), resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.registers", util.TrueValue), resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.dual_registers", util.TrueValue), @@ -388,7 +384,6 @@ func TestAccResourceHardPhoneStandalone(t *testing.T) { stateActive, "genesyscloud_telephony_providers_edges_site." + siteRes + ".id", "genesyscloud_telephony_providers_edges_phonebasesettings." + phoneBaseSettingsRes + ".id", - []string{}, "", // no web rtc user "", // no Depends On }, capabilities, generatePhoneProperties(phoneMac)) @@ -400,7 +395,6 @@ func TestAccResourceHardPhoneStandalone(t *testing.T) { stateActive, "genesyscloud_telephony_providers_edges_site." + siteRes + ".id", "genesyscloud_telephony_providers_edges_phonebasesettings." + phoneBaseSettingsRes + ".id", - []string{}, "", // no web rtc user "", // no Depends On }, capabilities, generatePhoneProperties(phoneMacUpdated)) @@ -444,6 +438,117 @@ func TestAccResourceHardPhoneStandalone(t *testing.T) { CheckDestroy: TestVerifyWebRtcPhoneDestroyed, }) } + +func TestAccResourcePhoneStandaloneRemoteStation(t *testing.T) { + remoteStationAddress := "+11005538454" + phoneRes := "phone_standalone1234" + name1 := "test-phone-Kstandalone_" + uuid.NewString() + stateActive := "active" + phoneBaseSettingsRes := "phoneBaseSettings1234" + phoneBaseSettingsName := "phoneBaseSettings " + uuid.NewString() + + locationRes := "test-location" + + emergencyNumber := "+13173114164" + if err := edgeSite.DeleteLocationWithNumber(emergencyNumber, sdkConfig); err != nil { + t.Skipf("failed to delete location with number %s: %v", emergencyNumber, err) + } + + locationConfig := gcloud.GenerateLocationResource( + locationRes, + "TerraformLocationRemote"+uuid.NewString(), + "HQ1", + []string{}, + gcloud.GenerateLocationEmergencyNum( + emergencyNumber, + util.NullValue, // Default number type + ), gcloud.GenerateLocationAddress( + "0176 Interactive Way", + "Indianapolis", + "IN", + "US", + "46279", + )) + + siteRes := "test-site" + siteConfig := edgeSite.GenerateSiteResourceWithCustomAttrs( + siteRes, + "tf site "+uuid.NewString(), + "test site description", + "genesyscloud_location."+locationRes+".id", + "Premises", + false, + `["us-east-1"]`, + util.NullValue, + util.NullValue, + "primary_sites = []", + "secondary_sites = []", + ) + + capabilities := generatePhoneCapabilities( + false, + true, + true, + true, + true, + false, + true, + "mac", + []string{}, + ) + + config := phoneBaseSettings.GeneratePhoneBaseSettingsResourceWithCustomAttrs( + phoneBaseSettingsRes, + phoneBaseSettingsName, + "phoneBaseSettings description", + "generic_sip.json", + ) + GeneratePhoneResourceWithCustomAttrs(&PhoneConfig{ + phoneRes, + name1, + stateActive, + "genesyscloud_telephony_providers_edges_site." + siteRes + ".id", + "genesyscloud_telephony_providers_edges_phonebasesettings." + phoneBaseSettingsRes + ".id", + "", // no web rtc user + "", // no depends on + }, capabilities, generateLineProperties("", strconv.Quote(remoteStationAddress)), generatePhoneProperties(uuid.NewString())) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { util.TestAccPreCheck(t) }, + ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + Steps: []resource.TestStep{ + { + PreConfig: func() { + time.Sleep(30 * time.Second) + }, + Config: locationConfig + siteConfig + config, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "name", name1), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "state", stateActive), + resource.TestCheckResourceAttrPair("genesyscloud_telephony_providers_edges_phone."+phoneRes, "site_id", "genesyscloud_telephony_providers_edges_site."+siteRes, "id"), + resource.TestCheckResourceAttrPair("genesyscloud_telephony_providers_edges_phone."+phoneRes, "line_base_settings_id", "genesyscloud_telephony_providers_edges_phonebasesettings."+phoneBaseSettingsRes, "line_base_settings_id"), + resource.TestCheckResourceAttrPair("genesyscloud_telephony_providers_edges_phone."+phoneRes, "phone_base_settings_id", "genesyscloud_telephony_providers_edges_phonebasesettings."+phoneBaseSettingsRes, "id"), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "line_properties.0.remote_address.0", remoteStationAddress), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.provisions", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.registers", util.TrueValue), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.dual_registers", util.TrueValue), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.allow_reboot", util.TrueValue), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.no_rebalance", util.TrueValue), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.no_cloud_provisioning", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.cdm", util.TrueValue), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.hardware_id_type", "mac"), + ), + }, + { + // Import/Read + ResourceName: "genesyscloud_telephony_providers_edges_phone." + phoneRes, + ImportState: true, + ImportStateVerify: true, + }, + }, + CheckDestroy: TestVerifyWebRtcPhoneDestroyed, + }) +} + func generatePhoneCapabilities( provisions, registers, diff --git a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go index 7545851fe..3ff097d5b 100644 --- a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go +++ b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go @@ -13,12 +13,11 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type PhoneConfig struct { @@ -27,7 +26,6 @@ type PhoneConfig struct { State string SiteId string PhoneBaseSettingsId string - LineAddresses []string WebRtcUserId string DependsOn string } @@ -50,18 +48,21 @@ func getPhoneFromResourceData(ctx context.Context, pp *phoneProxy, d *schema.Res if lineBaseSettingsID == "" { lineBaseSettingsID, err = getLineBaseSettingsID(ctx, pp, *phoneConfig.PhoneBaseSettings.Id) if err != nil { - return nil, fmt.Errorf("failed to get line base settings for %s: %s", *phoneConfig.Name, err) + return phoneConfig, fmt.Errorf("failed to get line base settings for %s: %s", *phoneConfig.Name, err) } } lineBaseSettings := &platformclientv2.Domainentityref{Id: &lineBaseSettingsID} - lines, isStandalone := buildSdkLines(ctx, pp, d, lineBaseSettings) + lines, isStandalone, lineError := buildSdkLines(ctx, pp, d, lineBaseSettings) + if lineError != nil { + return phoneConfig, fmt.Errorf("failed to create lines for %s: %s", *phoneConfig.Name, lineError) + } phoneConfig.LineBaseSettings = lineBaseSettings phoneConfig.Lines = lines // phone meta base phoneMetaBaseId, err := getPhoneMetaBaseId(ctx, pp, *phoneConfig.PhoneBaseSettings.Id) if err != nil { - return nil, fmt.Errorf("failed to get phone meta base for %s: %s", *phoneConfig.Name, err) + return phoneConfig, fmt.Errorf("failed to get phone meta base for %s: %s", *phoneConfig.Name, err) } phoneMetaBase := &platformclientv2.Domainentityref{ Id: &phoneMetaBaseId, @@ -165,34 +166,6 @@ func getPhoneMetaBaseId(ctx context.Context, pp *phoneProxy, phoneBaseSettingsId return *phoneBase.PhoneMetaBase.Id, nil } -func flattenPhoneLines(lines *[]platformclientv2.Line) []string { - if lines == nil { - return nil - } - - lineAddressList := []string{} - for i := 0; i < len(*lines); i++ { - line := (*lines)[i] - did := "" - if line.Properties == nil { - continue - } - if k := (*line.Properties)["station_identity_address"]; k != nil { - didI := k.(map[string]interface{})["value"].(map[string]interface{})["instance"] - if didI != nil { - did = didI.(string) - } - } - - if len(did) == 0 { - continue - } - lineAddressList = append(lineAddressList, did) - } - - return lineAddressList -} - func flattenPhoneCapabilities(capabilities *platformclientv2.Phonecapabilities) []interface{} { if capabilities == nil { return nil @@ -212,45 +185,99 @@ func flattenPhoneCapabilities(capabilities *platformclientv2.Phonecapabilities) return []interface{}{capabilitiesMap} } -func buildSdkLines(ctx context.Context, pp *phoneProxy, d *schema.ResourceData, lineBaseSettings *platformclientv2.Domainentityref) (linesPtr *[]platformclientv2.Line, isStandAlone bool) { +func buildSdkLines(ctx context.Context, pp *phoneProxy, d *schema.ResourceData, lineBaseSettings *platformclientv2.Domainentityref) (linesPtr *[]platformclientv2.Line, isStandAlone bool, err error) { lines := []platformclientv2.Line{} + lineAddress, remoteAddress := getLineProperties(d) + if len(*lineAddress) > 0 && len(*remoteAddress) > 0 { + return linesPtr, false, fmt.Errorf("remote stations cannot be standalone phones, line_address and remote_address cannot exist at the same time") + } + if len(*lineAddress) > 0 { + linesPtr = createStandalonePhoneLines(*lineAddress, &lines, lineBaseSettings) + isStandAlone = true + return linesPtr, isStandAlone, nil + } + if len(*remoteAddress) > 0 { + linesPtr = createNonStandalonePhoneLine(*remoteAddress, &lines, lineBaseSettings) + isStandAlone = false + return linesPtr, isStandAlone, nil + } + // If line_addresses is not provided, phone is not standalone + hasher := fnv.New32() + hasher.Write([]byte(d.Get("name").(string))) + lineName := "line_" + *lineBaseSettings.Id + fmt.Sprintf("%x", hasher.Sum32()) + line := platformclientv2.Line{ + Name: &lineName, + LineBaseSettings: lineBaseSettings, + } + // If this function is invoked on a phone create, the ID won't exist yet + if d.Id() != "" { + lineId, err := getLineIdByPhoneId(ctx, pp, d.Id()) + if err != nil { + log.Printf("Failed to retrieve ID for phone %s: %v", d.Id(), err) + } else { + line.Id = &lineId + } + } + lines = append(lines, line) + linesPtr = &lines isStandAlone = false + return linesPtr, isStandAlone, nil +} - lineAddresses, ok := d.GetOk("line_addresses") - lineStringList := lists.InterfaceListToStrings(lineAddresses.([]interface{})) +func getLineProperties(d *schema.ResourceData) (*[]interface{}, *[]interface{}) { + lineAddress := make([]interface{}, 0) + remoteAddress := make([]interface{}, 0) + linePropertiesMap := make(map[string]interface{}) + if linePropertiesObject, ok := d.Get("line_properties").([]interface{}); ok && len(linePropertiesObject) > 0 { + linePropertiesMap = linePropertiesObject[0].(map[string]interface{}) + } + if lineAddressObject, ok := linePropertiesMap["line_address"].([]interface{}); ok { + lineAddress = lineAddressObject + } + if remoteAddressObject, ok := linePropertiesMap["remote_address"].([]interface{}); ok { + remoteAddress = remoteAddressObject + } + return &lineAddress, &remoteAddress +} - // If line_addresses is not provided, phone is not standalone - if !ok || len(lineStringList) == 0 { - hasher := fnv.New32() - hasher.Write([]byte(d.Get("name").(string))) - lineName := "line_" + *lineBaseSettings.Id + fmt.Sprintf("%x", hasher.Sum32()) - line := platformclientv2.Line{ +func generatePhoneProperties(hardware_id string) string { + // A random selection of properties + return "properties = " + util.GenerateJsonEncodedProperties( + util.GenerateJsonProperty( + "phone_hardwareId", util.GenerateJsonObject( + util.GenerateJsonProperty( + "value", util.GenerateJsonObject( + util.GenerateJsonProperty("instance", strconv.Quote(hardware_id)), + )))), + ) +} +func createNonStandalonePhoneLine(remoteAddress []interface{}, linesPtr *[]platformclientv2.Line, lineBaseSettings *platformclientv2.Domainentityref) *[]platformclientv2.Line { + lines := *linesPtr + for i, eachAddress := range remoteAddress { + lineName := "line_" + *lineBaseSettings.Id + "_" + strconv.Itoa(i+1) + properties := map[string]interface{}{ + "station_remote_address": &map[string]interface{}{ + "value": &map[string]interface{}{ + "instance": eachAddress.(string), + }, + }, + } + lines = append(lines, platformclientv2.Line{ Name: &lineName, LineBaseSettings: lineBaseSettings, - } - - // If this function is invoked on a phone create, the ID won't exist yet - if d.Id() != "" { - lineId, err := getLineIdByPhoneId(ctx, pp, d.Id()) - if err != nil { - log.Printf("Failed to retrieve ID for phone %s: %v", d.Id(), err) - } else { - line.Id = &lineId - } - } - - lines = append(lines, line) - - linesPtr = &lines - return + Properties: &properties, + }) } - - for i := 0; i < len(lineStringList); i++ { + return &lines +} +func createStandalonePhoneLines(lineAddress []interface{}, linesPtr *[]platformclientv2.Line, lineBaseSettings *platformclientv2.Domainentityref) *[]platformclientv2.Line { + lines := *linesPtr + for i, eachLineAddress := range lineAddress { lineName := "line_" + *lineBaseSettings.Id + "_" + strconv.Itoa(i+1) properties := map[string]interface{}{ "station_identity_address": &map[string]interface{}{ "value": &map[string]interface{}{ - "instance": (lineStringList)[i], + "instance": eachLineAddress.(string), }, }, } @@ -260,11 +287,75 @@ func buildSdkLines(ctx context.Context, pp *phoneProxy, d *schema.ResourceData, Properties: &properties, }) } + return &lines +} - linesPtr = &lines - isStandAlone = true +func flattenLines(phoneLines *[]platformclientv2.Line) []interface{} { + if len(*phoneLines) == 0 { + return nil + } + lineAddressList := []string{} + remoteAddressList := []string{} + linePropertiesMap := make(map[string]interface{}) + + for _, phoneLine := range *phoneLines { + if phoneLine.Properties == nil { + continue + } + if idAddressKey := (*phoneLine.Properties)["station_identity_address"]; idAddressKey != nil { + didI := idAddressKey.(map[string]interface{})["value"].(map[string]interface{})["instance"] + if didI != nil && len(didI.(string)) > 0 { + did := didI.(string) + lineAddressList = append(lineAddressList, did) - return + } + } + if remoteAddressKey := (*phoneLine.Properties)["station_remote_address"]; remoteAddressKey != nil { + remoteAddress := remoteAddressKey.(map[string]interface{})["value"].(map[string]interface{})["instance"] + if remoteAddress != nil && len(remoteAddress.(string)) > 0 { + remoteAddressStr := remoteAddress.(string) + remoteAddressList = append(remoteAddressList, remoteAddressStr) + } + } + + } + + if len(lineAddressList) > 0 { + resourcedata.SetMapValueIfNotNil(linePropertiesMap, "line_address", &lineAddressList) + } + if len(remoteAddressList) > 0 { + resourcedata.SetMapValueIfNotNil(linePropertiesMap, "remote_address", &remoteAddressList) + } + if len(linePropertiesMap) > 0 { + return []interface{}{linePropertiesMap} + + } + return nil +} + +func generateLineProperties(lineAddress string, remoteAddress string) string { + if lineAddress == "" { + return fmt.Sprintf(` + line_properties { + remote_address = [%s] + } + `, remoteAddress) + } + + if remoteAddress == "" { + return fmt.Sprintf(` + line_properties { + line_address = [%s] + } + `, lineAddress) + } + + return fmt.Sprintf(` + line_properties { + line_address = [%s] + remote_address = [%s] + } +`, lineAddress, remoteAddress) } func getLineIdByPhoneId(ctx context.Context, pp *phoneProxy, phoneId string) (string, error) { @@ -318,10 +409,6 @@ func buildSdkCapabilities(d *schema.ResourceData) *platformclientv2.Phonecapabil } func GeneratePhoneResourceWithCustomAttrs(config *PhoneConfig, otherAttrs ...string) string { - lineStrs := make([]string, len(config.LineAddresses)) - for i, val := range config.LineAddresses { - lineStrs[i] = fmt.Sprintf("\"%s\"", val) - } webRtcUser := "" if len(config.WebRtcUserId) != 0 { @@ -333,7 +420,6 @@ func GeneratePhoneResourceWithCustomAttrs(config *PhoneConfig, otherAttrs ...str state = "%s" site_id = %s phone_base_settings_id = %s - line_addresses = [%s] depends_on=[%s] %s %s @@ -343,7 +429,6 @@ func GeneratePhoneResourceWithCustomAttrs(config *PhoneConfig, otherAttrs ...str config.State, config.SiteId, config.PhoneBaseSettingsId, - strings.Join(lineStrs, ","), config.DependsOn, webRtcUser, strings.Join(otherAttrs, "\n"), @@ -373,15 +458,3 @@ func TestVerifyWebRtcPhoneDestroyed(state *terraform.State) error { //Success. Phone destroyed return nil } - -func generatePhoneProperties(hardware_id string) string { - // A random selection of properties - return "properties = " + util.GenerateJsonEncodedProperties( - util.GenerateJsonProperty( - "phone_hardwareId", util.GenerateJsonObject( - util.GenerateJsonProperty( - "value", util.GenerateJsonObject( - util.GenerateJsonProperty("instance", strconv.Quote(hardware_id)), - )))), - ) -} diff --git a/genesyscloud/telephony_providers_edges_phonebasesettings/data_source_genesyscloud_telephony_providers_edges_phonebasesettings.go b/genesyscloud/telephony_providers_edges_phonebasesettings/data_source_genesyscloud_telephony_providers_edges_phonebasesettings.go index ddbafa09b..89d87eee5 100644 --- a/genesyscloud/telephony_providers_edges_phonebasesettings/data_source_genesyscloud_telephony_providers_edges_phonebasesettings.go +++ b/genesyscloud/telephony_providers_edges_phonebasesettings/data_source_genesyscloud_telephony_providers_edges_phonebasesettings.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourcePhoneBaseSettingsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { diff --git a/genesyscloud/telephony_providers_edges_phonebasesettings/genesyscloud_telephony_providers_edges_phonebasesettings_proxy.go b/genesyscloud/telephony_providers_edges_phonebasesettings/genesyscloud_telephony_providers_edges_phonebasesettings_proxy.go index 47093078c..7fe288706 100644 --- a/genesyscloud/telephony_providers_edges_phonebasesettings/genesyscloud_telephony_providers_edges_phonebasesettings_proxy.go +++ b/genesyscloud/telephony_providers_edges_phonebasesettings/genesyscloud_telephony_providers_edges_phonebasesettings_proxy.go @@ -3,7 +3,7 @@ package telephony_providers_edges_phonebasesettings import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *phoneBaseProxy diff --git a/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings.go b/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings.go index 3ac3ed4dd..65e682d22 100644 --- a/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings.go +++ b/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func createPhoneBaseSettings(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { diff --git a/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_test.go b/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_test.go index 864dc06f4..b3c0eb40d 100644 --- a/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_test.go +++ b/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_test.go @@ -11,7 +11,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourcePhoneBaseSettings(t *testing.T) { diff --git a/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_utils.go b/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_utils.go index 9cd0bc6be..7cd2824ac 100644 --- a/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_utils.go +++ b/genesyscloud/telephony_providers_edges_phonebasesettings/resource_genesyscloud_telephony_providers_edges_phonebasesettings_utils.go @@ -7,7 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func generatePhoneBaseSettingsDataSource( diff --git a/genesyscloud/telephony_providers_edges_site/data_source_genesyscloud_telephony_providers_edges_site_test.go b/genesyscloud/telephony_providers_edges_site/data_source_genesyscloud_telephony_providers_edges_site_test.go index 1ca6a3319..de32d841f 100644 --- a/genesyscloud/telephony_providers_edges_site/data_source_genesyscloud_telephony_providers_edges_site_test.go +++ b/genesyscloud/telephony_providers_edges_site/data_source_genesyscloud_telephony_providers_edges_site_test.go @@ -7,7 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util" "testing" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" gcloud "terraform-provider-genesyscloud/genesyscloud" diff --git a/genesyscloud/telephony_providers_edges_site/genesyscloud_telephony_providers_edges_site_proxy.go b/genesyscloud/telephony_providers_edges_site/genesyscloud_telephony_providers_edges_site_proxy.go index bd7b487ee..12ec0e4d8 100644 --- a/genesyscloud/telephony_providers_edges_site/genesyscloud_telephony_providers_edges_site_proxy.go +++ b/genesyscloud/telephony_providers_edges_site/genesyscloud_telephony_providers_edges_site_proxy.go @@ -5,7 +5,7 @@ import ( "fmt" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site.go b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site.go index 5297248fe..23208cad9 100644 --- a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site.go +++ b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllSites(ctx context.Context, sdkConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_schema.go b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_schema.go index db12e288d..55b4e51b1 100644 --- a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_schema.go +++ b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_schema.go @@ -2,13 +2,14 @@ package telephony_providers_edges_site import ( "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" "terraform-provider-genesyscloud/genesyscloud/validators" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_test.go b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_test.go index d601105cc..e44edd2d8 100644 --- a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_test.go +++ b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_test.go @@ -18,7 +18,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceSite(t *testing.T) { diff --git a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_utils.go b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_utils.go index 4cfd92d46..2fbbae030 100644 --- a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_utils.go +++ b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_utils.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/leekchan/timeutil" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var ( diff --git a/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_init_test.go b/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_init_test.go index dfa9e4042..9f07f2aa9 100644 --- a/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_init_test.go +++ b/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_init_test.go @@ -1,8 +1,6 @@ package telephony_providers_edges_site_outbound_route import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" "sync" gcloud "terraform-provider-genesyscloud/genesyscloud" @@ -10,6 +8,9 @@ import ( "terraform-provider-genesyscloud/genesyscloud/telephony" "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site" "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_proxy.go b/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_proxy.go index d9ff5d76c..14cf01d7d 100644 --- a/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_proxy.go +++ b/genesyscloud/telephony_providers_edges_site_outbound_route/genesyscloud_telephony_providers_edges_site_outbound_route_proxy.go @@ -2,9 +2,10 @@ package telephony_providers_edges_site_outbound_route import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" telephonyProvidersEdgesSite "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* diff --git a/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route.go b/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route.go index bcbab805e..610d622aa 100644 --- a/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route.go +++ b/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route.go @@ -3,20 +3,23 @@ package telephony_providers_edges_site_outbound_route import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "log" + "terraform-provider-genesyscloud/genesyscloud/consistency_checker" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" "terraform-provider-genesyscloud/genesyscloud/util" + "terraform-provider-genesyscloud/genesyscloud/util/constants" featureToggles "terraform-provider-genesyscloud/genesyscloud/util/feature_toggles" "terraform-provider-genesyscloud/genesyscloud/util/lists" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllSitesOutboundRoutes(ctx context.Context, sdkConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { @@ -62,10 +65,31 @@ func createSiteOutboundRoutes(ctx context.Context, d *schema.ResourceData, meta sdkConfig := meta.(*provider.ProviderMeta).ClientConfig proxy := getSiteOutboundRouteProxy(sdkConfig) siteId := d.Get("site_id").(string) + outboundRoutes := buildOutboundRoutes(d.Get("outbound_routes").(*schema.Set)) + var newRoutes []platformclientv2.Outboundroutebase + + // When creating outbound routes, routes may already exist in the site. This can lead to error `Outbound Route Already Exists` + // To prevent this, existing routes for the site are obtained and compared with the routes to be created + // ONLY non-existing routes are created for the site + + log.Printf("Retrieving existing outbound routes for side %s before creation", siteId) + + outboundRoutesAPI, resp, err := proxy.getSiteOutboundRoutes(ctx, siteId) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to get outbound routes for site %s error: %s", d.Id(), err), resp) + } + + // If the site already has routes, filter and create routes that don't exist + // Otherwise, create every route + if outboundRoutesAPI != nil && len(*outboundRoutesAPI) > 0 { + newRoutes = checkExistingRoutes(outboundRoutes, outboundRoutesAPI, siteId) + } else { + newRoutes = append(newRoutes, *outboundRoutes...) + } + log.Printf("creating outbound routes for site %s", siteId) - outboundRoutes := buildOutboundRoutes(d.Get("outbound_routes").(*schema.Set)) - for _, outboundRoute := range *outboundRoutes { + for _, outboundRoute := range newRoutes { _, resp, err := proxy.createSiteOutboundRoute(ctx, siteId, &outboundRoute) if err != nil { return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("failed to create outbound route %s for site %s: %s", *outboundRoute.Name, siteId, err), resp) @@ -126,6 +150,7 @@ func readSiteOutboundRoutes(ctx context.Context, d *schema.ResourceData, meta in _ = d.Set("outbound_routes", nil) } + log.Printf("Read outbound routes for site %s", d.Id()) return cc.CheckState(d) }) } diff --git a/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_utils.go b/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_utils.go index ababd9fe0..5c9b6c29c 100644 --- a/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_utils.go +++ b/genesyscloud/telephony_providers_edges_site_outbound_route/resource_genesyscloud_telephony_providers_edges_site_outbound_route_utils.go @@ -1,9 +1,11 @@ package telephony_providers_edges_site_outbound_route import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "log" "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func buildOutboundRoutes(outboundRoutes *schema.Set) *[]platformclientv2.Outboundroutebase { @@ -46,3 +48,14 @@ func nameInOutboundRoutes(name string, outboundRoutes []platformclientv2.Outboun return nil, false } + +func checkExistingRoutes(definedRoutes, apiRoutes *[]platformclientv2.Outboundroutebase, siteId string) (newRoutes []platformclientv2.Outboundroutebase) { + for _, definedRoute := range *definedRoutes { + if _, present := nameInOutboundRoutes(*definedRoute.Name, *apiRoutes); present { + log.Printf("Route %s associated with site %s already exists. Creating only non-existing routes", *definedRoute.Name, siteId) + } else { + newRoutes = append(newRoutes, definedRoute) + } + } + return newRoutes +} diff --git a/genesyscloud/telephony_providers_edges_trunk/data_source_genesyscloud_telephony_providers_edges_trunk.go b/genesyscloud/telephony_providers_edges_trunk/data_source_genesyscloud_telephony_providers_edges_trunk.go index de61a6741..194790fe9 100644 --- a/genesyscloud/telephony_providers_edges_trunk/data_source_genesyscloud_telephony_providers_edges_trunk.go +++ b/genesyscloud/telephony_providers_edges_trunk/data_source_genesyscloud_telephony_providers_edges_trunk.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func dataSourceTrunkRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { diff --git a/genesyscloud/telephony_providers_edges_trunk/genesyscloud_telephony_providers_edges_trunk_proxy.go b/genesyscloud/telephony_providers_edges_trunk/genesyscloud_telephony_providers_edges_trunk_proxy.go index 4f2138191..df99c6690 100644 --- a/genesyscloud/telephony_providers_edges_trunk/genesyscloud_telephony_providers_edges_trunk_proxy.go +++ b/genesyscloud/telephony_providers_edges_trunk/genesyscloud_telephony_providers_edges_trunk_proxy.go @@ -3,7 +3,7 @@ package telephony_providers_edges_trunk import ( "context" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) //generate a proxy for telephony_providers_edges_trunk diff --git a/genesyscloud/telephony_providers_edges_trunk/resource_genesyscloud_telephony_providers_edges_trunk.go b/genesyscloud/telephony_providers_edges_trunk/resource_genesyscloud_telephony_providers_edges_trunk.go index af15ea366..b0791dc9c 100644 --- a/genesyscloud/telephony_providers_edges_trunk/resource_genesyscloud_telephony_providers_edges_trunk.go +++ b/genesyscloud/telephony_providers_edges_trunk/resource_genesyscloud_telephony_providers_edges_trunk.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func createTrunk(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { diff --git a/genesyscloud/tfexporter/genesyscloud_resource_exporter.go b/genesyscloud/tfexporter/genesyscloud_resource_exporter.go index abf75169a..c4bb43660 100644 --- a/genesyscloud/tfexporter/genesyscloud_resource_exporter.go +++ b/genesyscloud/tfexporter/genesyscloud_resource_exporter.go @@ -33,7 +33,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/mohae/deepcopy" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) /* @@ -1231,19 +1231,17 @@ func (g *GenesysCloudResourceExporter) sanitizeConfigMap( } if exporter.IsAttributeE164(currAttr) { - if phoneNumber, ok := configMap[key].(string); !ok || phoneNumber == "" { + if _, ok := configMap[key].(string); !ok { continue } configMap[key] = sanitizeE164Number(configMap[key].(string)) - continue } if exporter.IsAttributeRrule(currAttr) { - if rrule, ok := configMap[key].(string); !ok || rrule == "" { + if _, ok := configMap[key].(string); !ok { continue } configMap[key] = sanitizeRrule(configMap[key].(string)) - continue } switch val.(type) { diff --git a/genesyscloud/tfexporter/genesyscloud_resource_exporter_test.go b/genesyscloud/tfexporter/genesyscloud_resource_exporter_test.go index 1f85ff1ff..2c393142f 100644 --- a/genesyscloud/tfexporter/genesyscloud_resource_exporter_test.go +++ b/genesyscloud/tfexporter/genesyscloud_resource_exporter_test.go @@ -3,13 +3,14 @@ package tfexporter import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "reflect" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" "terraform-provider-genesyscloud/genesyscloud/util" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/stretchr/testify/assert" diff --git a/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go b/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go index 4b91ebe6d..98febed09 100644 --- a/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go +++ b/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go @@ -25,7 +25,7 @@ import ( "testing" "time" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/testrunner" diff --git a/genesyscloud/tfexporter/tf_exporter_resource_test.go b/genesyscloud/tfexporter/tf_exporter_resource_test.go index e2bb97141..a0e4d44aa 100644 --- a/genesyscloud/tfexporter/tf_exporter_resource_test.go +++ b/genesyscloud/tfexporter/tf_exporter_resource_test.go @@ -6,12 +6,6 @@ import ( "terraform-provider-genesyscloud/genesyscloud/architect_datatable_row" emergencyGroup "terraform-provider-genesyscloud/genesyscloud/architect_emergencygroup" flow "terraform-provider-genesyscloud/genesyscloud/architect_flow" - flowLogLevel "terraform-provider-genesyscloud/genesyscloud/flow_loglevel" - outboundContactListContact "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list_contact" - routingSettings "terraform-provider-genesyscloud/genesyscloud/routing_settings" - routingUtilization "terraform-provider-genesyscloud/genesyscloud/routing_utilization" - routingUtilizationLabel "terraform-provider-genesyscloud/genesyscloud/routing_utilization_label" - outboundRoute "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site_outbound_route" grammar "terraform-provider-genesyscloud/genesyscloud/architect_grammar" grammarLanguage "terraform-provider-genesyscloud/genesyscloud/architect_grammar_language" archIvr "terraform-provider-genesyscloud/genesyscloud/architect_ivr" @@ -19,12 +13,17 @@ import ( architectSchedules "terraform-provider-genesyscloud/genesyscloud/architect_schedules" authRole "terraform-provider-genesyscloud/genesyscloud/auth_role" employeeperformanceExternalmetricsDefinition "terraform-provider-genesyscloud/genesyscloud/employeeperformance_externalmetrics_definitions" + flowLogLevel "terraform-provider-genesyscloud/genesyscloud/flow_loglevel" flowMilestone "terraform-provider-genesyscloud/genesyscloud/flow_milestone" flowOutcome "terraform-provider-genesyscloud/genesyscloud/flow_outcome" "terraform-provider-genesyscloud/genesyscloud/group" groupRoles "terraform-provider-genesyscloud/genesyscloud/group_roles" idpAdfs "terraform-provider-genesyscloud/genesyscloud/idp_adfs" + idpGeneric "terraform-provider-genesyscloud/genesyscloud/idp_generic" + idpGsuite "terraform-provider-genesyscloud/genesyscloud/idp_gsuite" idpOkta "terraform-provider-genesyscloud/genesyscloud/idp_okta" + idpOneLogin "terraform-provider-genesyscloud/genesyscloud/idp_onelogin" + idpPing "terraform-provider-genesyscloud/genesyscloud/idp_ping" idpSalesforce "terraform-provider-genesyscloud/genesyscloud/idp_salesforce" integration "terraform-provider-genesyscloud/genesyscloud/integration" integrationAction "terraform-provider-genesyscloud/genesyscloud/integration_action" @@ -39,6 +38,7 @@ import ( obCampaign "terraform-provider-genesyscloud/genesyscloud/outbound_campaign" obCampaignRule "terraform-provider-genesyscloud/genesyscloud/outbound_campaignrule" outboundContactList "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list" + outboundContactListContact "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list_contact" obContactListFilter "terraform-provider-genesyscloud/genesyscloud/outbound_contactlistfilter" obDncList "terraform-provider-genesyscloud/genesyscloud/outbound_dnclist" obfst "terraform-provider-genesyscloud/genesyscloud/outbound_filespecificationtemplate" @@ -56,7 +56,10 @@ import ( routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" routingQueueConditionalGroupRouting "terraform-provider-genesyscloud/genesyscloud/routing_queue_conditional_group_routing" routingQueueOutboundEmailAddress "terraform-provider-genesyscloud/genesyscloud/routing_queue_outbound_email_address" + routingSettings "terraform-provider-genesyscloud/genesyscloud/routing_settings" routingSmsAddress "terraform-provider-genesyscloud/genesyscloud/routing_sms_addresses" + routingUtilization "terraform-provider-genesyscloud/genesyscloud/routing_utilization" + routingUtilizationLabel "terraform-provider-genesyscloud/genesyscloud/routing_utilization_label" "terraform-provider-genesyscloud/genesyscloud/scripts" workbin "terraform-provider-genesyscloud/genesyscloud/task_management_workbin" workitemSchema "terraform-provider-genesyscloud/genesyscloud/task_management_workitem_schema" @@ -66,6 +69,7 @@ import ( edgeGroup "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_edge_group" edgeExtension "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_extension_pool" phonebaseSettings "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_phonebasesettings" + outboundRoute "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site_outbound_route" edgesTrunk "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_trunk" userRoles "terraform-provider-genesyscloud/genesyscloud/user_roles" webdeployConfig "terraform-provider-genesyscloud/genesyscloud/webdeployments_configuration" @@ -121,11 +125,11 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_group"] = group.ResourceGroup() providerResources["genesyscloud_group_roles"] = groupRoles.ResourceGroupRoles() providerResources["genesyscloud_idp_adfs"] = idpAdfs.ResourceIdpAdfs() - providerResources["genesyscloud_idp_generic"] = gcloud.ResourceIdpGeneric() - providerResources["genesyscloud_idp_gsuite"] = gcloud.ResourceIdpGsuite() + providerResources["genesyscloud_idp_generic"] = idpGeneric.ResourceIdpGeneric() + providerResources["genesyscloud_idp_gsuite"] = idpGsuite.ResourceIdpGsuite() providerResources["genesyscloud_idp_okta"] = idpOkta.ResourceIdpOkta() - providerResources["genesyscloud_idp_onelogin"] = gcloud.ResourceIdpOnelogin() - providerResources["genesyscloud_idp_ping"] = gcloud.ResourceIdpPing() + providerResources["genesyscloud_idp_onelogin"] = idpOneLogin.ResourceIdpOnelogin() + providerResources["genesyscloud_idp_ping"] = idpPing.ResourceIdpPing() providerResources["genesyscloud_idp_salesforce"] = idpSalesforce.ResourceIdpSalesforce() providerResources["genesyscloud_integration"] = integration.ResourceIntegration() providerResources["genesyscloud_integration_action"] = integrationAction.ResourceIntegrationAction() @@ -221,11 +225,11 @@ func (r *registerTestInstance) registerTestExporters() { RegisterExporter("genesyscloud_group", group.GroupExporter()) RegisterExporter("genesyscloud_group_roles", groupRoles.GroupRolesExporter()) RegisterExporter("genesyscloud_idp_adfs", idpAdfs.IdpAdfsExporter()) - RegisterExporter("genesyscloud_idp_generic", gcloud.IdpGenericExporter()) - RegisterExporter("genesyscloud_idp_gsuite", gcloud.IdpGsuiteExporter()) + RegisterExporter("genesyscloud_idp_generic", idpGeneric.IdpGenericExporter()) + RegisterExporter("genesyscloud_idp_gsuite", idpGsuite.IdpGsuiteExporter()) RegisterExporter("genesyscloud_idp_okta", idpOkta.IdpOktaExporter()) - RegisterExporter("genesyscloud_idp_onelogin", gcloud.IdpOneloginExporter()) - RegisterExporter("genesyscloud_idp_ping", gcloud.IdpPingExporter()) + RegisterExporter("genesyscloud_idp_onelogin", idpOneLogin.IdpOneloginExporter()) + RegisterExporter("genesyscloud_idp_ping", idpPing.IdpPingExporter()) RegisterExporter("genesyscloud_idp_salesforce", idpSalesforce.IdpSalesforceExporter()) RegisterExporter("genesyscloud_integration", integration.IntegrationExporter()) RegisterExporter("genesyscloud_integration_action", integrationAction.IntegrationActionExporter()) diff --git a/genesyscloud/user_roles/genesyscloud_user_roles_proxy.go b/genesyscloud/user_roles/genesyscloud_user_roles_proxy.go index 348ca624b..2ed1c9ea0 100644 --- a/genesyscloud/user_roles/genesyscloud_user_roles_proxy.go +++ b/genesyscloud/user_roles/genesyscloud_user_roles_proxy.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *userRolesProxy diff --git a/genesyscloud/user_roles/resource_genesyscloud_user_roles_utils.go b/genesyscloud/user_roles/resource_genesyscloud_user_roles_utils.go index 9f58a8e8a..aa50ef59a 100644 --- a/genesyscloud/user_roles/resource_genesyscloud_user_roles_utils.go +++ b/genesyscloud/user_roles/resource_genesyscloud_user_roles_utils.go @@ -7,7 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func flattenSubjectRoles(d *schema.ResourceData, p *userRolesProxy) (*schema.Set, *platformclientv2.APIResponse, error) { diff --git a/genesyscloud/util/resourcedata/resourcedata.go b/genesyscloud/util/resourcedata/resourcedata.go index 066abcfc9..37e647084 100644 --- a/genesyscloud/util/resourcedata/resourcedata.go +++ b/genesyscloud/util/resourcedata/resourcedata.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/leekchan/timeutil" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) const ( diff --git a/genesyscloud/util/util_basesetting_properties.go b/genesyscloud/util/util_basesetting_properties.go index 44c0ea6de..8e169e43c 100644 --- a/genesyscloud/util/util_basesetting_properties.go +++ b/genesyscloud/util/util_basesetting_properties.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func BuildTelephonyProperties(d *schema.ResourceData) *map[string]interface{} { diff --git a/genesyscloud/util/util_diagnostic_unit_test.go b/genesyscloud/util/util_diagnostic_unit_test.go index ec9fb4b9f..f5e930874 100644 --- a/genesyscloud/util/util_diagnostic_unit_test.go +++ b/genesyscloud/util/util_diagnostic_unit_test.go @@ -2,12 +2,13 @@ package util import ( "encoding/json" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" - "github.com/stretchr/testify/assert" "net/http" "net/url" "strings" "testing" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" + "github.com/stretchr/testify/assert" ) func TestUnitTestAPIResponseDiagWithGoodApiResponse(t *testing.T) { diff --git a/genesyscloud/util/util_diagnostics.go b/genesyscloud/util/util_diagnostics.go index 7a707a3f0..f0de6a808 100644 --- a/genesyscloud/util/util_diagnostics.go +++ b/genesyscloud/util/util_diagnostics.go @@ -4,8 +4,9 @@ import ( "encoding/json" "errors" "fmt" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type detailedDiagnosticInfo struct { diff --git a/genesyscloud/util/util_divisions.go b/genesyscloud/util/util_divisions.go index 91f269645..0cf72dcf9 100644 --- a/genesyscloud/util/util_divisions.go +++ b/genesyscloud/util/util_divisions.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type JsonMap map[string]interface{} diff --git a/genesyscloud/util/util_domainentities.go b/genesyscloud/util/util_domainentities.go index a72921b5b..08c6b05e6 100644 --- a/genesyscloud/util/util_domainentities.go +++ b/genesyscloud/util/util_domainentities.go @@ -4,7 +4,7 @@ import ( lists "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func BuildSdkDomainEntityRef(d *schema.ResourceData, idAttr string) *platformclientv2.Domainentityref { diff --git a/genesyscloud/util/util_retries.go b/genesyscloud/util/util_retries.go index 8c819c434..038eb302f 100644 --- a/genesyscloud/util/util_retries.go +++ b/genesyscloud/util/util_retries.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func WithRetries(ctx context.Context, timeout time.Duration, method func() *retry.RetryError) diag.Diagnostics { diff --git a/genesyscloud/validators/validators.go b/genesyscloud/validators/validators.go index a375e6bd6..66f89f83a 100644 --- a/genesyscloud/validators/validators.go +++ b/genesyscloud/validators/validators.go @@ -264,3 +264,15 @@ func ValidateHexColor(color interface{}, _ cty.Path) diag.Diagnostics { } return diag.Errorf("Color %v is not a string", color) } + +// ValidateLanguageCode validates that a valid language code that Genesys Cloud supports is passed. +func ValidateLanguageCode(lang interface{}, _ cty.Path) diag.Diagnostics { + langCodeList := []string{"en-US", "en-UK", "en-AU", "en-CA", "en-HK", "en-IN", "en-IE", "en-NZ", "en-PH", "en-SG", "en-ZA", "de-DE", "de-AT", "de-CH", "es-AR", "es-CO", "es-MX", "es-US", "es-ES", "fr-FR", "fr-BE", "fr-CA", "fr-CH", "pt-BR", "pt-PT", "nl-NL", "nl-BE", "it-IT", "ca-ES", "tr-TR", "sv-SE", "fi-FI", "nb-NO", "da-DK", "ja-JP", "ar-AE", "zh-CN", "zh-TW", "zh-HK", "ko-KR", "pl-PL", "hi-IN", "th-TH", "hu-HU", "vi-VN", "uk-UA"} + if langCode, ok := lang.(string); ok { + if lists.ItemInSlice(langCode, langCodeList) { + return nil + } + return diag.Errorf("Language code %s not found in language code list %v", langCode, langCodeList) + } + return diag.Errorf("Language code %v is not a string", lang) +} diff --git a/genesyscloud/webdeployments_configuration/genesyscloud_webdeployments_configuration_proxy.go b/genesyscloud/webdeployments_configuration/genesyscloud_webdeployments_configuration_proxy.go index ea0671576..15094c1b3 100644 --- a/genesyscloud/webdeployments_configuration/genesyscloud_webdeployments_configuration_proxy.go +++ b/genesyscloud/webdeployments_configuration/genesyscloud_webdeployments_configuration_proxy.go @@ -9,7 +9,7 @@ import ( "time" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *webDeploymentsConfigurationProxy diff --git a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration.go b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration.go index ea88bc60a..c6155b6d1 100644 --- a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration.go +++ b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllWebDeploymentConfigurations(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_schema.go b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_schema.go index 8cb13177c..22d1939be 100644 --- a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_schema.go +++ b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_schema.go @@ -356,6 +356,26 @@ var ( Optional: true, Elem: &schema.Schema{Type: schema.TypeString}, }, + "pause_criteria": { + Description: "Pause criteria that will pause cobrowse if some of them are met in the user's URL", + Type: schema.TypeList, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "url_fragment": { + Description: "A string representing a part of the URL that, when matched according to the specified condition, will trigger a pause in the cobrowse session", + Type: schema.TypeString, + Required: true, + }, + "condition": { + Description: "The condition to be applied to the `url_fragment`. Conditions are 'includes', 'does_not_include', 'starts_with', 'ends_with', 'equals'", + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice([]string{"includes", "does_not_include", "starts_with", "ends_with", "equals"}, false), + }, + }, + }, + }, }, } diff --git a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_test.go b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_test.go index 59984641e..8e4abe831 100644 --- a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_test.go +++ b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) type scCustomMessageConfig struct { @@ -187,6 +187,8 @@ func TestAccResourceWebDeploymentsConfigurationComplex(t *testing.T) { channels, []string{strconv.Quote("selector-one")}, []string{strconv.Quote("selector-one")}, + generatePauseCriteria("/sensitive", "includes"), + generatePauseCriteria("/login", "equals"), ), ), Check: resource.ComposeTestCheckFunc( @@ -257,6 +259,11 @@ func TestAccResourceWebDeploymentsConfigurationComplex(t *testing.T) { resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.mask_selectors.0", "selector-one"), resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.readonly_selectors.#", "1"), resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.readonly_selectors.0", "selector-one"), + resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.pause_criteria.#", "2"), + resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.pause_criteria.0.url_fragment", "/sensitive"), + resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.pause_criteria.0.condition", "includes"), + resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.pause_criteria.1.url_fragment", "/login"), + resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.pause_criteria.1.condition", "equals"), resource.TestCheckResourceAttr(fullResourceName, "journey_events.#", "1"), resource.TestCheckResourceAttr(fullResourceName, "journey_events.0.enabled", util.TrueValue), @@ -312,6 +319,8 @@ func TestAccResourceWebDeploymentsConfigurationComplex(t *testing.T) { channelsUpdate, []string{strconv.Quote("selector-one"), strconv.Quote("selector-two")}, []string{strconv.Quote("selector-one"), strconv.Quote("selector-two")}, + generatePauseCriteria("/sensitive", "includes"), + generatePauseCriteria("/login", "equals"), ), ), Check: resource.ComposeTestCheckFunc( @@ -345,6 +354,11 @@ func TestAccResourceWebDeploymentsConfigurationComplex(t *testing.T) { resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.readonly_selectors.#", "2"), util.ValidateStringInArray(fullResourceName, "cobrowse.0.readonly_selectors", "selector-one"), util.ValidateStringInArray(fullResourceName, "cobrowse.0.readonly_selectors", "selector-two"), + resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.pause_criteria.#", "2"), + resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.pause_criteria.0.url_fragment", "/sensitive"), + resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.pause_criteria.0.condition", "includes"), + resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.pause_criteria.1.url_fragment", "/login"), + resource.TestCheckResourceAttr(fullResourceName, "cobrowse.0.pause_criteria.1.condition", "equals"), resource.TestCheckResourceAttr(fullResourceName, "journey_events.#", "1"), resource.TestCheckResourceAttr(fullResourceName, "journey_events.0.enabled", util.TrueValue), resource.TestCheckResourceAttr(fullResourceName, "journey_events.0.excluded_query_parameters.#", "1"), @@ -1034,7 +1048,8 @@ func complexConfigurationResource(name, description, kbId string, nestedBlocks . `, name, description, kbId, strings.Join(nestedBlocks, "\n")) } -func generateWebDeploymentConfigCobrowseSettings(cbEnabled, cbAllowAgentControl string, cbAllowAgentNavigation string, cbChannels []string, cbMaskSelectors []string, cbReadonlySelectors []string) string { +func generateWebDeploymentConfigCobrowseSettings(cbEnabled, cbAllowAgentControl string, cbAllowAgentNavigation string, cbChannels []string, cbMaskSelectors []string, cbReadonlySelectors []string, pauseCriteriaBlocks ...string,) string { + return fmt.Sprintf(` cobrowse { enabled = %s @@ -1043,8 +1058,16 @@ func generateWebDeploymentConfigCobrowseSettings(cbEnabled, cbAllowAgentControl channels = [ %s ] mask_selectors = [ %s ] readonly_selectors = [ %s ] + %s } -`, cbEnabled, cbAllowAgentControl, cbAllowAgentNavigation, strings.Join(cbChannels, ", "), strings.Join(cbMaskSelectors, ", "), strings.Join(cbReadonlySelectors, ", ")) +`, cbEnabled, cbAllowAgentControl, cbAllowAgentNavigation, strings.Join(cbChannels, ", "), strings.Join(cbMaskSelectors, ", "), strings.Join(cbReadonlySelectors, ", "), strings.Join(pauseCriteriaBlocks, "\n")) +} + +func generatePauseCriteria(urlFragment, condition string) string { + return fmt.Sprintf(`pause_criteria { + url_fragment = "%s" + condition = "%s" +}`, urlFragment, condition) } func generateSupportCenterSettings(supportCenter scConfig) string { diff --git a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_journey.go b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_journey.go index 09edc3979..5eca98263 100644 --- a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_journey.go +++ b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_journey.go @@ -4,7 +4,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/lists" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func buildSelectorEventTriggers(triggers []interface{}) *[]platformclientv2.Selectoreventtrigger { diff --git a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_messenger.go b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_messenger.go index e12d1ae40..7ef740fc6 100644 --- a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_messenger.go +++ b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_messenger.go @@ -1,9 +1,10 @@ package webdeployments_configuration_utils import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" "terraform-provider-genesyscloud/genesyscloud/util/lists" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func buildAppConversations(conversations []interface{}) *platformclientv2.Conversationappsettings { diff --git a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_support_center.go b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_support_center.go index f29d7605d..635fe2fbf 100644 --- a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_support_center.go +++ b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_support_center.go @@ -4,7 +4,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func buildSupportCenterHeroStyle(styles []interface{}) *platformclientv2.Supportcenterherostyle { diff --git a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_utils.go b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_utils.go index b12770c46..2d304c293 100644 --- a/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_utils.go +++ b/genesyscloud/webdeployments_configuration/utils/resource_genesyscloud_webdeployments_configuration_utils.go @@ -7,7 +7,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func buildCobrowseSettings(d *schema.ResourceData) *platformclientv2.Cobrowsesettings { @@ -30,6 +30,20 @@ func buildCobrowseSettings(d *schema.ResourceData) *platformclientv2.Cobrowseset maskSelectors := lists.InterfaceListToStrings(cfg["mask_selectors"].([]interface{})) readonlySelectors := lists.InterfaceListToStrings(cfg["readonly_selectors"].([]interface{})) + var pauseCriteria []platformclientv2.Pausecriteria + if v, ok := cfg["pause_criteria"]; ok { + for _, pc := range v.([]interface{}) { + pcMap := pc.(map[string]interface{}) + urlFragment := pcMap["url_fragment"].(string) + condition := pcMap["condition"].(string) + pauseCriteria = append(pauseCriteria, platformclientv2.Pausecriteria{ + UrlFragment: &urlFragment, + Condition: &condition, + }) + } + } + + return &platformclientv2.Cobrowsesettings{ Enabled: &enabled, AllowAgentControl: &allowAgentControl, @@ -37,6 +51,7 @@ func buildCobrowseSettings(d *schema.ResourceData) *platformclientv2.Cobrowseset Channels: &channels, MaskSelectors: &maskSelectors, ReadonlySelectors: &readonlySelectors, + PauseCriteria: &pauseCriteria, } } diff --git a/genesyscloud/webdeployments_deployment/genesyscloud_webdeployments_deployment_proxy.go b/genesyscloud/webdeployments_deployment/genesyscloud_webdeployments_deployment_proxy.go index 5dfb49182..52a06d5cc 100644 --- a/genesyscloud/webdeployments_deployment/genesyscloud_webdeployments_deployment_proxy.go +++ b/genesyscloud/webdeployments_deployment/genesyscloud_webdeployments_deployment_proxy.go @@ -3,14 +3,15 @@ package webdeployments_deployment import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "log" "strconv" "terraform-provider-genesyscloud/genesyscloud/util" "time" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) var internalProxy *webDeploymentsProxy diff --git a/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment.go b/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment.go index d8ce2bff2..d3eacdd4c 100644 --- a/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment.go +++ b/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func getAllWebDeployments(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { diff --git a/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_test.go b/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_test.go index 0f223d80d..6582e2602 100644 --- a/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_test.go +++ b/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_test.go @@ -13,7 +13,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceWebDeploymentsDeployment(t *testing.T) { diff --git a/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_utils.go b/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_utils.go index 358560e1e..964adbcf1 100644 --- a/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_utils.go +++ b/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_utils.go @@ -4,7 +4,7 @@ import ( "errors" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v131/platformclientv2" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func alwaysDifferent(k, old, new string, d *schema.ResourceData) bool { diff --git a/go.mod b/go.mod index 641f4f37c..debecdddd 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 github.com/leekchan/timeutil v0.0.0-20150802142658-28917288c48d github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 - github.com/mypurecloud/platform-client-sdk-go/v131 v131.0.0 + github.com/mypurecloud/platform-client-sdk-go/v133 v133.0.0 github.com/nyaruka/phonenumbers v1.3.6 github.com/rjNemo/underscore v0.6.1 github.com/zclconf/go-cty v1.14.4 @@ -94,10 +94,10 @@ require ( github.com/subosito/gotenv v1.2.0 // indirect github.com/tidwall/pretty v1.2.0 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect - golang.org/x/crypto v0.24.0 // indirect + golang.org/x/crypto v0.25.0 // indirect golang.org/x/mod v0.17.0 // indirect - golang.org/x/net v0.26.0 - golang.org/x/sys v0.21.0 // indirect + golang.org/x/net v0.27.0 + golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/grpc v1.63.2 // indirect diff --git a/go.sum b/go.sum index ed2d47cac..7f2f226e0 100644 --- a/go.sum +++ b/go.sum @@ -257,8 +257,8 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mypurecloud/platform-client-sdk-go/v131 v131.0.0 h1:2YkBK/2pSoaehuSTqhFDXb806nxmHIrz7RxKsQSqM/0= -github.com/mypurecloud/platform-client-sdk-go/v131 v131.0.0/go.mod h1:pWn1ub6TxkdOiI1mgZED+fICo/JiqujY4h+wfgYbOi4= +github.com/mypurecloud/platform-client-sdk-go/v133 v133.0.0 h1:QXLhk65lm4ObgEZLm49bJauEtigMLV/Xo61wF3t3eDE= +github.com/mypurecloud/platform-client-sdk-go/v133 v133.0.0/go.mod h1:xzHvr5pv/axk+ieUu4gpvZEvMcqFTFcR53IzPxz55OU= github.com/nyaruka/phonenumbers v1.3.6 h1:33owXWp4d1U+Tyaj9fpci6PbvaQZcXBUO2FybeKeLwQ= github.com/nyaruka/phonenumbers v1.3.6/go.mod h1:Ut+eFwikULbmCenH6InMKL9csUNLyxHuBLyfkpum11s= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= @@ -362,8 +362,8 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= +golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -404,8 +404,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -442,8 +442,8 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= diff --git a/main.go b/main.go index 01df3ea64..ad44a2841 100644 --- a/main.go +++ b/main.go @@ -24,7 +24,11 @@ import ( "terraform-provider-genesyscloud/genesyscloud/group" groupRoles "terraform-provider-genesyscloud/genesyscloud/group_roles" idpAdfs "terraform-provider-genesyscloud/genesyscloud/idp_adfs" + idpGeneric "terraform-provider-genesyscloud/genesyscloud/idp_generic" + idpGsuite "terraform-provider-genesyscloud/genesyscloud/idp_gsuite" idpOkta "terraform-provider-genesyscloud/genesyscloud/idp_okta" + idpOneLogin "terraform-provider-genesyscloud/genesyscloud/idp_onelogin" + idpPing "terraform-provider-genesyscloud/genesyscloud/idp_ping" idpSalesforce "terraform-provider-genesyscloud/genesyscloud/idp_salesforce" "terraform-provider-genesyscloud/genesyscloud/integration" integrationAction "terraform-provider-genesyscloud/genesyscloud/integration_action" @@ -191,6 +195,10 @@ func registerResources() { idpAdfs.SetRegistrar(regInstance) //Registering idp adfs idpSalesforce.SetRegistrar(regInstance) //Registering idp salesforce idpOkta.SetRegistrar(regInstance) //Registering idp okta + idpOneLogin.SetRegistrar(regInstance) //Registering idp onelogin + idpGeneric.SetRegistrar(regInstance) //Registering idp generic + idpPing.SetRegistrar(regInstance) //Registering idp ping + idpGsuite.SetRegistrar(regInstance) //Registering idp gsuite integration.SetRegistrar(regInstance) //Registering integrations integrationCustomAuth.SetRegistrar(regInstance) //Registering integrations custom auth actions integrationAction.SetRegistrar(regInstance) //Registering integrations actions From 462e33dce135861af628ac328cc1d3063205fef4 Mon Sep 17 00:00:00 2001 From: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Date: Mon, 15 Jul 2024 13:00:14 +0100 Subject: [PATCH 52/62] Bug/devtooling-606 Export Managed sites as data sources (#1142) * Managed sites automatically data * Removed managed attribute and data source lookup checks both managed and unmanaged resources * More generic implementation for future resource use * Fixing conflicts * Fixing test * removing redundant code * Made requested changes * Use sanitizeName instead of strings.replaceAll * Made requested changes * Created Test Case * Made requested Changes --- .../telephony_providers_edges_site.md | 4 - .../resource_exporter/resource_exporter.go | 20 ++++ ...syscloud_telephony_providers_edges_site.go | 3 +- ...oud_telephony_providers_edges_site_test.go | 9 +- ...ud_telephony_providers_edges_site_proxy.go | 35 ++++--- ...syscloud_telephony_providers_edges_site.go | 7 +- ...d_telephony_providers_edges_site_schema.go | 6 -- ...oud_telephony_providers_edges_site_test.go | 2 +- ...ud_telephony_providers_edges_site_utils.go | 17 ++++ .../genesyscloud_resource_exporter.go | 8 +- .../resource_genesyscloud_tf_export_test.go | 91 +++++++++++++++++++ .../tfexporter/tf_exporter_resource_test.go | 1 + 12 files changed, 169 insertions(+), 34 deletions(-) diff --git a/docs/data-sources/telephony_providers_edges_site.md b/docs/data-sources/telephony_providers_edges_site.md index 0f4612dc6..635ca22d5 100644 --- a/docs/data-sources/telephony_providers_edges_site.md +++ b/docs/data-sources/telephony_providers_edges_site.md @@ -25,10 +25,6 @@ data "genesyscloud_telephony_providers_edges_site" "site" { - `name` (String) Site name. -### Optional - -- `managed` (Boolean) Return entities that are managed by Genesys Cloud. Defaults to `false`. - ### Read-Only - `id` (String) The ID of this resource. diff --git a/genesyscloud/resource_exporter/resource_exporter.go b/genesyscloud/resource_exporter/resource_exporter.go index 33c97cf31..5067a8225 100644 --- a/genesyscloud/resource_exporter/resource_exporter.go +++ b/genesyscloud/resource_exporter/resource_exporter.go @@ -6,6 +6,7 @@ import ( "strings" "sync" + "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -304,3 +305,22 @@ func SetRegisterExporter(resources map[string]*ResourceExporter) { defer resourceExporterMapMutex.Unlock() resourceExporters = resources } + +var ( + ExportAsData []string + dsMutex sync.Mutex + resourceNameSanitizer = NewSanitizerProvider() +) + +// The AddDataSourceItems function adds resources to the ExportAsData []string and are formatted correctly +// The ExportAsData will be checked in the genesyscloud_resource_exporter to determine resources to be exported as data source +func AddDataSourceItems(resourceName, itemName string) { + exportName := resourceName + "::" + resourceNameSanitizer.S.SanitizeResourceName(itemName) + addDataSourceItemstoExport(exportName) +} + +func addDataSourceItemstoExport(name string) { + dsMutex.Lock() + defer dsMutex.Unlock() + ExportAsData = append(ExportAsData, name) +} diff --git a/genesyscloud/telephony_providers_edges_site/data_source_genesyscloud_telephony_providers_edges_site.go b/genesyscloud/telephony_providers_edges_site/data_source_genesyscloud_telephony_providers_edges_site.go index ff8114fee..95a677573 100644 --- a/genesyscloud/telephony_providers_edges_site/data_source_genesyscloud_telephony_providers_edges_site.go +++ b/genesyscloud/telephony_providers_edges_site/data_source_genesyscloud_telephony_providers_edges_site.go @@ -18,10 +18,9 @@ func dataSourceSiteRead(ctx context.Context, d *schema.ResourceData, m interface sp := GetSiteProxy(sdkConfig) name := d.Get("name").(string) - managed := d.Get("managed").(bool) return util.WithRetries(ctx, 15*time.Second, func() *retry.RetryError { - siteId, retryable, resp, err := sp.getSiteIdByName(ctx, name, managed) + siteId, retryable, resp, err := sp.getSiteIdByName(ctx, name) if err != nil { if retryable { return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("failed to get site %s", name), resp)) diff --git a/genesyscloud/telephony_providers_edges_site/data_source_genesyscloud_telephony_providers_edges_site_test.go b/genesyscloud/telephony_providers_edges_site/data_source_genesyscloud_telephony_providers_edges_site_test.go index de32d841f..6db8871a1 100644 --- a/genesyscloud/telephony_providers_edges_site/data_source_genesyscloud_telephony_providers_edges_site_test.go +++ b/genesyscloud/telephony_providers_edges_site/data_source_genesyscloud_telephony_providers_edges_site_test.go @@ -67,8 +67,7 @@ func TestAccDataSourceSite(t *testing.T) { strconv.Quote("Wilco plumbing")) + location + generateSiteDataSource( siteDataRes, name, - "genesyscloud_telephony_providers_edges_site."+siteRes, - false), + "genesyscloud_telephony_providers_edges_site."+siteRes), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair("data.genesyscloud_telephony_providers_edges_site."+siteDataRes, "id", "genesyscloud_telephony_providers_edges_site."+siteRes, "id"), ), @@ -101,7 +100,6 @@ func TestAccDataSourceSiteManaged(t *testing.T) { siteDataRes, name, "", - true, ), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("data.genesyscloud_telephony_providers_edges_site."+siteDataRes, "id", siteId), @@ -117,13 +115,12 @@ func generateSiteDataSource( // Must explicitly use depends_on in terraform v0.13 when a data source references a resource // Fixed in v0.14 https://github.com/hashicorp/terraform/pull/26284 dependsOnResource string, - managed bool) string { +) string { return fmt.Sprintf(`data "genesyscloud_telephony_providers_edges_site" "%s" { name = "%s" - managed = %t depends_on=[%s] } - `, resourceID, name, managed, dependsOnResource) + `, resourceID, name, dependsOnResource) } func getSiteIdByName(name string) (string, error) { diff --git a/genesyscloud/telephony_providers_edges_site/genesyscloud_telephony_providers_edges_site_proxy.go b/genesyscloud/telephony_providers_edges_site/genesyscloud_telephony_providers_edges_site_proxy.go index 12ec0e4d8..7e7a448d2 100644 --- a/genesyscloud/telephony_providers_edges_site/genesyscloud_telephony_providers_edges_site_proxy.go +++ b/genesyscloud/telephony_providers_edges_site/genesyscloud_telephony_providers_edges_site_proxy.go @@ -6,6 +6,7 @@ import ( rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" + ) /* @@ -37,7 +38,7 @@ type getAllSitesFunc func(ctx context.Context, p *SiteProxy, managed bool) (*[]p type createSiteFunc func(ctx context.Context, p *SiteProxy, site *platformclientv2.Site) (*platformclientv2.Site, *platformclientv2.APIResponse, error) type deleteSiteFunc func(ctx context.Context, p *SiteProxy, siteId string) (*platformclientv2.APIResponse, error) type getSiteByIdFunc func(ctx context.Context, p *SiteProxy, siteId string) (site *platformclientv2.Site, resp *platformclientv2.APIResponse, err error) -type getSiteIdByNameFunc func(ctx context.Context, p *SiteProxy, siteName string, managed bool) (siteId string, retryable bool, resp *platformclientv2.APIResponse, err error) +type getSiteIdByNameFunc func(ctx context.Context, p *SiteProxy, siteName string) (siteId string, retryable bool, resp *platformclientv2.APIResponse, err error) type updateSiteFunc func(ctx context.Context, p *SiteProxy, siteId string, site *platformclientv2.Site) (*platformclientv2.Site, *platformclientv2.APIResponse, error) type createSiteOutboundRouteFunc func(ctx context.Context, p *SiteProxy, siteId string, outboundRoute *platformclientv2.Outboundroutebase) (*platformclientv2.Outboundroutebase, *platformclientv2.APIResponse, error) @@ -157,8 +158,8 @@ func (p *SiteProxy) getSiteById(ctx context.Context, siteId string) (site *platf } // getSiteIdByNameFunc returns a single Genesys Cloud Site by Name -func (p *SiteProxy) getSiteIdByName(ctx context.Context, siteName string, managed bool) (siteId string, retryable bool, resp *platformclientv2.APIResponse, err error) { - return p.getSiteIdByNameAttr(ctx, p, siteName, managed) +func (p *SiteProxy) getSiteIdByName(ctx context.Context, siteName string) (siteId string, retryable bool, resp *platformclientv2.APIResponse, err error) { + return p.getSiteIdByNameAttr(ctx, p, siteName) } // updateSiteFunc updates a Genesys Cloud Site @@ -321,20 +322,32 @@ func getSiteByIdFn(ctx context.Context, p *SiteProxy, siteId string) (*platformc } // getSiteIdByNameFn is an implementation function for retrieving a Genesys Cloud Site by name -func getSiteIdByNameFn(ctx context.Context, p *SiteProxy, siteName string, managed bool) (string, bool, *platformclientv2.APIResponse, error) { - sites, resp, err := getAllSitesFn(ctx, p, managed) +func getSiteIdByNameFn(ctx context.Context, p *SiteProxy, siteName string) (string, bool, *platformclientv2.APIResponse, error) { + managed, resp, err := getAllSitesFn(ctx, p, true) if err != nil { return "", false, resp, err } - if sites == nil || len(*sites) == 0 { - return "", true, resp, fmt.Errorf("no sites found with name %s", siteName) - } - for _, site := range *sites { - if (site.Name != nil && *site.Name == siteName) && (site.State != nil && *site.State != "deleted") { - return *site.Id, false, resp, nil + + if managed != nil { + for _, site := range *managed { + if (site.Name != nil && *site.Name == siteName) && (site.State != nil && *site.State != "deleted") { + return *site.Id, false, resp, nil + } } } + unmanaged, resp, err := getAllSitesFn(ctx, p, false) + if err != nil { + return "", false, resp, err + } + + if unmanaged != nil { + for _, site := range *unmanaged { + if (site.Name != nil && *site.Name == siteName) && (site.State != nil && *site.State != "deleted") { + return *site.Id, false, resp, nil + } + } + } return "", true, resp, fmt.Errorf("no sites found with name %s", siteName) } diff --git a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site.go b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site.go index 23208cad9..483bd87da 100644 --- a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site.go +++ b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site.go @@ -5,6 +5,7 @@ import ( "fmt" "log" "terraform-provider-genesyscloud/genesyscloud/provider" + "terraform-provider-genesyscloud/genesyscloud/tfexporter_state" "terraform-provider-genesyscloud/genesyscloud/util" "terraform-provider-genesyscloud/genesyscloud/util/constants" featureToggles "terraform-provider-genesyscloud/genesyscloud/util/feature_toggles" @@ -43,8 +44,12 @@ func getAllSites(ctx context.Context, sdkConfig *platformclientv2.Configuration) } for _, managedSite := range *managedSites { resources[*managedSite.Id] = &resourceExporter.ResourceMeta{Name: *managedSite.Name} + // When exporting managed sites, they must automatically be exported as data source + // Managed sites are added to the ExportAsData []string in resource_exporter + if tfexporter_state.IsExporterActive() { + resourceExporter.AddDataSourceItems(resourceName, *managedSite.Name) + } } - return resources, nil } diff --git a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_schema.go b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_schema.go index 55b4e51b1..7587c3427 100644 --- a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_schema.go +++ b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_schema.go @@ -304,12 +304,6 @@ func DataSourceSite() *schema.Resource { Type: schema.TypeString, Required: true, }, - "managed": { - Description: "Return entities that are managed by Genesys Cloud.", - Type: schema.TypeBool, - Optional: true, - Default: false, - }, }, } } diff --git a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_test.go b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_test.go index e44edd2d8..c571840b5 100644 --- a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_test.go +++ b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_test.go @@ -2,8 +2,8 @@ package telephony_providers_edges_site import ( "fmt" - "log" "os" + "log" "strconv" "strings" "terraform-provider-genesyscloud/genesyscloud/provider" diff --git a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_utils.go b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_utils.go index 2fbbae030..77a1b5193 100644 --- a/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_utils.go +++ b/genesyscloud/telephony_providers_edges_site/resource_genesyscloud_telephony_providers_edges_site_utils.go @@ -535,6 +535,23 @@ func GenerateSiteResourceWithCustomAttrs( `, siteRes, name, description, locationId, mediaModel, mediaRegionsUseLatencyBased, mediaRegions, callerId, callerName, strings.Join(otherAttrs, "\n")) } +func CheckForDefaultSite(siteName string) error { + var ( + sdk, _ = provider.AuthorizeSdk() + siteAPI = platformclientv2.NewTelephonyProvidersEdgeApiWithConfig(sdk) + pageSize = 100 + ) + + sites, _, getErr := siteAPI.GetTelephonyProvidersEdgesSites(pageSize, 1, "", "", siteName, "", true, []string{}) + if getErr != nil { + return getErr + } + if sites == nil { + return fmt.Errorf("no default site found with name %s", siteName) + } + return nil +} + // DeleteLocationWithNumber is a test utility function to delete site and location with the provided emergency number func DeleteLocationWithNumber(emergencyNumber string, config *platformclientv2.Configuration) error { var ( diff --git a/genesyscloud/tfexporter/genesyscloud_resource_exporter.go b/genesyscloud/tfexporter/genesyscloud_resource_exporter.go index c4bb43660..5aa960502 100644 --- a/genesyscloud/tfexporter/genesyscloud_resource_exporter.go +++ b/genesyscloud/tfexporter/genesyscloud_resource_exporter.go @@ -539,7 +539,6 @@ func (g *GenesysCloudResourceExporter) generateZipForExporter() diag.Diagnostics } func (g *GenesysCloudResourceExporter) buildAndExportDependsOnResourcesForFlows() diag.Diagnostics { - if g.addDependsOn { filterList, resources, err := g.processAndBuildDependencies() if err != nil { @@ -560,7 +559,6 @@ func (g *GenesysCloudResourceExporter) processAndBuildDependencies() (filters [] filterList := make([]string, 0) totalResources := make(resourceExporter.ResourceIDMetaMap) proxy := dependentconsumers.GetDependentConsumerProxy(nil) - retrieveDependentConsumers := func(resourceKeys resourceExporter.ResourceInfo) func(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, *resourceExporter.DependencyResource, diag.Diagnostics) { return func(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, *resourceExporter.DependencyResource, diag.Diagnostics) { proxy = dependentconsumers.GetDependentConsumerProxy(clientConfig) @@ -1605,7 +1603,11 @@ func (g *GenesysCloudResourceExporter) resourceIdExists(refID string, existingRe } func (g *GenesysCloudResourceExporter) isDataSource(resType string, name string) bool { - for _, element := range g.replaceWithDatasource { + return g.containsElement(resourceExporter.ExportAsData, resType, name) || g.containsElement(g.replaceWithDatasource, resType, name) +} + +func (g *GenesysCloudResourceExporter) containsElement(elements []string, resType, name string) bool { + for _, element := range elements { if element == resType+"::"+name || fetchByRegex(element, resType, name) { return true } diff --git a/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go b/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go index 98febed09..ed8973113 100644 --- a/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go +++ b/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go @@ -21,6 +21,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" + telephonyProvidersEdgesSite "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site" "terraform-provider-genesyscloud/genesyscloud/util" "testing" "time" @@ -1447,6 +1448,96 @@ func TestAccResourceTfExportSplitFilesAsHCL(t *testing.T) { }) } +// TestAccResourceExportManagedSitesAsData checks that during an export, managed sites are exported as data source +// Managed can't be set on sites, therefore the default managed site is checked during the test that it is exported as data +func TestAccResourceExportManagedSitesAsData(t *testing.T) { + var ( + exportTestDir = filepath.Join("..", "..", ".terraform"+uuid.NewString()) + resourceID = "export" + configPath = filepath.Join(exportTestDir, defaultTfJSONFile) + siteName = "PureCloud Voice - AWS" + ) + + if err := telephonyProvidersEdgesSite.CheckForDefaultSite(siteName); err != nil { + t.Skipf("failed to get default site %v", err) + } + + defer func(path string) { + if err := os.RemoveAll(path); err != nil { + t.Logf("failed to remove dir %s: %s", path, err) + } + }(exportTestDir) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { util.TestAccPreCheck(t) }, + ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + Steps: []resource.TestStep{ + { + Config: generateTfExportByIncludeFilterResources( + resourceID, + exportTestDir, + util.FalseValue, // include_state_file + []string{ // include_filter_resources + strconv.Quote("genesyscloud_telephony_providers_edges_site"), + }, + util.FalseValue, // export_as_hcl + util.FalseValue, + []string{}, + ), + Check: resource.ComposeTestCheckFunc( + validateExportManagedSitesAsData(configPath, siteName), + ), + }, + }, + }) +} + +// validateExportManagedSitesAsData verifies that the default managed site 'PureCloud Voice - AWS' is exported as a data source +func validateExportManagedSitesAsData(filename, siteName string) resource.TestCheckFunc { + return func(state *terraform.State) error { + // Check if the file exists + _, err := os.Stat(filename) + if err != nil { + return fmt.Errorf("failed to find file %s", filename) + } + + // Load the JSON content of the export file + log.Println("Loading export config into map variable") + exportData, err := loadJsonFileToMap(filename) + if err != nil { + return err + } + log.Println("Successfully loaded export config into map variable ") + + // Check if data sources exist in the exported data + if data, ok := exportData["data"].(map[string]interface{}); ok { + sites, ok := data["genesyscloud_telephony_providers_edges_site"].(map[string]interface{}) + if !ok { + return fmt.Errorf("no data sources exported for genesyscloud_telephony_providers_edges_site") + } + + log.Printf("checking that managed site with name %s is exported as data source", siteName) + + // Validate each site's name + for siteID, site := range sites { + siteAttributes, ok := site.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected structure for site %s", siteID) + } + + name, _ := siteAttributes["name"].(string) + if name == siteName { + log.Printf("Site %s with name '%s' is correctly exported as data source", siteID, siteName) + return nil + } + } + return fmt.Errorf("site with name '%s' was not exported as data source", siteName) + } else { + return fmt.Errorf("no data sources found in exported data") + } + } +} + // TestAccResourceTfExportCampaignScriptIdReferences exports two campaigns and ensures that the custom revolver OutboundCampaignAgentScriptResolver // is working properly i.e. script_id should reference a data source pointing to the Default Outbound Script under particular circumstances func TestAccResourceTfExportCampaignScriptIdReferences(t *testing.T) { diff --git a/genesyscloud/tfexporter/tf_exporter_resource_test.go b/genesyscloud/tfexporter/tf_exporter_resource_test.go index a0e4d44aa..a1f18facf 100644 --- a/genesyscloud/tfexporter/tf_exporter_resource_test.go +++ b/genesyscloud/tfexporter/tf_exporter_resource_test.go @@ -309,6 +309,7 @@ func (r *registerTestInstance) registerTestExporters() { func (r *registerTestInstance) registerTestDataSources() { providerDataSources["genesyscloud_auth_division_home"] = gcloud.DataSourceAuthDivisionHome() providerDataSources["genesyscloud_script"] = scripts.DataSourceScript() + providerDataSources["genesyscloud_telephony_providers_edges_site"] = edgeSite.DataSourceSite() } func RegisterExporter(exporterName string, resourceExporter *resourceExporter.ResourceExporter) { From d4d839a0bee5fcab1d306fc38d72ec13b1ad9023 Mon Sep 17 00:00:00 2001 From: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Date: Mon, 15 Jul 2024 13:22:00 +0100 Subject: [PATCH 53/62] Bug/devtooling 637: Conditional group routing rules (#1155) * Updated example CGR rules resource * removed unnecessary error in CGR rules resource and added log statements --- ...routing_queue_conditional_group_routing.md | 8 +++--- .../resource.tf | 8 +++--- ...g_queue_conditional_group_routing_proxy.go | 23 +++++++++++++---- ...routing_queue_conditional_group_routing.go | 25 +++++++++++-------- 4 files changed, 41 insertions(+), 23 deletions(-) diff --git a/docs/resources/routing_queue_conditional_group_routing.md b/docs/resources/routing_queue_conditional_group_routing.md index 2e563cf2a..29c2db333 100644 --- a/docs/resources/routing_queue_conditional_group_routing.md +++ b/docs/resources/routing_queue_conditional_group_routing.md @@ -28,8 +28,8 @@ resource "genesyscloud_routing_queue_conditional_group_routing" "example-name" { condition_value = 0 wait_seconds = 20 groups { - member_group_id = "" - member_group_type = "" + member_group_id = genesyscloud_group.example-group.id + member_group_type = "GROUP" } } rules { @@ -39,8 +39,8 @@ resource "genesyscloud_routing_queue_conditional_group_routing" "example-name" { condition_value = 5 wait_seconds = 15 groups { - member_group_id = "" - member_group_type = "" + member_group_id = genesyscloud_group.another-group.id + member_group_type = "GROUP" } } } diff --git a/examples/resources/genesyscloud_routing_queue_conditional_group_routing/resource.tf b/examples/resources/genesyscloud_routing_queue_conditional_group_routing/resource.tf index 7518db9d3..41e77cb73 100644 --- a/examples/resources/genesyscloud_routing_queue_conditional_group_routing/resource.tf +++ b/examples/resources/genesyscloud_routing_queue_conditional_group_routing/resource.tf @@ -9,8 +9,8 @@ resource "genesyscloud_routing_queue_conditional_group_routing" "example-name" { condition_value = 0 wait_seconds = 20 groups { - member_group_id = "" - member_group_type = "" + member_group_id = genesyscloud_group.example-group.id + member_group_type = "GROUP" } } rules { @@ -20,8 +20,8 @@ resource "genesyscloud_routing_queue_conditional_group_routing" "example-name" { condition_value = 5 wait_seconds = 15 groups { - member_group_id = "" - member_group_type = "" + member_group_id = genesyscloud_group.another-group.id + member_group_type = "GROUP" } } } \ No newline at end of file diff --git a/genesyscloud/routing_queue_conditional_group_routing/genesyscloud_routing_queue_conditional_group_routing_proxy.go b/genesyscloud/routing_queue_conditional_group_routing/genesyscloud_routing_queue_conditional_group_routing_proxy.go index c30bd06f0..7ae261a11 100644 --- a/genesyscloud/routing_queue_conditional_group_routing/genesyscloud_routing_queue_conditional_group_routing_proxy.go +++ b/genesyscloud/routing_queue_conditional_group_routing/genesyscloud_routing_queue_conditional_group_routing_proxy.go @@ -15,12 +15,14 @@ var internalProxy *routingQueueConditionalGroupRoutingProxy // Type definitions for each func on our proxy so we can easily mock them out later type getRoutingQueueConditionRoutingFunc func(ctx context.Context, p *routingQueueConditionalGroupRoutingProxy, queueId string) (*[]platformclientv2.Conditionalgrouproutingrule, *platformclientv2.APIResponse, error) type updateRoutingQueueConditionRoutingFunc func(ctx context.Context, p *routingQueueConditionalGroupRoutingProxy, queueId string, rules *[]platformclientv2.Conditionalgrouproutingrule) (*[]platformclientv2.Conditionalgrouproutingrule, *platformclientv2.APIResponse, error) +type getRoutingQueueByIdFunc func(ctx context.Context, p *routingQueueConditionalGroupRoutingProxy, id string) (*platformclientv2.Queue, *platformclientv2.APIResponse, error) -// routingQueueConditionalGroupRoutingProxy contains all of the methods that call genesys cloud APIs. +// routingQueueConditionalGroupRoutingProxy contains all methods that call genesys cloud APIs. type routingQueueConditionalGroupRoutingProxy struct { clientConfig *platformclientv2.Configuration routingApi *platformclientv2.RoutingApi getRoutingQueueConditionRoutingAttr getRoutingQueueConditionRoutingFunc + getRoutingQueueByIdAttr getRoutingQueueByIdFunc updateRoutingQueueConditionRoutingAttr updateRoutingQueueConditionRoutingFunc routingQueueProxy *routingQueue.RoutingQueueProxy } @@ -35,6 +37,7 @@ func newRoutingQueueConditionalGroupRoutingProxy(clientConfig *platformclientv2. routingApi: api, getRoutingQueueConditionRoutingAttr: getRoutingQueueConditionRoutingFn, updateRoutingQueueConditionRoutingAttr: updateRoutingQueueConditionRoutingFn, + getRoutingQueueByIdAttr: getRoutingQueueByIdFn, routingQueueProxy: routingQueueProxy, } } @@ -48,6 +51,11 @@ func getRoutingQueueConditionalGroupRoutingProxy(clientConfig *platformclientv2. return internalProxy } +// getRoutingQueueById get a queue by ID +func (p *routingQueueConditionalGroupRoutingProxy) getRoutingQueueById(ctx context.Context, id string) (*platformclientv2.Queue, *platformclientv2.APIResponse, error) { + return p.getRoutingQueueByIdAttr(ctx, p, id) +} + // getRoutingQueueConditionRouting gets the conditional group routing rules for a queue func (p *routingQueueConditionalGroupRoutingProxy) getRoutingQueueConditionRouting(ctx context.Context, queueId string) (*[]platformclientv2.Conditionalgrouproutingrule, *platformclientv2.APIResponse, error) { return p.getRoutingQueueConditionRoutingAttr(ctx, p, queueId) @@ -68,7 +76,7 @@ func getRoutingQueueConditionRoutingFn(ctx context.Context, p *routingQueueCondi queue = rc.GetCacheItem(p.routingQueueProxy.RoutingQueueCache, queueId) if queue == nil { - queue, resp, err = p.routingApi.GetRoutingQueue(queueId) + queue, resp, err = p.getRoutingQueueById(ctx, queueId) if err != nil { return nil, resp, fmt.Errorf("error when reading queue %s: %s", queueId, err) } @@ -78,13 +86,13 @@ func getRoutingQueueConditionRoutingFn(ctx context.Context, p *routingQueueCondi return queue.ConditionalGroupRouting.Rules, resp, nil } - return nil, resp, fmt.Errorf("no conditional group routing rules found for queue %s", queueId) + return nil, resp, nil } // updateRoutingQueueConditionRoutingFn is an implementation function for updating the conditional group routing rules for a queue func updateRoutingQueueConditionRoutingFn(ctx context.Context, p *routingQueueConditionalGroupRoutingProxy, queueId string, rules *[]platformclientv2.Conditionalgrouproutingrule) (*[]platformclientv2.Conditionalgrouproutingrule, *platformclientv2.APIResponse, error) { // Get the routing queue the rules belong to - queue, resp, err := p.routingApi.GetRoutingQueue(queueId) + queue, resp, err := p.getRoutingQueueById(ctx, queueId) if err != nil { return nil, resp, fmt.Errorf("error when reading queue %s: %s", queueId, err) } @@ -140,5 +148,10 @@ func updateRoutingQueueConditionRoutingFn(ctx context.Context, p *routingQueueCo return queue.ConditionalGroupRouting.Rules, resp, nil } - return nil, resp, fmt.Errorf("no conditional group routing rules found for queue %s", queueId) + return nil, resp, nil +} + +// getRoutingQueueByIdFn is an implementation function for getting a queue by ID +func getRoutingQueueByIdFn(_ context.Context, p *routingQueueConditionalGroupRoutingProxy, id string) (*platformclientv2.Queue, *platformclientv2.APIResponse, error) { + return p.routingApi.GetRoutingQueue(id) } diff --git a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing.go b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing.go index 3877f16fd..4046d93e4 100644 --- a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing.go +++ b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing.go @@ -70,8 +70,8 @@ func readRoutingQueueConditionalRoutingGroup(ctx context.Context, d *schema.Reso cc := consistencyChecker.NewConsistencyCheck(ctx, d, meta, ResourceRoutingQueueConditionalGroupRouting(), constants.DefaultConsistencyChecks, resourceName) queueId := strings.Split(d.Id(), "/")[0] - log.Printf("Reading routing queue %s conditional group routing rules", queueId) return util.WithRetriesForRead(ctx, d, func() *retry.RetryError { + log.Printf("Reading routing queue %s conditional group routing rules", queueId) sdkRules, resp, getErr := proxy.getRoutingQueueConditionRouting(ctx, queueId) if getErr != nil { if util.IsStatus404(resp) { @@ -79,6 +79,7 @@ func readRoutingQueueConditionalRoutingGroup(ctx context.Context, d *schema.Reso } return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("failed to read conditional group routing for queue %s | error: %s", queueId, getErr), resp)) } + log.Printf("Read routing queue %s conditional group routing rules", queueId) _ = d.Set("queue_id", queueId) _ = d.Set("rules", flattenConditionalGroupRouting(sdkRules)) @@ -101,7 +102,7 @@ func updateRoutingQueueConditionalRoutingGroup(ctx context.Context, d *schema.Re sdkRules, err := buildConditionalGroupRouting(rules) if err != nil { - return util.BuildDiagnosticError(resourceName, fmt.Sprintf("Error building conditional group routing"), err) + return util.BuildDiagnosticError(resourceName, "Error building conditional group routing", err) } log.Printf("updating conditional group routing rules for queue %s", queueId) @@ -123,29 +124,29 @@ func deleteRoutingQueueConditionalRoutingGroup(ctx context.Context, d *schema.Re log.Printf("Removing rules from queue %s", queueId) // check if routing queue still exists before trying to remove rules - _, resp, err := proxy.getRoutingQueueConditionRouting(ctx, queueId) - if err != nil { + log.Printf("Reading queue '%s' to verify it exists before trying to remove its CGR rules", queueId) + if _, resp, err := proxy.getRoutingQueueById(ctx, queueId); err != nil { if util.IsStatus404(resp) { log.Printf("conditional group routing rules parent queue %s already deleted", queueId) return nil } + log.Printf("Failed to read routing queue '%s': %v", queueId, err) } // To delete conditional group routing, update the queue with no rules + log.Printf("Updating routing queue '%s' to have no CGR rules", queueId) var newRules []platformclientv2.Conditionalgrouproutingrule - _, resp, err = proxy.updateRoutingQueueConditionRouting(ctx, queueId, &newRules) - if err != nil && !strings.Contains(err.Error(), "no conditional group routing rules found for queue") { - + if _, resp, err := proxy.updateRoutingQueueConditionRouting(ctx, queueId, &newRules); err != nil { return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("failed to remove rules from queue %s: %s", queueId, err), resp) } // Verify there are no rules - rules, resp, err := proxy.getRoutingQueueConditionRouting(ctx, queueId) - if rules != nil { + log.Printf("Reading queue '%s' CGR rules to verify that they have been removed", queueId) + if rules, resp, err := proxy.getRoutingQueueConditionRouting(ctx, queueId); rules != nil { return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("conditional group routing rules still exist for queue %s: %s", queueId, err), resp) } - log.Printf("Removed rules from queue %s", queueId) + log.Printf("Successfully removed rules from queue %s", queueId) return nil } @@ -194,6 +195,10 @@ func buildConditionalGroupRouting(rules []interface{}) ([]platformclientv2.Condi } func flattenConditionalGroupRouting(sdkRules *[]platformclientv2.Conditionalgrouproutingrule) []interface{} { + if sdkRules == nil { + return nil + } + var rules []interface{} for i, sdkRule := range *sdkRules { rule := make(map[string]interface{}) From 8bace1c36211dd696cbb4a8f226699d43805e0c1 Mon Sep 17 00:00:00 2001 From: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Date: Mon, 15 Jul 2024 13:26:24 +0100 Subject: [PATCH 54/62] refactor/DEVTOOLING-183: Refactored routing email domain (#1138) * Refactored routing email domain * Made requested changes --- ...ource_genesyscloud_routing_email_domain.go | 63 ----- ...d_recording_media_retention_policy_test.go | 3 +- ...ording_media_retention_policy_init_test.go | 3 +- ...d_recording_media_retention_policy_test.go | 9 +- genesyscloud/resource_genesyscloud_init.go | 3 - .../resource_genesyscloud_init_test.go | 5 +- ...ource_genesyscloud_routing_email_domain.go | 242 ------------------ ...ource_genesyscloud_routing_email_domain.go | 34 +++ ..._genesyscloud_routing_email_domain_test.go | 3 +- ...syscloud_routing_email_domain_init_test.go | 61 +++++ ...genesyscloud_routing_email_domain_proxy.go | 162 ++++++++++++ ...ource_genesyscloud_routing_email_domain.go | 176 +++++++++++++ ...enesyscloud_routing_email_domain_schema.go | 82 ++++++ ..._genesyscloud_routing_email_domain_test.go | 2 +- ...e_genesyscloud_routing_email_route_test.go | 4 +- ...esyscloud_routing_email_route_init_test.go | 4 +- ...e_genesyscloud_routing_email_route_test.go | 15 +- ..._queue_outbound_email_address_init_test.go | 5 +- ...uting_queue_outbound_email_address_test.go | 4 +- .../tfexporter/tf_exporter_resource_test.go | 5 +- main.go | 7 +- 21 files changed, 555 insertions(+), 337 deletions(-) delete mode 100644 genesyscloud/data_source_genesyscloud_routing_email_domain.go delete mode 100644 genesyscloud/resource_genesyscloud_routing_email_domain.go create mode 100644 genesyscloud/routing_email_domain/data_source_genesyscloud_routing_email_domain.go rename genesyscloud/{ => routing_email_domain}/data_source_genesyscloud_routing_email_domain_test.go (97%) create mode 100644 genesyscloud/routing_email_domain/genesyscloud_routing_email_domain_init_test.go create mode 100644 genesyscloud/routing_email_domain/genesyscloud_routing_email_domain_proxy.go create mode 100644 genesyscloud/routing_email_domain/resource_genesyscloud_routing_email_domain.go create mode 100644 genesyscloud/routing_email_domain/resource_genesyscloud_routing_email_domain_schema.go rename genesyscloud/{ => routing_email_domain}/resource_genesyscloud_routing_email_domain_test.go (99%) diff --git a/genesyscloud/data_source_genesyscloud_routing_email_domain.go b/genesyscloud/data_source_genesyscloud_routing_email_domain.go deleted file mode 100644 index dadf36ac9..000000000 --- a/genesyscloud/data_source_genesyscloud_routing_email_domain.go +++ /dev/null @@ -1,63 +0,0 @@ -package genesyscloud - -import ( - "context" - "fmt" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" -) - -// Returns the schema for the routing email domain -func DataSourceRoutingEmailDomain() *schema.Resource { - return &schema.Resource{ - Description: "Data source for Genesys Cloud Email Domains. Select an email domain by name", - ReadContext: provider.ReadWithPooledClient(DataSourceRoutingEmailDomainRead), - Schema: map[string]*schema.Schema{ - "name": { - Description: "Email domain name.", - Type: schema.TypeString, - Required: true, - }, - }, - } -} - -// Looks up the data for the Email Domain -func DataSourceRoutingEmailDomainRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - sdkConfig := m.(*provider.ProviderMeta).ClientConfig - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - - name := d.Get("name").(string) - - return util.WithRetries(ctx, 15*time.Second, func() *retry.RetryError { - for pageNum := 1; ; pageNum++ { - const pageSize = 100 - - domains, resp, getErr := routingAPI.GetRoutingEmailDomains(pageSize, pageNum, false, "") - - if getErr != nil { - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_email_domain", fmt.Sprintf("Error requesting email domain %s | error: %s", name, getErr), resp)) - } - - //// No record found, keep trying for X seconds as this might an eventual consistency problem - if domains.Entities == nil || len(*domains.Entities) == 0 { - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_email_domain", fmt.Sprintf("No email domains found with name %s", name), resp)) - } - - // Once I get a result, cycle through until we find a name that matches - for _, domain := range *domains.Entities { - if domain.Id != nil && *domain.Id == name { - d.SetId(*domain.Id) - return nil - } - } - } - }) -} diff --git a/genesyscloud/recording_media_retention_policy/data_source_genesyscloud_recording_media_retention_policy_test.go b/genesyscloud/recording_media_retention_policy/data_source_genesyscloud_recording_media_retention_policy_test.go index 99caa46b7..961f058bf 100644 --- a/genesyscloud/recording_media_retention_policy/data_source_genesyscloud_recording_media_retention_policy_test.go +++ b/genesyscloud/recording_media_retention_policy/data_source_genesyscloud_recording_media_retention_policy_test.go @@ -9,6 +9,7 @@ import ( authRole "terraform-provider-genesyscloud/genesyscloud/auth_role" "terraform-provider-genesyscloud/genesyscloud/provider" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" + routingEmailDomain "terraform-provider-genesyscloud/genesyscloud/routing_email_domain" userRoles "terraform-provider-genesyscloud/genesyscloud/user_roles" "terraform-provider-genesyscloud/genesyscloud/util" "testing" @@ -146,7 +147,7 @@ func TestAccDataSourceRecordingMediaRetentionPolicy(t *testing.T) { ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), Steps: []resource.TestStep{ { - Config: gcloud.GenerateRoutingEmailDomainResource( + Config: routingEmailDomain.GenerateRoutingEmailDomainResource( domainRes, domainId, util.FalseValue, // Subdomain diff --git a/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_init_test.go b/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_init_test.go index 21bafbcb0..903d045d6 100644 --- a/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_init_test.go +++ b/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_init_test.go @@ -10,6 +10,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" userRoles "terraform-provider-genesyscloud/genesyscloud/user_roles" + routingEmailDomain "terraform-provider-genesyscloud/genesyscloud/routing_email_domain" "testing" @@ -44,7 +45,7 @@ func (r *registerTestInstance) registerTestResources() { defer r.resourceMapMutex.Unlock() providerResources[resourceName] = ResourceMediaRetentionPolicy() - providerResources["genesyscloud_routing_email_domain"] = gcloud.ResourceRoutingEmailDomain() + providerResources["genesyscloud_routing_email_domain"] = routingEmailDomain.ResourceRoutingEmailDomain() providerResources["genesyscloud_routing_queue"] = routingQueue.ResourceRoutingQueue() providerResources["genesyscloud_auth_role"] = authRole.ResourceAuthRole() providerResources["genesyscloud_user_roles"] = userRoles.ResourceUserRoles() diff --git a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_test.go b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_test.go index 9b7bcc10a..8d38638ae 100644 --- a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_test.go +++ b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_test.go @@ -11,6 +11,7 @@ import ( authRole "terraform-provider-genesyscloud/genesyscloud/auth_role" "terraform-provider-genesyscloud/genesyscloud/provider" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" + routingEmailDomain "terraform-provider-genesyscloud/genesyscloud/routing_email_domain" userRoles "terraform-provider-genesyscloud/genesyscloud/user_roles" "terraform-provider-genesyscloud/genesyscloud/util" "testing" @@ -932,7 +933,7 @@ func TestAccResourceMediaRetentionPolicyBasic(t *testing.T) { ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), Steps: []resource.TestStep{ { - Config: gcloud.GenerateRoutingEmailDomainResource( + Config: routingEmailDomain.GenerateRoutingEmailDomainResource( domainRes, domainId, util.FalseValue, // Subdomain @@ -1039,7 +1040,7 @@ func TestAccResourceMediaRetentionPolicyBasic(t *testing.T) { }, { - Config: gcloud.GenerateRoutingEmailDomainResource( + Config: routingEmailDomain.GenerateRoutingEmailDomainResource( domainRes, domainId, util.FalseValue, // Subdomain @@ -1146,7 +1147,7 @@ func TestAccResourceMediaRetentionPolicyBasic(t *testing.T) { }, { - Config: gcloud.GenerateRoutingEmailDomainResource( + Config: routingEmailDomain.GenerateRoutingEmailDomainResource( domainRes, domainId, util.FalseValue, // Subdomain @@ -1253,7 +1254,7 @@ func TestAccResourceMediaRetentionPolicyBasic(t *testing.T) { }, { - Config: gcloud.GenerateRoutingEmailDomainResource( + Config: routingEmailDomain.GenerateRoutingEmailDomainResource( domainRes, domainId, util.FalseValue, // Subdomain diff --git a/genesyscloud/resource_genesyscloud_init.go b/genesyscloud/resource_genesyscloud_init.go index d2a1a248f..cec0f5e64 100644 --- a/genesyscloud/resource_genesyscloud_init.go +++ b/genesyscloud/resource_genesyscloud_init.go @@ -32,7 +32,6 @@ func registerDataSources(l registrar.Registrar) { l.RegisterDataSource("genesyscloud_routing_language", dataSourceRoutingLanguage()) l.RegisterDataSource("genesyscloud_routing_skill", dataSourceRoutingSkill()) l.RegisterDataSource("genesyscloud_routing_skill_group", dataSourceRoutingSkillGroup()) - l.RegisterDataSource("genesyscloud_routing_email_domain", DataSourceRoutingEmailDomain()) l.RegisterDataSource("genesyscloud_routing_wrapupcode", DataSourceRoutingWrapupcode()) l.RegisterDataSource("genesyscloud_user", DataSourceUser()) l.RegisterDataSource("genesyscloud_widget_deployment", dataSourceWidgetDeployments()) @@ -56,7 +55,6 @@ func registerResources(l registrar.Registrar) { l.RegisterResource("genesyscloud_location", ResourceLocation()) l.RegisterResource("genesyscloud_quality_forms_evaluation", ResourceEvaluationForm()) l.RegisterResource("genesyscloud_quality_forms_survey", ResourceSurveyForm()) - l.RegisterResource("genesyscloud_routing_email_domain", ResourceRoutingEmailDomain()) l.RegisterResource("genesyscloud_routing_language", ResourceRoutingLanguage()) l.RegisterResource("genesyscloud_routing_skill", ResourceRoutingSkill()) l.RegisterResource("genesyscloud_routing_skill_group", ResourceRoutingSkillGroup()) @@ -78,7 +76,6 @@ func registerExporters(l registrar.Registrar) { l.RegisterExporter("genesyscloud_location", LocationExporter()) l.RegisterExporter("genesyscloud_quality_forms_evaluation", EvaluationFormExporter()) l.RegisterExporter("genesyscloud_quality_forms_survey", SurveyFormExporter()) - l.RegisterExporter("genesyscloud_routing_email_domain", RoutingEmailDomainExporter()) l.RegisterExporter("genesyscloud_routing_language", RoutingLanguageExporter()) l.RegisterExporter("genesyscloud_routing_skill", RoutingSkillExporter()) l.RegisterExporter("genesyscloud_routing_skill_group", ResourceSkillGroupExporter()) diff --git a/genesyscloud/resource_genesyscloud_init_test.go b/genesyscloud/resource_genesyscloud_init_test.go index c1d69a24d..d0b5ee2eb 100644 --- a/genesyscloud/resource_genesyscloud_init_test.go +++ b/genesyscloud/resource_genesyscloud_init_test.go @@ -8,6 +8,7 @@ import ( architectSchedules "terraform-provider-genesyscloud/genesyscloud/architect_schedules" "terraform-provider-genesyscloud/genesyscloud/group" "terraform-provider-genesyscloud/genesyscloud/provider" + routingEmailDomain "terraform-provider-genesyscloud/genesyscloud/routing_email_domain" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" routingSettings "terraform-provider-genesyscloud/genesyscloud/routing_settings" routingUtilization "terraform-provider-genesyscloud/genesyscloud/routing_utilization" @@ -53,7 +54,7 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_location"] = ResourceLocation() providerResources["genesyscloud_quality_forms_evaluation"] = ResourceEvaluationForm() providerResources["genesyscloud_quality_forms_survey"] = ResourceSurveyForm() - providerResources["genesyscloud_routing_email_domain"] = ResourceRoutingEmailDomain() + providerResources["genesyscloud_routing_email_domain"] = routingEmailDomain.ResourceRoutingEmailDomain() providerResources["genesyscloud_routing_language"] = ResourceRoutingLanguage() providerResources["genesyscloud_routing_skill"] = ResourceRoutingSkill() providerResources["genesyscloud_routing_skill_group"] = ResourceRoutingSkillGroup() @@ -95,7 +96,7 @@ func (r *registerTestInstance) registerTestDataSources() { providerDataSources["genesyscloud_routing_language"] = dataSourceRoutingLanguage() providerDataSources["genesyscloud_routing_skill"] = dataSourceRoutingSkill() providerDataSources["genesyscloud_routing_skill_group"] = dataSourceRoutingSkillGroup() - providerDataSources["genesyscloud_routing_email_domain"] = DataSourceRoutingEmailDomain() + providerDataSources["genesyscloud_routing_email_domain"] = routingEmailDomain.DataSourceRoutingEmailDomain() providerDataSources["genesyscloud_routing_wrapupcode"] = DataSourceRoutingWrapupcode() providerDataSources["genesyscloud_user"] = DataSourceUser() providerDataSources["genesyscloud_widget_deployment"] = dataSourceWidgetDeployments() diff --git a/genesyscloud/resource_genesyscloud_routing_email_domain.go b/genesyscloud/resource_genesyscloud_routing_email_domain.go deleted file mode 100644 index f49449257..000000000 --- a/genesyscloud/resource_genesyscloud_routing_email_domain.go +++ /dev/null @@ -1,242 +0,0 @@ -package genesyscloud - -import ( - "context" - "fmt" - "log" - "strings" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" - "terraform-provider-genesyscloud/genesyscloud/util/constants" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - - "terraform-provider-genesyscloud/genesyscloud/consistency_checker" - - resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" -) - -func getAllRoutingEmailDomains(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { - resources := make(resourceExporter.ResourceIDMetaMap) - routingAPI := platformclientv2.NewRoutingApiWithConfig(clientConfig) - - for pageNum := 1; ; pageNum++ { - const pageSize = 100 - - domains, resp, getErr := routingAPI.GetRoutingEmailDomains(pageSize, pageNum, false, "") - if getErr != nil { - return nil, util.BuildAPIDiagnosticError("genesyscloud_routing_email_domain", fmt.Sprintf("Failed to get routing email domains error: %s", getErr), resp) - } - - if domains.Entities == nil || len(*domains.Entities) == 0 { - return resources, nil - } - - for _, domain := range *domains.Entities { - - resources[*domain.Id] = &resourceExporter.ResourceMeta{Name: *domain.Id} - } - } -} - -func RoutingEmailDomainExporter() *resourceExporter.ResourceExporter { - return &resourceExporter.ResourceExporter{ - GetResourcesFunc: provider.GetAllWithPooledClient(getAllRoutingEmailDomains), - UnResolvableAttributes: map[string]*schema.Schema{ - "custom_smtp_server_id": ResourceRoutingEmailDomain().Schema["custom_smtp_server_id"], - }, - } -} - -func ResourceRoutingEmailDomain() *schema.Resource { - return &schema.Resource{ - Description: "Genesys Cloud Routing Email Domain", - - CreateContext: provider.CreateWithPooledClient(createRoutingEmailDomain), - ReadContext: provider.ReadWithPooledClient(readRoutingEmailDomain), - UpdateContext: provider.UpdateWithPooledClient(updateRoutingEmailDomain), - DeleteContext: provider.DeleteWithPooledClient(deleteRoutingEmailDomain), - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - SchemaVersion: 1, - Schema: map[string]*schema.Schema{ - "domain_id": { - Description: "Unique Id of the domain such as: 'example.com'. If subdomain is true, the Genesys Cloud regional domain is appended. Changing the domain_id attribute will cause the routing_email_domain to be dropped and recreated with a new ID.", - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "subdomain": { - Description: "Indicates if this a Genesys Cloud sub-domain. If true, then the appropriate DNS records are created for sending/receiving email. Changing the subdomain attribute will cause the routing_email_domain to be dropped and recreated with a new ID.", - Type: schema.TypeBool, - Optional: true, - Default: false, - ForceNew: true, - }, - "mail_from_domain": { - Description: "The custom MAIL FROM domain. This must be a subdomain of your email domain", - Type: schema.TypeString, - Optional: true, - }, - "custom_smtp_server_id": { - Description: "The ID of the custom SMTP server integration to use when sending outbound emails from this domain.", - Type: schema.TypeString, - Optional: true, - }, - }, - } -} - -func createRoutingEmailDomain(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - domainID := d.Get("domain_id").(string) - subdomain := d.Get("subdomain").(bool) - mxRecordStatus := "VALID" - if !subdomain { - mxRecordStatus = "NOT_AVAILABLE" - } - - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - - sdkDomain := platformclientv2.Inbounddomain{ - Id: &domainID, - SubDomain: &subdomain, - MxRecordStatus: &mxRecordStatus, - } - - log.Printf("Creating routing email domain %s", domainID) - domain, resp, err := routingAPI.PostRoutingEmailDomains(sdkDomain) - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_routing_email_domain", fmt.Sprintf("Failed to create routing email domain %s error: %s", domainID, err), resp) - } - - d.SetId(*domain.Id) - log.Printf("Created routing email domain %s", *domain.Id) - - // Other settings must be updated in a PATCH update - if d.HasChanges("mail_from_domain", "custom_smtp_server_id") { - return updateRoutingEmailDomain(ctx, d, meta) - } else { - return readRoutingEmailDomain(ctx, d, meta) - } -} - -func readRoutingEmailDomain(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceRoutingEmailDomain(), constants.DefaultConsistencyChecks, "genesyscloud_routing_email_domain") - - log.Printf("Reading routing email domain %s", d.Id()) - return util.WithRetriesForRead(ctx, d, func() *retry.RetryError { - domain, resp, getErr := routingAPI.GetRoutingEmailDomain(d.Id()) - if getErr != nil { - if util.IsStatus404(resp) { - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_email_domain", fmt.Sprintf("Failed to read routing email domain %s | error: %s", d.Id(), getErr), resp)) - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_email_domain", fmt.Sprintf("Failed to read routing email domain %s | error: %s", d.Id(), getErr), resp)) - } - - if domain.SubDomain != nil && *domain.SubDomain { - // Strip off the regional domain suffix added by the server - d.Set("domain_id", strings.SplitN(*domain.Id, ".", 2)[0]) - } else { - d.Set("domain_id", *domain.Id) - } - - if domain.SubDomain != nil { - d.Set("subdomain", *domain.SubDomain) - } else { - d.Set("subdomain", nil) - } - - if domain.CustomSMTPServer != nil && domain.CustomSMTPServer.Id != nil { - d.Set("custom_smtp_server_id", *domain.CustomSMTPServer.Id) - } else { - d.Set("custom_smtp_server_id", nil) - } - - if domain.MailFromSettings != nil && domain.MailFromSettings.MailFromDomain != nil { - d.Set("mail_from_domain", *domain.MailFromSettings.MailFromDomain) - } else { - d.Set("mail_from_domain", nil) - } - - log.Printf("Read routing email domain %s", d.Id()) - return cc.CheckState(d) - }) -} - -func updateRoutingEmailDomain(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - customSMTPServer := d.Get("custom_smtp_server_id").(string) - mailFromDomain := d.Get("mail_from_domain").(string) - domainID := d.Get("domain_id").(string) - - if !strings.Contains(mailFromDomain, domainID) || mailFromDomain == domainID { - return util.BuildDiagnosticError("genesyscloud_routing_email_domain", fmt.Sprintf("domain_id must be a subdomain of mail_from_domain"), fmt.Errorf("domain_id must be a subdomain of mail_from_domain")) - } - - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - - log.Printf("Updating routing email domain %s", d.Id()) - - _, resp, err := routingAPI.PatchRoutingEmailDomain(d.Id(), platformclientv2.Inbounddomainpatchrequest{ - MailFromSettings: &platformclientv2.Mailfromresult{ - MailFromDomain: &mailFromDomain, - }, - CustomSMTPServer: &platformclientv2.Domainentityref{ - Id: &customSMTPServer, - }, - }) - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_routing_email_domain", fmt.Sprintf("Failed to update routing email domain %s error: %s", d.Id(), err), resp) - } - - log.Printf("Updated routing email domain %s", d.Id()) - return readRoutingEmailDomain(ctx, d, meta) -} - -func deleteRoutingEmailDomain(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - - log.Printf("Deleting routing email domain %s", d.Id()) - resp, err := routingAPI.DeleteRoutingEmailDomain(d.Id()) - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_routing_email_domain", fmt.Sprintf("Failed to delete routing email domain %s error: %s", d.Id(), err), resp) - } - - return util.WithRetries(ctx, 90*time.Second, func() *retry.RetryError { - _, resp, err := routingAPI.GetRoutingEmailDomain(d.Id()) - if err != nil { - if util.IsStatus404(resp) { - // Routing email domain deleted - log.Printf("Deleted Routing email domain %s", d.Id()) - return nil - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_email_domain", fmt.Sprintf("Error deleting Routing email domain %s | error: %s", d.Id(), err), resp)) - } - - routingAPI.DeleteRoutingEmailDomain(d.Id()) - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_email_domain", fmt.Sprintf("Routing email domain %s still exists", d.Id()), resp)) - }) -} - -func GenerateRoutingEmailDomainResource( - resourceID string, - domainID string, - subdomain string, - fromDomain string) string { - return fmt.Sprintf(`resource "genesyscloud_routing_email_domain" "%s" { - domain_id = "%s" - subdomain = %s - mail_from_domain = %s - } - `, resourceID, domainID, subdomain, fromDomain) -} diff --git a/genesyscloud/routing_email_domain/data_source_genesyscloud_routing_email_domain.go b/genesyscloud/routing_email_domain/data_source_genesyscloud_routing_email_domain.go new file mode 100644 index 000000000..d828aaae2 --- /dev/null +++ b/genesyscloud/routing_email_domain/data_source_genesyscloud_routing_email_domain.go @@ -0,0 +1,34 @@ +package routing_email_domain + +import ( + "context" + "fmt" + "terraform-provider-genesyscloud/genesyscloud/provider" + "terraform-provider-genesyscloud/genesyscloud/util" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +// Looks up the data for the Email Domain +func DataSourceRoutingEmailDomainRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + sdkConfig := m.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingEmailDomainProxy(sdkConfig) + name := d.Get("name").(string) + + return util.WithRetries(ctx, 15*time.Second, func() *retry.RetryError { + domainId, resp, retryable, getErr := proxy.getRoutingEmailDomainIdByName(ctx, name) + if getErr != nil && !retryable { + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Error requesting email domain %s | error: %s", name, getErr), resp)) + } + if retryable { + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Error requesting email domain %s | error: %s", name, getErr), resp)) + } + + d.SetId(domainId) + return nil + }) +} diff --git a/genesyscloud/data_source_genesyscloud_routing_email_domain_test.go b/genesyscloud/routing_email_domain/data_source_genesyscloud_routing_email_domain_test.go similarity index 97% rename from genesyscloud/data_source_genesyscloud_routing_email_domain_test.go rename to genesyscloud/routing_email_domain/data_source_genesyscloud_routing_email_domain_test.go index 5afcebfd5..eff801cc5 100644 --- a/genesyscloud/data_source_genesyscloud_routing_email_domain_test.go +++ b/genesyscloud/routing_email_domain/data_source_genesyscloud_routing_email_domain_test.go @@ -1,4 +1,4 @@ -package genesyscloud +package routing_email_domain import ( "fmt" @@ -58,6 +58,7 @@ func generateRoutingEmailDomainDataSource( } func CleanupRoutingEmailDomains() { + sdkConfig, _ := provider.AuthorizeSdk() routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) for pageNum := 1; ; pageNum++ { diff --git a/genesyscloud/routing_email_domain/genesyscloud_routing_email_domain_init_test.go b/genesyscloud/routing_email_domain/genesyscloud_routing_email_domain_init_test.go new file mode 100644 index 000000000..ad3fa5077 --- /dev/null +++ b/genesyscloud/routing_email_domain/genesyscloud_routing_email_domain_init_test.go @@ -0,0 +1,61 @@ +package routing_email_domain + +import ( + "sync" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +/* + The genesyscloud_routing_email_domain_init_test.go file is used to initialize the data sources and resources + used in testing the routing_email_domain resource. +*/ + +// providerDataSources holds a map of all registered datasources +var providerDataSources map[string]*schema.Resource + +// providerResources holds a map of all registered resources +var providerResources map[string]*schema.Resource + +type registerTestInstance struct { + resourceMapMutex sync.RWMutex + datasourceMapMutex sync.RWMutex +} + +// registerTestResources registers all resources used in the tests +func (r *registerTestInstance) registerTestResources() { + r.resourceMapMutex.Lock() + defer r.resourceMapMutex.Unlock() + + providerResources[resourceName] = ResourceRoutingEmailDomain() +} + +// registerTestDataSources registers all data sources used in the tests. +func (r *registerTestInstance) registerTestDataSources() { + r.datasourceMapMutex.Lock() + defer r.datasourceMapMutex.Unlock() + + providerDataSources[resourceName] = DataSourceRoutingEmailDomain() +} + +// initTestResources initializes all test resources and data sources. +func initTestResources() { + providerDataSources = make(map[string]*schema.Resource) + providerResources = make(map[string]*schema.Resource) + + regInstance := ®isterTestInstance{} + + regInstance.registerTestResources() + regInstance.registerTestDataSources() +} + +// TestMain is a "setup" function called by the testing framework when run the test +func TestMain(m *testing.M) { + // Run setup function before starting the test suite for the routing_email_domain package + initTestResources() + + // Run the test suite for the routing_email_domain package + m.Run() +} + diff --git a/genesyscloud/routing_email_domain/genesyscloud_routing_email_domain_proxy.go b/genesyscloud/routing_email_domain/genesyscloud_routing_email_domain_proxy.go new file mode 100644 index 000000000..372c315af --- /dev/null +++ b/genesyscloud/routing_email_domain/genesyscloud_routing_email_domain_proxy.go @@ -0,0 +1,162 @@ +package routing_email_domain + +import ( + "context" + "fmt" + "log" + rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" +) + +var internalProxy *routingEmailDomainProxy + +type getAllRoutingEmailDomainsFunc func(ctx context.Context, p *routingEmailDomainProxy) (*[]platformclientv2.Inbounddomain, *platformclientv2.APIResponse, error) +type createRoutingEmailDomainFunc func(ctx context.Context, p *routingEmailDomainProxy, inboundDomain *platformclientv2.Inbounddomain) (*platformclientv2.Inbounddomain, *platformclientv2.APIResponse, error) +type getRoutingEmailDomainByIdFunc func(ctx context.Context, p *routingEmailDomainProxy, id string) (*platformclientv2.Inbounddomain, *platformclientv2.APIResponse, error) +type getRoutingEmailDomainIdByNameFunc func(ctx context.Context, p *routingEmailDomainProxy, name string) (string, *platformclientv2.APIResponse, bool, error) +type updateRoutingEmailDomainFunc func(ctx context.Context, p *routingEmailDomainProxy, id string, inboundDomain *platformclientv2.Inbounddomainpatchrequest) (*platformclientv2.Inbounddomain, *platformclientv2.APIResponse, error) +type deleteRoutingEmailDomainFunc func(ctx context.Context, p *routingEmailDomainProxy, id string) (*platformclientv2.APIResponse, error) + +// routingEmailDomainProxy contains all of the methods that call genesys cloud APIs. +type routingEmailDomainProxy struct { + clientConfig *platformclientv2.Configuration + routingApi *platformclientv2.RoutingApi + createRoutingEmailDomainAttr createRoutingEmailDomainFunc + getAllRoutingEmailDomainsAttr getAllRoutingEmailDomainsFunc + getRoutingEmailDomainIdByNameAttr getRoutingEmailDomainIdByNameFunc + getRoutingEmailDomainByIdAttr getRoutingEmailDomainByIdFunc + updateRoutingEmailDomainAttr updateRoutingEmailDomainFunc + deleteRoutingEmailDomainAttr deleteRoutingEmailDomainFunc + routingEmailDomainCache rc.CacheInterface[platformclientv2.Inbounddomain] +} + +// newRoutingEmailDomainProxy initializes the routing email domain proxy with all of the data needed to communicate with Genesys Cloud +func newRoutingEmailDomainProxy(clientConfig *platformclientv2.Configuration) *routingEmailDomainProxy { + api := platformclientv2.NewRoutingApiWithConfig(clientConfig) + routingEmailDomainCache := rc.NewResourceCache[platformclientv2.Inbounddomain]() + return &routingEmailDomainProxy{ + clientConfig: clientConfig, + routingApi: api, + createRoutingEmailDomainAttr: createRoutingEmailDomainFn, + getAllRoutingEmailDomainsAttr: getAllRoutingEmailDomainsFn, + getRoutingEmailDomainIdByNameAttr: getRoutingEmailDomainIdByNameFn, + getRoutingEmailDomainByIdAttr: getRoutingEmailDomainByIdFn, + updateRoutingEmailDomainAttr: updateRoutingEmailDomainFn, + deleteRoutingEmailDomainAttr: deleteRoutingEmailDomainFn, + routingEmailDomainCache: routingEmailDomainCache, + } +} + +// getRoutingEmailDomainProxy acts as a singleton to for the internalProxy. It also ensures +// that we can still proxy our tests by directly setting internalProxy package variable +func getRoutingEmailDomainProxy(clientConfig *platformclientv2.Configuration) *routingEmailDomainProxy { + if internalProxy == nil { + internalProxy = newRoutingEmailDomainProxy(clientConfig) + } + return internalProxy +} + +func (p *routingEmailDomainProxy) getAllRoutingEmailDomains(ctx context.Context) (*[]platformclientv2.Inbounddomain, *platformclientv2.APIResponse, error) { + return p.getAllRoutingEmailDomainsAttr(ctx, p) +} + +// createRoutingEmailDomain creates a Genesys Cloud routing email domain +func (p *routingEmailDomainProxy) createRoutingEmailDomain(ctx context.Context, routingEmailDomain *platformclientv2.Inbounddomain) (*platformclientv2.Inbounddomain, *platformclientv2.APIResponse, error) { + return p.createRoutingEmailDomainAttr(ctx, p, routingEmailDomain) +} + +// getRoutingEmailDomainById returns a single Genesys Cloud routing email domain by Id +func (p *routingEmailDomainProxy) getRoutingEmailDomainById(ctx context.Context, id string) (*platformclientv2.Inbounddomain, *platformclientv2.APIResponse, error) { + return p.getRoutingEmailDomainByIdAttr(ctx, p, id) +} + +// getRoutingEmailDomainIdByName returns a single Genesys Cloud routing email domain by a name +func (p *routingEmailDomainProxy) getRoutingEmailDomainIdByName(ctx context.Context, name string) (string, *platformclientv2.APIResponse, bool, error) { + return p.getRoutingEmailDomainIdByNameAttr(ctx, p, name) +} + +// updateRoutingEmailDomain updates a Genesys Cloud routing email domain +func (p *routingEmailDomainProxy) updateRoutingEmailDomain(ctx context.Context, id string, routingEmailDomain *platformclientv2.Inbounddomainpatchrequest) (*platformclientv2.Inbounddomain, *platformclientv2.APIResponse, error) { + return p.updateRoutingEmailDomainAttr(ctx, p, id, routingEmailDomain) +} + +// deleteRoutingEmailDomain deletes a Genesys Cloud routing email domain by Id +func (p *routingEmailDomainProxy) deleteRoutingEmailDomain(ctx context.Context, id string) (*platformclientv2.APIResponse, error) { + return p.deleteRoutingEmailDomainAttr(ctx, p, id) +} + +func getAllRoutingEmailDomainsFn(ctx context.Context, p *routingEmailDomainProxy) (*[]platformclientv2.Inbounddomain, *platformclientv2.APIResponse, error) { + var ( + allDomains []platformclientv2.Inbounddomain + pageSize = 100 + response *platformclientv2.APIResponse + ) + + domains, resp, err := p.routingApi.GetRoutingEmailDomains(pageSize, 1, false, "") + if err != nil { + return nil, resp, fmt.Errorf("failed to get routing email domains error: %s", err) + } + + if domains.Entities == nil || len(*domains.Entities) == 0 { + return &allDomains, resp, nil + } + allDomains = append(allDomains, *domains.Entities...) + + for pageNum := 2; pageNum <= *domains.PageCount; pageNum++ { + domains, resp, err := p.routingApi.GetRoutingEmailDomains(pageSize, pageNum, false, "") + if err != nil { + return nil, resp, fmt.Errorf("failed to get routing email domains error: %s", err) + } + + response = resp + if domains.Entities == nil || len(*domains.Entities) == 0 { + return &allDomains, resp, nil + } + allDomains = append(allDomains, *domains.Entities...) + } + + for _, domain := range allDomains { + rc.SetCache(p.routingEmailDomainCache, *domain.Id, domain) + } + return &allDomains, response, nil +} + +func createRoutingEmailDomainFn(ctx context.Context, p *routingEmailDomainProxy, routingEmailDomain *platformclientv2.Inbounddomain) (*platformclientv2.Inbounddomain, *platformclientv2.APIResponse, error) { + return p.routingApi.PostRoutingEmailDomains(*routingEmailDomain) +} + +func getRoutingEmailDomainByIdFn(ctx context.Context, p *routingEmailDomainProxy, id string) (*platformclientv2.Inbounddomain, *platformclientv2.APIResponse, error) { + if domain := rc.GetCacheItem(p.routingEmailDomainCache, id); domain != nil { + return domain, nil, nil + } + return p.routingApi.GetRoutingEmailDomain(id) +} + +func getRoutingEmailDomainIdByNameFn(ctx context.Context, p *routingEmailDomainProxy, name string) (string, *platformclientv2.APIResponse, bool, error) { + domains, resp, err := getAllRoutingEmailDomainsFn(ctx, p) + if err != nil { + return "", resp, false, err + } + + if domains == nil || len(*domains) == 0 { + return "", resp, true, fmt.Errorf("no routing email domain found with name %s", name) + } + + for _, domain := range *domains { + if *domain.Id == name { + log.Printf("retrieved the routing email domain id %s by name %s", *domain.Id, name) + return *domain.Id, resp, false, nil + } + } + + return "", resp, true, fmt.Errorf("unable to find routing email domain with name %s", name) +} + +func updateRoutingEmailDomainFn(ctx context.Context, p *routingEmailDomainProxy, id string, routingEmailDomainReq *platformclientv2.Inbounddomainpatchrequest) (*platformclientv2.Inbounddomain, *platformclientv2.APIResponse, error) { + return p.routingApi.PatchRoutingEmailDomain(id, *routingEmailDomainReq) +} + +func deleteRoutingEmailDomainFn(ctx context.Context, p *routingEmailDomainProxy, id string) (*platformclientv2.APIResponse, error) { + return p.routingApi.DeleteRoutingEmailDomain(id) +} diff --git a/genesyscloud/routing_email_domain/resource_genesyscloud_routing_email_domain.go b/genesyscloud/routing_email_domain/resource_genesyscloud_routing_email_domain.go new file mode 100644 index 000000000..dc869d2d2 --- /dev/null +++ b/genesyscloud/routing_email_domain/resource_genesyscloud_routing_email_domain.go @@ -0,0 +1,176 @@ +package routing_email_domain + +import ( + "context" + "fmt" + "log" + "strings" + "terraform-provider-genesyscloud/genesyscloud/consistency_checker" + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + "terraform-provider-genesyscloud/genesyscloud/util" + "terraform-provider-genesyscloud/genesyscloud/util/constants" + "terraform-provider-genesyscloud/genesyscloud/util/resourcedata" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" +) + +func getAllRoutingEmailDomains(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { + resources := make(resourceExporter.ResourceIDMetaMap) + proxy := getRoutingEmailDomainProxy(clientConfig) + + domains, resp, getErr := proxy.getAllRoutingEmailDomains(ctx) + if getErr != nil { + return nil, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to get routing email domains error: %s", getErr), resp) + } + + if domains == nil || len(*domains) == 0 { + return resources, nil + } + + for _, domain := range *domains { + resources[*domain.Id] = &resourceExporter.ResourceMeta{Name: *domain.Id} + } + return resources, nil +} + +func createRoutingEmailDomain(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingEmailDomainProxy(sdkConfig) + + domainID := d.Get("domain_id").(string) + subdomain := d.Get("subdomain").(bool) + mxRecordStatus := "VALID" + if !subdomain { + mxRecordStatus = "NOT_AVAILABLE" + } + + sdkDomain := platformclientv2.Inbounddomain{ + Id: &domainID, + SubDomain: &subdomain, + MxRecordStatus: &mxRecordStatus, + } + + log.Printf("Creating routing email domain %s", domainID) + domain, resp, err := proxy.createRoutingEmailDomain(ctx, &sdkDomain) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to create routing email domain %s error: %s", domainID, err), resp) + } + + d.SetId(*domain.Id) + log.Printf("Created routing email domain %s", *domain.Id) + + // Other settings must be updated in a PATCH update + if d.HasChanges("mail_from_domain", "custom_smtp_server_id") { + return updateRoutingEmailDomain(ctx, d, meta) + } else { + return readRoutingEmailDomain(ctx, d, meta) + } +} + +func readRoutingEmailDomain(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingEmailDomainProxy(sdkConfig) + + cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceRoutingEmailDomain(), constants.DefaultConsistencyChecks, resourceName) + + log.Printf("Reading routing email domain %s", d.Id()) + return util.WithRetriesForRead(ctx, d, func() *retry.RetryError { + domain, resp, getErr := proxy.getRoutingEmailDomainById(ctx, d.Id()) + if getErr != nil { + if util.IsStatus404(resp) { + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read routing email domain %s | error: %s", d.Id(), getErr), resp)) + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read routing email domain %s | error: %s", d.Id(), getErr), resp)) + } + + resourcedata.SetNillableValue(d, "subdomain", domain.SubDomain) + resourcedata.SetNillableReference(d, "custom_smtp_server_id", domain.CustomSMTPServer) + + if domain.SubDomain != nil && *domain.SubDomain { + // Strip off the regional domain suffix added by the server + _ = d.Set("domain_id", strings.SplitN(*domain.Id, ".", 2)[0]) + } else { + _ = d.Set("domain_id", *domain.Id) + } + + if domain.MailFromSettings != nil && domain.MailFromSettings.MailFromDomain != nil { + _ = d.Set("mail_from_domain", *domain.MailFromSettings.MailFromDomain) + } else { + _ = d.Set("mail_from_domain", nil) + } + + log.Printf("Read routing email domain %s", d.Id()) + return cc.CheckState(d) + }) +} + +func updateRoutingEmailDomain(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingEmailDomainProxy(sdkConfig) + + customSMTPServer := d.Get("custom_smtp_server_id").(string) + mailFromDomain := d.Get("mail_from_domain").(string) + domainID := d.Get("domain_id").(string) + + if !strings.Contains(mailFromDomain, domainID) || mailFromDomain == domainID { + return util.BuildDiagnosticError(resourceName, "domain_id must be a subdomain of mail_from_domain", fmt.Errorf("domain_id must be a subdomain of mail_from_domain")) + } + + log.Printf("Updating routing email domain %s", d.Id()) + + _, resp, err := proxy.updateRoutingEmailDomain(ctx, d.Id(), &platformclientv2.Inbounddomainpatchrequest{ + MailFromSettings: &platformclientv2.Mailfromresult{ + MailFromDomain: &mailFromDomain, + }, + CustomSMTPServer: &platformclientv2.Domainentityref{ + Id: &customSMTPServer, + }, + }) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to update routing email domain %s error: %s", d.Id(), err), resp) + } + + log.Printf("Updated routing email domain %s", d.Id()) + return readRoutingEmailDomain(ctx, d, meta) +} + +func deleteRoutingEmailDomain(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingEmailDomainProxy(sdkConfig) + + log.Printf("Deleting routing email domain %s", d.Id()) + resp, err := proxy.deleteRoutingEmailDomain(ctx, d.Id()) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to delete routing email domain %s error: %s", d.Id(), err), resp) + } + + return util.WithRetries(ctx, 90*time.Second, func() *retry.RetryError { + _, resp, err := proxy.getRoutingEmailDomainById(ctx, d.Id()) + if err != nil { + if util.IsStatus404(resp) { + log.Printf("Deleted Routing email domain %s", d.Id()) + return nil + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Error deleting Routing email domain %s | error: %s", d.Id(), err), resp)) + } + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Routing email domain %s still exists", d.Id()), resp)) + }) +} + +func GenerateRoutingEmailDomainResource( + resourceID string, + domainID string, + subdomain string, + fromDomain string) string { + return fmt.Sprintf(`resource "genesyscloud_routing_email_domain" "%s" { + domain_id = "%s" + subdomain = %s + mail_from_domain = %s + } + `, resourceID, domainID, subdomain, fromDomain) +} diff --git a/genesyscloud/routing_email_domain/resource_genesyscloud_routing_email_domain_schema.go b/genesyscloud/routing_email_domain/resource_genesyscloud_routing_email_domain_schema.go new file mode 100644 index 000000000..964550e13 --- /dev/null +++ b/genesyscloud/routing_email_domain/resource_genesyscloud_routing_email_domain_schema.go @@ -0,0 +1,82 @@ +package routing_email_domain + +import ( + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const resourceName = "genesyscloud_routing_email_domain" + +// SetRegistrar registers all the resources and exporters in the package +func SetRegistrar(regInstance registrar.Registrar) { + regInstance.RegisterResource(resourceName, ResourceRoutingEmailDomain()) + regInstance.RegisterDataSource(resourceName, DataSourceRoutingEmailDomain()) + regInstance.RegisterExporter(resourceName, RoutingEmailDomainExporter()) +} + +func ResourceRoutingEmailDomain() *schema.Resource { + return &schema.Resource{ + Description: "Genesys Cloud Routing Email Domain", + + CreateContext: provider.CreateWithPooledClient(createRoutingEmailDomain), + ReadContext: provider.ReadWithPooledClient(readRoutingEmailDomain), + UpdateContext: provider.UpdateWithPooledClient(updateRoutingEmailDomain), + DeleteContext: provider.DeleteWithPooledClient(deleteRoutingEmailDomain), + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + SchemaVersion: 1, + Schema: map[string]*schema.Schema{ + "domain_id": { + Description: "Unique Id of the domain such as: 'example.com'. If subdomain is true, the Genesys Cloud regional domain is appended. Changing the domain_id attribute will cause the routing_email_domain to be dropped and recreated with a new ID.", + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "subdomain": { + Description: "Indicates if this a Genesys Cloud sub-domain. If true, then the appropriate DNS records are created for sending/receiving email. Changing the subdomain attribute will cause the routing_email_domain to be dropped and recreated with a new ID.", + Type: schema.TypeBool, + Optional: true, + Default: false, + ForceNew: true, + }, + "mail_from_domain": { + Description: "The custom MAIL FROM domain. This must be a subdomain of your email domain", + Type: schema.TypeString, + Optional: true, + }, + "custom_smtp_server_id": { + Description: "The ID of the custom SMTP server integration to use when sending outbound emails from this domain.", + Type: schema.TypeString, + Optional: true, + }, + }, + } +} + +// Returns the schema for the routing email domain +func DataSourceRoutingEmailDomain() *schema.Resource { + return &schema.Resource{ + Description: "Data source for Genesys Cloud Email Domains. Select an email domain by name", + ReadContext: provider.ReadWithPooledClient(DataSourceRoutingEmailDomainRead), + Schema: map[string]*schema.Schema{ + "name": { + Description: "Email domain name.", + Type: schema.TypeString, + Required: true, + }, + }, + } +} + +func RoutingEmailDomainExporter() *resourceExporter.ResourceExporter { + return &resourceExporter.ResourceExporter{ + GetResourcesFunc: provider.GetAllWithPooledClient(getAllRoutingEmailDomains), + UnResolvableAttributes: map[string]*schema.Schema{ + "custom_smtp_server_id": ResourceRoutingEmailDomain().Schema["custom_smtp_server_id"], + }, + } +} diff --git a/genesyscloud/resource_genesyscloud_routing_email_domain_test.go b/genesyscloud/routing_email_domain/resource_genesyscloud_routing_email_domain_test.go similarity index 99% rename from genesyscloud/resource_genesyscloud_routing_email_domain_test.go rename to genesyscloud/routing_email_domain/resource_genesyscloud_routing_email_domain_test.go index b01929e81..832666a92 100644 --- a/genesyscloud/resource_genesyscloud_routing_email_domain_test.go +++ b/genesyscloud/routing_email_domain/resource_genesyscloud_routing_email_domain_test.go @@ -1,4 +1,4 @@ -package genesyscloud +package routing_email_domain import ( "context" diff --git a/genesyscloud/routing_email_route/data_source_genesyscloud_routing_email_route_test.go b/genesyscloud/routing_email_route/data_source_genesyscloud_routing_email_route_test.go index 0b66ad296..8c34e37ab 100644 --- a/genesyscloud/routing_email_route/data_source_genesyscloud_routing_email_route_test.go +++ b/genesyscloud/routing_email_route/data_source_genesyscloud_routing_email_route_test.go @@ -3,10 +3,10 @@ package routing_email_route import ( "fmt" "strings" - gcloud "terraform-provider-genesyscloud/genesyscloud" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "testing" + routingEmailDomain "terraform-provider-genesyscloud/genesyscloud/routing_email_domain" "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -30,7 +30,7 @@ func TestAccDataSourceRoutingEmailRoute(t *testing.T) { Steps: []resource.TestStep{ { // Create email domain and basic route - Config: gcloud.GenerateRoutingEmailDomainResource( + Config: routingEmailDomain.GenerateRoutingEmailDomainResource( domainRes, domainId, util.FalseValue, diff --git a/genesyscloud/routing_email_route/genesyscloud_routing_email_route_init_test.go b/genesyscloud/routing_email_route/genesyscloud_routing_email_route_init_test.go index 9037521ac..023de9953 100644 --- a/genesyscloud/routing_email_route/genesyscloud_routing_email_route_init_test.go +++ b/genesyscloud/routing_email_route/genesyscloud_routing_email_route_init_test.go @@ -6,6 +6,8 @@ import ( architectFlow "terraform-provider-genesyscloud/genesyscloud/architect_flow" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" + routingEmailDomain "terraform-provider-genesyscloud/genesyscloud/routing_email_domain" + "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -33,7 +35,7 @@ func (r *registerTestInstance) registerTestResources() { defer r.resourceMapMutex.Unlock() providerResources[resourceName] = ResourceRoutingEmailRoute() - providerResources["genesyscloud_routing_email_domain"] = genesyscloud.ResourceRoutingEmailDomain() + providerResources["genesyscloud_routing_email_domain"] = routingEmailDomain.ResourceRoutingEmailDomain() providerResources["genesyscloud_routing_queue"] = routingQueue.ResourceRoutingQueue() providerResources["genesyscloud_routing_language"] = genesyscloud.ResourceRoutingLanguage() providerResources["genesyscloud_routing_skill"] = genesyscloud.ResourceRoutingSkill() diff --git a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go index 075bd7b7c..6b4804baa 100644 --- a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go +++ b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go @@ -9,6 +9,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/architect_flow" "terraform-provider-genesyscloud/genesyscloud/provider" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" + routingEmailDomain "terraform-provider-genesyscloud/genesyscloud/routing_email_domain" "terraform-provider-genesyscloud/genesyscloud/util" "testing" "time" @@ -56,7 +57,7 @@ func TestAccResourceRoutingEmailRoute(t *testing.T) { Steps: []resource.TestStep{ { // Confirm mutual exclusivity of reply_email_address and from_email - Config: gcloud.GenerateRoutingEmailDomainResource( + Config: routingEmailDomain.GenerateRoutingEmailDomainResource( domainRes, domainId, util.FalseValue, @@ -88,7 +89,7 @@ func TestAccResourceRoutingEmailRoute(t *testing.T) { }, { // Confirm mutual exclusivity of reply_email_address and auto_bcc - Config: gcloud.GenerateRoutingEmailDomainResource( + Config: routingEmailDomain.GenerateRoutingEmailDomainResource( domainRes, domainId, util.FalseValue, @@ -116,7 +117,7 @@ func TestAccResourceRoutingEmailRoute(t *testing.T) { }, { // Confirm mutual exclusivity of flow_id and queue_id - Config: gcloud.GenerateRoutingEmailDomainResource( + Config: routingEmailDomain.GenerateRoutingEmailDomainResource( domainRes, domainId, util.FalseValue, @@ -163,7 +164,7 @@ func TestAccResourceRoutingEmailRoute(t *testing.T) { Steps: []resource.TestStep{ { // Create email domain and basic route - Config: gcloud.GenerateRoutingEmailDomainResource( + Config: routingEmailDomain.GenerateRoutingEmailDomainResource( domainRes, domainId, util.FalseValue, @@ -187,7 +188,7 @@ func TestAccResourceRoutingEmailRoute(t *testing.T) { }, { // Update email route and add a queue, language, and skill - Config: gcloud.GenerateRoutingEmailDomainResource( + Config: routingEmailDomain.GenerateRoutingEmailDomainResource( domainRes, domainId, util.FalseValue, @@ -245,7 +246,7 @@ func TestAccResourceRoutingEmailRoute(t *testing.T) { }, { // Update email reply to true - Config: gcloud.GenerateRoutingEmailDomainResource( + Config: routingEmailDomain.GenerateRoutingEmailDomainResource( domainRes, domainId, util.FalseValue, @@ -307,7 +308,7 @@ func TestAccResourceRoutingEmailRoute(t *testing.T) { }, { // Update email reply to false and set a route id - Config: gcloud.GenerateRoutingEmailDomainResource( + Config: routingEmailDomain.GenerateRoutingEmailDomainResource( domainRes, domainId, util.FalseValue, diff --git a/genesyscloud/routing_queue_outbound_email_address/genesyscloud_routing_queue_outbound_email_address_init_test.go b/genesyscloud/routing_queue_outbound_email_address/genesyscloud_routing_queue_outbound_email_address_init_test.go index bc41e499e..f302ac073 100644 --- a/genesyscloud/routing_queue_outbound_email_address/genesyscloud_routing_queue_outbound_email_address_init_test.go +++ b/genesyscloud/routing_queue_outbound_email_address/genesyscloud_routing_queue_outbound_email_address_init_test.go @@ -3,9 +3,10 @@ package routing_queue_outbound_email_address import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "sync" - gcloud "terraform-provider-genesyscloud/genesyscloud" routingEmailRoute "terraform-provider-genesyscloud/genesyscloud/routing_email_route" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" + routingEmailDomain "terraform-provider-genesyscloud/genesyscloud/routing_email_domain" + "testing" ) @@ -29,7 +30,7 @@ func (r *registerTestInstance) registerTestResources() { providerResources[resourceName] = ResourceRoutingQueueOutboundEmailAddress() providerResources["genesyscloud_routing_queue"] = routingQueue.ResourceRoutingQueue() providerResources["genesyscloud_routing_email_route"] = routingEmailRoute.ResourceRoutingEmailRoute() - providerResources["genesyscloud_routing_email_domain"] = gcloud.ResourceRoutingEmailDomain() + providerResources["genesyscloud_routing_email_domain"] = routingEmailDomain.ResourceRoutingEmailDomain() } // initTestResources initializes all test resources and data sources. diff --git a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_test.go b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_test.go index 534bd35bf..8096e6388 100644 --- a/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_test.go +++ b/genesyscloud/routing_queue_outbound_email_address/resource_genesyscloud_routing_queue_outbound_email_address_test.go @@ -5,8 +5,8 @@ import ( "log" "os" "strings" - gcloud "terraform-provider-genesyscloud/genesyscloud" "terraform-provider-genesyscloud/genesyscloud/provider" + routingEmailDomain "terraform-provider-genesyscloud/genesyscloud/routing_email_domain" routingEmailRoute "terraform-provider-genesyscloud/genesyscloud/routing_email_route" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" "terraform-provider-genesyscloud/genesyscloud/util" @@ -72,7 +72,7 @@ func TestAccResourceRoutingQueueOutboundEmailAddress(t *testing.T) { Config: routingQueue.GenerateRoutingQueueResourceBasic( queueResource, queueName1, - ) + gcloud.GenerateRoutingEmailDomainResource( + ) + routingEmailDomain.GenerateRoutingEmailDomainResource( domainResource, domainId, util.FalseValue, diff --git a/genesyscloud/tfexporter/tf_exporter_resource_test.go b/genesyscloud/tfexporter/tf_exporter_resource_test.go index a1f18facf..2b164ee24 100644 --- a/genesyscloud/tfexporter/tf_exporter_resource_test.go +++ b/genesyscloud/tfexporter/tf_exporter_resource_test.go @@ -53,6 +53,7 @@ import ( responsemanagementResponse "terraform-provider-genesyscloud/genesyscloud/responsemanagement_response" respManagementRespAsset "terraform-provider-genesyscloud/genesyscloud/responsemanagement_responseasset" routingEmailRoute "terraform-provider-genesyscloud/genesyscloud/routing_email_route" + routingEmailDomain "terraform-provider-genesyscloud/genesyscloud/routing_email_domain" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" routingQueueConditionalGroupRouting "terraform-provider-genesyscloud/genesyscloud/routing_queue_conditional_group_routing" routingQueueOutboundEmailAddress "terraform-provider-genesyscloud/genesyscloud/routing_queue_outbound_email_address" @@ -151,7 +152,7 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_user"] = gcloud.ResourceUser() providerResources["genesyscloud_responsemanagement_library"] = respmanagementLibrary.ResourceResponsemanagementLibrary() providerResources["genesyscloud_responsemanagement_responseasset"] = respManagementRespAsset.ResourceResponseManagementResponseAsset() - providerResources["genesyscloud_routing_email_domain"] = gcloud.ResourceRoutingEmailDomain() + providerResources["genesyscloud_routing_email_domain"] = routingEmailDomain.ResourceRoutingEmailDomain() providerResources["genesyscloud_routing_email_route"] = routingEmailRoute.ResourceRoutingEmailRoute() providerResources["genesyscloud_routing_language"] = gcloud.ResourceRoutingLanguage() providerResources["genesyscloud_routing_queue"] = routingQueue.ResourceRoutingQueue() @@ -263,7 +264,7 @@ func (r *registerTestInstance) registerTestExporters() { RegisterExporter("genesyscloud_responsemanagement_library", respmanagementLibrary.ResponsemanagementLibraryExporter()) RegisterExporter("genesyscloud_responsemanagement_response", responsemanagementResponse.ResponsemanagementResponseExporter()) RegisterExporter("genesyscloud_responsemanagement_responseasset", respManagementRespAsset.ExporterResponseManagementResponseAsset()) - RegisterExporter("genesyscloud_routing_email_domain", gcloud.RoutingEmailDomainExporter()) + RegisterExporter("genesyscloud_routing_email_domain", routingEmailDomain.RoutingEmailDomainExporter()) RegisterExporter("genesyscloud_routing_email_route", routingEmailRoute.RoutingEmailRouteExporter()) RegisterExporter("genesyscloud_routing_language", gcloud.RoutingLanguageExporter()) RegisterExporter("genesyscloud_routing_queue", routingQueue.RoutingQueueExporter()) diff --git a/main.go b/main.go index ad44a2841..300196cb3 100644 --- a/main.go +++ b/main.go @@ -62,6 +62,7 @@ import ( respmanagementLibrary "terraform-provider-genesyscloud/genesyscloud/responsemanagement_library" responsemanagementResponse "terraform-provider-genesyscloud/genesyscloud/responsemanagement_response" responsemanagementResponseasset "terraform-provider-genesyscloud/genesyscloud/responsemanagement_responseasset" + routingEmailDomain "terraform-provider-genesyscloud/genesyscloud/routing_email_domain" routingEmailRoute "terraform-provider-genesyscloud/genesyscloud/routing_email_route" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" routingUtilization "terraform-provider-genesyscloud/genesyscloud/routing_utilization" @@ -236,10 +237,10 @@ func registerResources() { routingQueueOutboundEmailAddress.SetRegistrar(regInstance) //Registering routing queue outbound email address outboundContactListContact.SetRegistrar(regInstance) //Registering outbound contact list contact routingSettings.SetRegistrar(regInstance) //Registering routing Settings - routingUtilization.SetRegistrar(regInstance) // Registering routing utilization - routingUtilizationLabel.SetRegistrar(regInstance) // Registering routing utilization label + routingUtilization.SetRegistrar(regInstance) //Registering routing utilization + routingUtilizationLabel.SetRegistrar(regInstance) //Registering routing utilization label journeyViews.SetRegistrar(regInstance) //Registering journey views - + routingEmailDomain.SetRegistrar(regInstance) //Registering Routing Email Domain // setting resources for Use cases like TF export where provider is used in resource classes. tfexp.SetRegistrar(regInstance) //Registering tf exporter registrar.SetResources(providerResources, providerDataSources) From cfb9ba06390ce793973e762b4be745c562d3b696 Mon Sep 17 00:00:00 2001 From: Brian Goad Date: Mon, 15 Jul 2024 10:10:02 -0400 Subject: [PATCH 55/62] Fixes DEVTOOLING-633 (#1135) * Consistency in filename organization for genesyscloud_outbound_contact_list resource * Add genesyscloud_outbound_contact_list_template data and resource based on outbound_contact_list * Generate docs for new resources * Fixes DEVTOOLING-633 by adding logic to contactlistfilter resources to connect to a contact list OR a contact list template resource * Fix DEVTOOLING-703 * Consistency in filename organization for genesyscloud_outbound_contact_list resource * Add genesyscloud_outbound_contact_list_template data and resource based on outbound_contact_list * Generate docs for new resources * Fixes DEVTOOLING-633 by adding logic to contactlistfilter resources to connect to a contact list OR a contact list template resource * Refactor genesyscloud_outbound_contact_list resource to use proxy and new structure * Refactor genesyscloud_outbound_contact_list_template resource to use proxy and new structure * Add examples for new genesyscloud_outbound_contact_list_template resource * Fix comment * Use resourceName variable for genesyscloud_outbound_contact_list resource * Use resourceName variable for genesyscloud_outbound_contact_list_template resource * Add exampel data source * Add generated docs --- .../outbound_contact_list_template.md | 30 + .../outbound_contact_list_template.md | 101 +++ docs/resources/outbound_contactlistfilter.md | 3 +- .../data-source.tf | 3 + .../apis.md | 5 + .../resource.tf | 13 + ...urce_genesyscloud_outbound_contact_list.go | 35 + ...enesyscloud_outbound_contact_list_test.go} | 10 +- ...ource_genesyscloud_outbound_contactlist.go | 50 -- ...enesyscloud_outbound_contact_list_proxy.go | 185 +++++ .../outbound_contact_list_resource_init.go | 8 +- ...utbound_contact_list_resource_init_test.go | 4 +- ...urce_genesyscloud_outbound_contact_list.go | 225 +++++++ ...nesyscloud_outbound_contact_list_schema.go | 199 ++++++ ...genesyscloud_outbound_contact_list_test.go | 364 ++++++++++ ...enesyscloud_outbound_contact_list_utils.go | 228 +++++++ ...ource_genesyscloud_outbound_contactlist.go | 637 ------------------ ..._genesyscloud_outbound_contactlist_test.go | 364 ---------- ...syscloud_outbound_contact_list_template.go | 36 + ...oud_outbound_contact_list_template_test.go | 61 ++ ...ud_outbound_contact_list_template_proxy.go | 185 +++++ ...und_contact_list_template_resource_init.go | 15 + ...ontact_list_template_resource_init_test.go | 51 ++ ...syscloud_outbound_contact_list_template.go | 220 ++++++ ...d_outbound_contact_list_template_schema.go | 194 ++++++ ...oud_outbound_contact_list_template_test.go | 356 ++++++++++ ...ud_outbound_contact_list_template_utils.go | 233 +++++++ ...genesyscloud_outbound_contactlistfilter.go | 10 +- ...cloud_outbound_contactlistfilter_schema.go | 21 +- ...scloud_outbound_contactlistfilter_utils.go | 20 +- .../tfexporter/tf_exporter_resource_test.go | 3 + main.go | 2 + 32 files changed, 2798 insertions(+), 1073 deletions(-) create mode 100644 docs/data-sources/outbound_contact_list_template.md create mode 100644 docs/resources/outbound_contact_list_template.md create mode 100644 examples/data-sources/genesyscloud_outbound_contact_list_template/data-source.tf create mode 100644 examples/resources/genesyscloud_outbound_contact_list_template/apis.md create mode 100644 examples/resources/genesyscloud_outbound_contact_list_template/resource.tf create mode 100644 genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contact_list.go rename genesyscloud/outbound_contact_list/{data_source_genesyscloud_outbound_contactlist_test.go => data_source_genesyscloud_outbound_contact_list_test.go} (83%) delete mode 100644 genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contactlist.go create mode 100644 genesyscloud/outbound_contact_list/genesyscloud_outbound_contact_list_proxy.go create mode 100644 genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contact_list.go create mode 100644 genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contact_list_schema.go create mode 100644 genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contact_list_test.go create mode 100644 genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contact_list_utils.go delete mode 100644 genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist.go delete mode 100644 genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist_test.go create mode 100644 genesyscloud/outbound_contact_list_template/data_source_genesyscloud_outbound_contact_list_template.go create mode 100644 genesyscloud/outbound_contact_list_template/data_source_genesyscloud_outbound_contact_list_template_test.go create mode 100644 genesyscloud/outbound_contact_list_template/genesyscloud_outbound_contact_list_template_proxy.go create mode 100644 genesyscloud/outbound_contact_list_template/outbound_contact_list_template_resource_init.go create mode 100644 genesyscloud/outbound_contact_list_template/outbound_contact_list_template_resource_init_test.go create mode 100644 genesyscloud/outbound_contact_list_template/resource_genesyscloud_outbound_contact_list_template.go create mode 100644 genesyscloud/outbound_contact_list_template/resource_genesyscloud_outbound_contact_list_template_schema.go create mode 100644 genesyscloud/outbound_contact_list_template/resource_genesyscloud_outbound_contact_list_template_test.go create mode 100644 genesyscloud/outbound_contact_list_template/resource_genesyscloud_outbound_contact_list_template_utils.go diff --git a/docs/data-sources/outbound_contact_list_template.md b/docs/data-sources/outbound_contact_list_template.md new file mode 100644 index 000000000..ea530a9c4 --- /dev/null +++ b/docs/data-sources/outbound_contact_list_template.md @@ -0,0 +1,30 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "genesyscloud_outbound_contact_list_template Data Source - terraform-provider-genesyscloud" +subcategory: "" +description: |- + Data source for Genesys Cloud Outbound Contact Lists Templates. Select a contact list template by name. +--- + +# genesyscloud_outbound_contact_list_template (Data Source) + +Data source for Genesys Cloud Outbound Contact Lists Templates. Select a contact list template by name. + +## Example Usage + +```terraform +data "genesyscloud_outbound_contact_list_template" "contact_list_template" { + name = "Example Contact List Template" +} +``` + + +## Schema + +### Required + +- `name` (String) Contact List Template name. + +### Read-Only + +- `id` (String) The ID of this resource. diff --git a/docs/resources/outbound_contact_list_template.md b/docs/resources/outbound_contact_list_template.md new file mode 100644 index 000000000..292585fc0 --- /dev/null +++ b/docs/resources/outbound_contact_list_template.md @@ -0,0 +1,101 @@ +--- +page_title: "genesyscloud_outbound_contact_list_template Resource - terraform-provider-genesyscloud" +subcategory: "" +description: |- + Genesys Cloud Outbound Contact List Template +--- +# genesyscloud_outbound_contact_list_template (Resource) + +Genesys Cloud Outbound Contact List Template + +## 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: + +- [GET /api/v2/outbound/contactlisttemplates](https://developer.genesys.cloud/devapps/api-explorer#get-api-v2-outbound-contactlisttemplates) +- [POST /api/v2/outbound/contactlisttemplates](https://developer.genesys.cloud/devapps/api-explorer#post-api-v2-outbound-contactlisttemplates) +- [GET /api/v2/outbound/contactlisttemplates/{contactListTemplateId}](https://developer.genesys.cloud/devapps/api-explorer#get-api-v2-outbound-contactlisttemplates--contactListTemplateId-) +- [PUT /api/v2/outbound/contactlisttemplates/{contactListTemplateId}](https://developer.genesys.cloud/devapps/api-explorer#put-api-v2-outbound-contactlisttemplates--contactListTemplateId-) +- [DELETE /api/v2/outbound/contactlisttemplates/{contactListTemplateId}](https://developer.genesys.cloud/devapps/api-explorer#delete-api-v2-outbound-contactlisttemplates--contactListTemplateId-) + + +## Example Usage + +```terraform +resource "genesyscloud_outbound_contact_list_template" "contact-list-template" { + name = "Example Contact List Template" + column_names = ["First Name", "Last Name", "Cell", "Home"] + attempt_limit_id = genesyscloud_outbound_attempt_limit.attempt-limit.id + phone_columns { + column_name = "Cell" + type = "cell" + } + phone_columns { + column_name = "Home" + type = "home" + } +} +``` + + +## Schema + +### Required + +- `column_names` (List of String) The names of the contact template data columns. Changing the column_names attribute will cause the outbound_contact_list_template object to be dropped and recreated with a new ID +- `name` (String) The name for the contact list template. + +### Optional + +- `attempt_limit_id` (String) Attempt Limit for this Contact List Template. +- `automatic_time_zone_mapping` (Boolean) Indicates if automatic time zone mapping is to be used for this Contact List Template. Changing the automatic_time_zone_mappings attribute will cause the outbound_contact_list_template 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 template is dropped and recreated with a new ID (see [below for nested schema](#nestedblock--column_data_type_specifications)) +- `email_columns` (Block Set) Indicates which columns are email addresses. Changing the email_columns attribute will cause the outbound_contact_list_template 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_template 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 preview_mode_column_name 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. +- `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 'automatic_time_zone_mapping' is set to true. Changing the zip_code_column_name attribute will cause the outbound_contact_list_template object to be dropped and recreated with a new ID + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `column_data_type_specifications` + +Required: + +- `column_name` (String) The column name of a column selected for dynamic queueing. +- `max_length` (Number) The maximum length of the text column selected for dynamic queueing. + +Optional: + +- `column_data_type` (String) The data type of the column selected for dynamic queueing (TEXT, NUMERIC or TIMESTAMP) +- `max` (Number) The maximum length of the numeric column selected for dynamic queueing. +- `min` (Number) The minimum length of the numeric column selected for dynamic queueing. + + + +### Nested Schema for `email_columns` + +Required: + +- `column_name` (String) The name of the email column. +- `type` (String) Indicates the type of the email column. For example, 'work' or 'personal'. + +Optional: + +- `contactable_time_column` (String) A column that indicates the timezone to use for a given contact when checking contactable times. + + + +### Nested Schema for `phone_columns` + +Required: + +- `column_name` (String) The name of the phone column. +- `type` (String) Indicates the type of the phone column. For example, 'cell' or 'home'. + +Optional: + +- `callable_time_column` (String) A column that indicates the timezone to use for a given contact when checking callable times. Not allowed if 'automaticTimeZoneMapping' is set to true. + diff --git a/docs/resources/outbound_contactlistfilter.md b/docs/resources/outbound_contactlistfilter.md index 1009a7ad9..9d5935ea1 100644 --- a/docs/resources/outbound_contactlistfilter.md +++ b/docs/resources/outbound_contactlistfilter.md @@ -42,12 +42,13 @@ resource "genesyscloud_outbound_contactlistfilter" "contact_list_filter" { ### Required -- `contact_list_id` (String) The contact list the filter is based on. - `name` (String) The name of the list. ### Optional - `clauses` (Block List) Groups of conditions to filter the contacts by. (see [below for nested schema](#nestedblock--clauses)) +- `contact_list_id` (String) The contact list the filter is based on. Mutually exclusive to 'contact_list_template_id', however, one of the two must be specified +- `contact_list_template_id` (String) The contact list template the filter is based on. Mutually exclusive to 'contact_list_id', however, one of the two must be specified. - `filter_type` (String) How to join clauses together. ### Read-Only diff --git a/examples/data-sources/genesyscloud_outbound_contact_list_template/data-source.tf b/examples/data-sources/genesyscloud_outbound_contact_list_template/data-source.tf new file mode 100644 index 000000000..a2c72141a --- /dev/null +++ b/examples/data-sources/genesyscloud_outbound_contact_list_template/data-source.tf @@ -0,0 +1,3 @@ +data "genesyscloud_outbound_contact_list_template" "contact_list_template" { + name = "Example Contact List Template" +} diff --git a/examples/resources/genesyscloud_outbound_contact_list_template/apis.md b/examples/resources/genesyscloud_outbound_contact_list_template/apis.md new file mode 100644 index 000000000..edded9d77 --- /dev/null +++ b/examples/resources/genesyscloud_outbound_contact_list_template/apis.md @@ -0,0 +1,5 @@ +- [GET /api/v2/outbound/contactlisttemplates](https://developer.genesys.cloud/devapps/api-explorer#get-api-v2-outbound-contactlisttemplates) +- [POST /api/v2/outbound/contactlisttemplates](https://developer.genesys.cloud/devapps/api-explorer#post-api-v2-outbound-contactlisttemplates) +- [GET /api/v2/outbound/contactlisttemplates/{contactListTemplateId}](https://developer.genesys.cloud/devapps/api-explorer#get-api-v2-outbound-contactlisttemplates--contactListTemplateId-) +- [PUT /api/v2/outbound/contactlisttemplates/{contactListTemplateId}](https://developer.genesys.cloud/devapps/api-explorer#put-api-v2-outbound-contactlisttemplates--contactListTemplateId-) +- [DELETE /api/v2/outbound/contactlisttemplates/{contactListTemplateId}](https://developer.genesys.cloud/devapps/api-explorer#delete-api-v2-outbound-contactlisttemplates--contactListTemplateId-) diff --git a/examples/resources/genesyscloud_outbound_contact_list_template/resource.tf b/examples/resources/genesyscloud_outbound_contact_list_template/resource.tf new file mode 100644 index 000000000..b582982b0 --- /dev/null +++ b/examples/resources/genesyscloud_outbound_contact_list_template/resource.tf @@ -0,0 +1,13 @@ +resource "genesyscloud_outbound_contact_list_template" "contact-list-template" { + name = "Example Contact List Template" + column_names = ["First Name", "Last Name", "Cell", "Home"] + attempt_limit_id = genesyscloud_outbound_attempt_limit.attempt-limit.id + phone_columns { + column_name = "Cell" + type = "cell" + } + phone_columns { + column_name = "Home" + type = "home" + } +} diff --git a/genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contact_list.go b/genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contact_list.go new file mode 100644 index 000000000..78287bd86 --- /dev/null +++ b/genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contact_list.go @@ -0,0 +1,35 @@ +package outbound_contact_list + +import ( + "context" + "fmt" + "terraform-provider-genesyscloud/genesyscloud/provider" + "terraform-provider-genesyscloud/genesyscloud/util" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceOutboundContactListRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + sdkConfig := m.(*provider.ProviderMeta).ClientConfig + proxy := getOutboundContactlistProxy(sdkConfig) + name := d.Get("name").(string) + + return util.WithRetries(ctx, 15*time.Second, func() *retry.RetryError { + const pageNum = 1 + const pageSize = 100 + contactListId, retryable, resp, err := proxy.getOutboundContactlistIdByName(ctx, name) + + if err != nil && !retryable { + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("error requesting contact list %s | error: %s", name, err), resp)) + } + if retryable { + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("no contact list found with name %s", name), resp)) + } + d.SetId(contactListId) + return nil + }) +} diff --git a/genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contactlist_test.go b/genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contact_list_test.go similarity index 83% rename from genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contactlist_test.go rename to genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contact_list_test.go index 4e6194bd9..b58f84862 100644 --- a/genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contactlist_test.go +++ b/genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contact_list_test.go @@ -41,11 +41,11 @@ func TestAccDataSourceOutboundContactList(t *testing.T) { ) + generateOutboundContactListDataSource( dataSourceId, contactListName, - "genesyscloud_outbound_contact_list."+resourceId, + resourceName+"."+resourceId, ), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttrPair("data.genesyscloud_outbound_contact_list."+dataSourceId, "id", - "genesyscloud_outbound_contact_list."+resourceId, "id"), + resource.TestCheckResourceAttrPair("data."+resourceName+"."+dataSourceId, "id", + resourceName+"."+resourceId, "id"), ), }, }, @@ -54,9 +54,9 @@ func TestAccDataSourceOutboundContactList(t *testing.T) { func generateOutboundContactListDataSource(id string, name string, dependsOn string) string { return fmt.Sprintf(` -data "genesyscloud_outbound_contact_list" "%s" { +data "%s" "%s" { name = "%s" depends_on = [%s] } -`, id, name, dependsOn) +`, resourceName, id, name, dependsOn) } diff --git a/genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contactlist.go b/genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contactlist.go deleted file mode 100644 index b3fb96131..000000000 --- a/genesyscloud/outbound_contact_list/data_source_genesyscloud_outbound_contactlist.go +++ /dev/null @@ -1,50 +0,0 @@ -package outbound_contact_list - -import ( - "context" - "fmt" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" -) - -func DataSourceOutboundContactList() *schema.Resource { - return &schema.Resource{ - Description: "Data source for Genesys Cloud Outbound Contact Lists. Select a contact list by name.", - ReadContext: provider.ReadWithPooledClient(dataSourceOutboundContactListRead), - Schema: map[string]*schema.Schema{ - "name": { - Description: "Contact List name.", - Type: schema.TypeString, - Required: true, - }, - }, - } -} - -func dataSourceOutboundContactListRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - sdkConfig := m.(*provider.ProviderMeta).ClientConfig - outboundAPI := platformclientv2.NewOutboundApiWithConfig(sdkConfig) - name := d.Get("name").(string) - - return util.WithRetries(ctx, 15*time.Second, func() *retry.RetryError { - const pageNum = 1 - const pageSize = 100 - contactLists, resp, getErr := outboundAPI.GetOutboundContactlists(false, false, pageSize, pageNum, true, "", name, []string{""}, []string{""}, "", "") - if getErr != nil { - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("error requesting contact list %s | error: %s", name, getErr), resp)) - } - if contactLists.Entities == nil || len(*contactLists.Entities) == 0 { - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("no contact lists found with name %s", name), resp)) - } - contactList := (*contactLists.Entities)[0] - d.SetId(*contactList.Id) - return nil - }) -} diff --git a/genesyscloud/outbound_contact_list/genesyscloud_outbound_contact_list_proxy.go b/genesyscloud/outbound_contact_list/genesyscloud_outbound_contact_list_proxy.go new file mode 100644 index 000000000..b1ec06b18 --- /dev/null +++ b/genesyscloud/outbound_contact_list/genesyscloud_outbound_contact_list_proxy.go @@ -0,0 +1,185 @@ +package outbound_contact_list + +import ( + "context" + "fmt" + "log" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" +) + +/* +The genesyscloud_outbound_contact_list_proxy.go file contains the proxy structures and methods that interact +with the Genesys Cloud SDK. We use composition here for each function on the proxy so individual functions can be stubbed +out during testing. +*/ + +// internalProxy holds a proxy instance that can be used throughout the package +var internalProxy *outboundContactlistProxy + +// Type definitions for each func on our proxy so we can easily mock them out later +type createOutboundContactlistFunc func(ctx context.Context, p *outboundContactlistProxy, contactList *platformclientv2.Contactlist) (*platformclientv2.Contactlist, *platformclientv2.APIResponse, error) +type getAllOutboundContactlistFunc func(ctx context.Context, p *outboundContactlistProxy, name string) (*[]platformclientv2.Contactlist, *platformclientv2.APIResponse, error) +type getOutboundContactlistIdByNameFunc func(ctx context.Context, p *outboundContactlistProxy, name string) (id string, retryable bool, response *platformclientv2.APIResponse, err error) +type getOutboundContactlistByIdFunc func(ctx context.Context, p *outboundContactlistProxy, id string) (contactList *platformclientv2.Contactlist, response *platformclientv2.APIResponse, err error) +type updateOutboundContactlistFunc func(ctx context.Context, p *outboundContactlistProxy, id string, contactList *platformclientv2.Contactlist) (*platformclientv2.Contactlist, *platformclientv2.APIResponse, error) +type deleteOutboundContactlistFunc func(ctx context.Context, p *outboundContactlistProxy, id string) (response *platformclientv2.APIResponse, err error) + +// outboundContactlistProxy contains all of the methods that call genesys cloud APIs. +type outboundContactlistProxy struct { + clientConfig *platformclientv2.Configuration + outboundApi *platformclientv2.OutboundApi + createOutboundContactlistAttr createOutboundContactlistFunc + getAllOutboundContactlistAttr getAllOutboundContactlistFunc + getOutboundContactlistIdByNameAttr getOutboundContactlistIdByNameFunc + getOutboundContactlistByIdAttr getOutboundContactlistByIdFunc + updateOutboundContactlistAttr updateOutboundContactlistFunc + deleteOutboundContactlistAttr deleteOutboundContactlistFunc +} + +// newOutboundContactlistProxy initializes the outbound contactlist proxy with all of the data needed to communicate with Genesys Cloud +func newOutboundContactlistProxy(clientConfig *platformclientv2.Configuration) *outboundContactlistProxy { + api := platformclientv2.NewOutboundApiWithConfig(clientConfig) + return &outboundContactlistProxy{ + clientConfig: clientConfig, + outboundApi: api, + createOutboundContactlistAttr: createOutboundContactlistFn, + getAllOutboundContactlistAttr: getAllOutboundContactlistFn, + getOutboundContactlistIdByNameAttr: getOutboundContactlistIdByNameFn, + getOutboundContactlistByIdAttr: getOutboundContactlistByIdFn, + updateOutboundContactlistAttr: updateOutboundContactlistFn, + deleteOutboundContactlistAttr: deleteOutboundContactlistFn, + } +} + +// getOutboundContactlistProxy acts as a singleton to for the internalProxy. It also ensures +// that we can still proxy our tests by directly setting internalProxy package variable +func getOutboundContactlistProxy(clientConfig *platformclientv2.Configuration) *outboundContactlistProxy { + if internalProxy == nil { + internalProxy = newOutboundContactlistProxy(clientConfig) + } + return internalProxy +} + +// createOutboundContactlist creates a Genesys Cloud outbound contactlist +func (p *outboundContactlistProxy) createOutboundContactlist(ctx context.Context, outboundContactlist *platformclientv2.Contactlist) (*platformclientv2.Contactlist, *platformclientv2.APIResponse, error) { + return p.createOutboundContactlistAttr(ctx, p, outboundContactlist) +} + +// getOutboundContactlist retrieves all Genesys Cloud outbound contactlist +func (p *outboundContactlistProxy) getAllOutboundContactlist(ctx context.Context) (*[]platformclientv2.Contactlist, *platformclientv2.APIResponse, error) { + return p.getAllOutboundContactlistAttr(ctx, p, "") +} + +// getOutboundContactlistIdByName returns a single Genesys Cloud outbound contactlist by a name +func (p *outboundContactlistProxy) getOutboundContactlistIdByName(ctx context.Context, name string) (id string, retryable bool, response *platformclientv2.APIResponse, err error) { + return p.getOutboundContactlistIdByNameAttr(ctx, p, name) +} + +// getOutboundContactlistById returns a single Genesys Cloud outbound contactlist by Id +func (p *outboundContactlistProxy) getOutboundContactlistById(ctx context.Context, id string) (outboundContactlist *platformclientv2.Contactlist, response *platformclientv2.APIResponse, err error) { + return p.getOutboundContactlistByIdAttr(ctx, p, id) +} + +// updateOutboundContactlist updates a Genesys Cloud outbound contactlist +func (p *outboundContactlistProxy) updateOutboundContactlist(ctx context.Context, id string, outboundContactlist *platformclientv2.Contactlist) (*platformclientv2.Contactlist, *platformclientv2.APIResponse, error) { + return p.updateOutboundContactlistAttr(ctx, p, id, outboundContactlist) +} + +// deleteOutboundContactlist deletes a Genesys Cloud outbound contactlist by Id +func (p *outboundContactlistProxy) deleteOutboundContactlist(ctx context.Context, id string) (response *platformclientv2.APIResponse, err error) { + return p.deleteOutboundContactlistAttr(ctx, p, id) +} + +// createOutboundContactlistFn is an implementation function for creating a Genesys Cloud outbound contactlist +func createOutboundContactlistFn(ctx context.Context, p *outboundContactlistProxy, outboundContactlist *platformclientv2.Contactlist) (*platformclientv2.Contactlist, *platformclientv2.APIResponse, error) { + contactList, resp, err := p.outboundApi.PostOutboundContactlists(*outboundContactlist) + if err != nil { + return nil, resp, err + } + return contactList, resp, nil +} + +// getAllOutboundContactlistFn is the implementation for retrieving all outbound contactlist in Genesys Cloud +func getAllOutboundContactlistFn(ctx context.Context, p *outboundContactlistProxy, name string) (*[]platformclientv2.Contactlist, *platformclientv2.APIResponse, error) { + var allContactlists []platformclientv2.Contactlist + const pageSize = 100 + + contactLists, resp, err := p.outboundApi.GetOutboundContactlists(false, false, pageSize, 1, true, "", name, []string{}, []string{}, "", "") + if err != nil { + return nil, resp, fmt.Errorf("failed to get page of contact list: %v", err) + } + + if contactLists.Entities == nil || len(*contactLists.Entities) == 0 { + return &allContactlists, resp, nil + } + + for _, contactList := range *contactLists.Entities { + allContactlists = append(allContactlists, contactList) + } + + for pageNum := 2; pageNum <= *contactLists.PageCount; pageNum++ { + contactLists, resp, err := p.outboundApi.GetOutboundContactlists(false, false, pageSize, pageNum, true, "", name, []string{}, []string{}, "", "") + if err != nil { + return nil, resp, fmt.Errorf("failed to get page of contact list : %v", err) + } + + if contactLists.Entities == nil || len(*contactLists.Entities) == 0 { + break + } + + for _, contactList := range *contactLists.Entities { + allContactlists = append(allContactlists, contactList) + } + } + + return &allContactlists, resp, nil +} + +// getOutboundContactlistIdByNameFn is an implementation of the function to get a Genesys Cloud outbound contactlist by name +func getOutboundContactlistIdByNameFn(ctx context.Context, p *outboundContactlistProxy, name string) (id string, retryable bool, response *platformclientv2.APIResponse, err error) { + contactLists, resp, err := getAllOutboundContactlistFn(ctx, p, name) + if err != nil { + return "", false, resp, fmt.Errorf("error searching outbound contact list %s: %s", name, err) + } + + var list platformclientv2.Contactlist + for _, contactList := range *contactLists { + if *contactList.Name == name { + log.Printf("Retrieved the contact list id %s by name %s", *contactList.Id, name) + list = contactList + return *list.Id, false, resp, nil + } + } + + return "", true, resp, nil +} + +// getOutboundContactlistByIdFn is an implementation of the function to get a Genesys Cloud outbound contactlist by Id +func getOutboundContactlistByIdFn(ctx context.Context, p *outboundContactlistProxy, id string) (outboundContactlist *platformclientv2.Contactlist, response *platformclientv2.APIResponse, err error) { + contactList, resp, err := p.outboundApi.GetOutboundContactlist(id, false, false) + if err != nil { + return nil, resp, err + } + return contactList, resp, nil +} + +// updateOutboundContactlistFn is an implementation of the function to update a Genesys Cloud outbound contactlist +func updateOutboundContactlistFn(ctx context.Context, p *outboundContactlistProxy, id string, outboundContactlist *platformclientv2.Contactlist) (*platformclientv2.Contactlist, *platformclientv2.APIResponse, error) { + contactList, resp, err := p.outboundApi.GetOutboundContactlist(id, false, false) + if err != nil { + return nil, resp, err + } + + outboundContactlist.Version = contactList.Version + outboundContactlist, resp, updateErr := p.outboundApi.PutOutboundContactlist(id, *outboundContactlist) + if updateErr != nil { + return nil, resp, updateErr + } + return outboundContactlist, resp, nil +} + +// deleteOutboundContactlistFn is an implementation function for deleting a Genesys Cloud outbound contactlist +func deleteOutboundContactlistFn(ctx context.Context, p *outboundContactlistProxy, id string) (response *platformclientv2.APIResponse, err error) { + return p.outboundApi.DeleteOutboundContactlist(id) +} diff --git a/genesyscloud/outbound_contact_list/outbound_contact_list_resource_init.go b/genesyscloud/outbound_contact_list/outbound_contact_list_resource_init.go index 0668e08bf..aced7f80c 100644 --- a/genesyscloud/outbound_contact_list/outbound_contact_list_resource_init.go +++ b/genesyscloud/outbound_contact_list/outbound_contact_list_resource_init.go @@ -4,8 +4,10 @@ import ( registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" ) +const resourceName = "genesyscloud_outbound_contact_list" + func SetRegistrar(regInstance registrar.Registrar) { - regInstance.RegisterDataSource("genesyscloud_outbound_contact_list", DataSourceOutboundContactList()) - regInstance.RegisterResource("genesyscloud_outbound_contact_list", ResourceOutboundContactList()) - regInstance.RegisterExporter("genesyscloud_outbound_contact_list", OutboundContactListExporter()) + regInstance.RegisterDataSource(resourceName, DataSourceOutboundContactList()) + regInstance.RegisterResource(resourceName, ResourceOutboundContactList()) + regInstance.RegisterExporter(resourceName, OutboundContactListExporter()) } diff --git a/genesyscloud/outbound_contact_list/outbound_contact_list_resource_init_test.go b/genesyscloud/outbound_contact_list/outbound_contact_list_resource_init_test.go index 927aaf1e5..722700c19 100644 --- a/genesyscloud/outbound_contact_list/outbound_contact_list_resource_init_test.go +++ b/genesyscloud/outbound_contact_list/outbound_contact_list_resource_init_test.go @@ -31,7 +31,7 @@ func (r *registerTestInstance) registerTestResources() { r.resourceMapMutex.Lock() defer r.resourceMapMutex.Unlock() - providerResources["genesyscloud_outbound_contact_list"] = ResourceOutboundContactList() + providerResources[resourceName] = ResourceOutboundContactList() providerResources["genesyscloud_outbound_attempt_limit"] = obAttemptLimit.ResourceOutboundAttemptLimit() } @@ -39,7 +39,7 @@ func (r *registerTestInstance) registerTestDataSources() { r.datasourceMapMutex.Lock() defer r.datasourceMapMutex.Unlock() - providerDataSources["genesyscloud_outbound_contact_list"] = DataSourceOutboundContactList() + providerDataSources[resourceName] = DataSourceOutboundContactList() providerDataSources["genesyscloud_outbound_attempt_limit"] = obAttemptLimit.DataSourceOutboundAttemptLimit() providerDataSources["genesyscloud_auth_division_home"] = gcloud.DataSourceAuthDivisionHome() providerDataSources["genesyscloud_auth_division_home"] = gcloud.DataSourceAuthDivisionHome() diff --git a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contact_list.go b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contact_list.go new file mode 100644 index 000000000..2890775ff --- /dev/null +++ b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contact_list.go @@ -0,0 +1,225 @@ +package outbound_contact_list + +import ( + "context" + "fmt" + "log" + "terraform-provider-genesyscloud/genesyscloud/provider" + "terraform-provider-genesyscloud/genesyscloud/util" + "terraform-provider-genesyscloud/genesyscloud/util/constants" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + + "terraform-provider-genesyscloud/genesyscloud/consistency_checker" + + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + lists "terraform-provider-genesyscloud/genesyscloud/util/lists" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" +) + +func getAllOutboundContactLists(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { + resources := make(resourceExporter.ResourceIDMetaMap) + proxy := getOutboundContactlistProxy(clientConfig) + + contactLists, resp, getErr := proxy.getAllOutboundContactlist(ctx) + if getErr != nil { + return nil, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to get contact lists error: %s", getErr), resp) + } + + for _, contactList := range *contactLists { + resources[*contactList.Id] = &resourceExporter.ResourceMeta{Name: *contactList.Name} + } + + return resources, nil +} + +func createOutboundContactList(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + name := d.Get("name").(string) + columnNames := lists.InterfaceListToStrings(d.Get("column_names").([]interface{})) + previewModeColumnName := d.Get("preview_mode_column_name").(string) + previewModeAcceptedValues := lists.InterfaceListToStrings(d.Get("preview_mode_accepted_values").([]interface{})) + automaticTimeZoneMapping := d.Get("automatic_time_zone_mapping").(bool) + zipCodeColumnName := d.Get("zip_code_column_name").(string) + + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getOutboundContactlistProxy(sdkConfig) + + sdkContactList := platformclientv2.Contactlist{ + Division: util.BuildSdkDomainEntityRef(d, "division_id"), + ColumnNames: &columnNames, + PhoneColumns: buildSdkOutboundContactListContactPhoneNumberColumnSlice(d.Get("phone_columns").(*schema.Set)), + EmailColumns: buildSdkOutboundContactListContactEmailAddressColumnSlice(d.Get("email_columns").(*schema.Set)), + PreviewModeAcceptedValues: &previewModeAcceptedValues, + AttemptLimits: util.BuildSdkDomainEntityRef(d, "attempt_limit_id"), + AutomaticTimeZoneMapping: &automaticTimeZoneMapping, + ColumnDataTypeSpecifications: buildSdkOutboundContactListColumnDataTypeSpecifications(d.Get("column_data_type_specifications").([]interface{})), + } + + if name != "" { + sdkContactList.Name = &name + } + if previewModeColumnName != "" { + sdkContactList.PreviewModeColumnName = &previewModeColumnName + } + if zipCodeColumnName != "" { + sdkContactList.ZipCodeColumnName = &zipCodeColumnName + } + + log.Printf("Creating Outbound Contact List %s", name) + outboundContactList, resp, err := proxy.createOutboundContactlist(ctx, &sdkContactList) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to create Outbound Contact List %s error: %s", name, err), resp) + } + + d.SetId(*outboundContactList.Id) + + log.Printf("Created Outbound Contact List %s %s", name, *outboundContactList.Id) + return readOutboundContactList(ctx, d, meta) +} + +func updateOutboundContactList(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + name := d.Get("name").(string) + columnNames := lists.InterfaceListToStrings(d.Get("column_names").([]interface{})) + previewModeColumnName := d.Get("preview_mode_column_name").(string) + previewModeAcceptedValues := lists.InterfaceListToStrings(d.Get("preview_mode_accepted_values").([]interface{})) + automaticTimeZoneMapping := d.Get("automatic_time_zone_mapping").(bool) + zipCodeColumnName := d.Get("zip_code_column_name").(string) + + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getOutboundContactlistProxy(sdkConfig) + + sdkContactList := platformclientv2.Contactlist{ + Division: util.BuildSdkDomainEntityRef(d, "division_id"), + ColumnNames: &columnNames, + PhoneColumns: buildSdkOutboundContactListContactPhoneNumberColumnSlice(d.Get("phone_columns").(*schema.Set)), + EmailColumns: buildSdkOutboundContactListContactEmailAddressColumnSlice(d.Get("email_columns").(*schema.Set)), + PreviewModeAcceptedValues: &previewModeAcceptedValues, + AttemptLimits: util.BuildSdkDomainEntityRef(d, "attempt_limit_id"), + AutomaticTimeZoneMapping: &automaticTimeZoneMapping, + ColumnDataTypeSpecifications: buildSdkOutboundContactListColumnDataTypeSpecifications(d.Get("column_data_type_specifications").([]interface{})), + } + + if name != "" { + sdkContactList.Name = &name + } + if previewModeColumnName != "" { + sdkContactList.PreviewModeColumnName = &previewModeColumnName + } + if zipCodeColumnName != "" { + sdkContactList.ZipCodeColumnName = &zipCodeColumnName + } + + log.Printf("Updating Outbound Contact List %s", name) + diagErr := util.RetryWhen(util.IsVersionMismatch, func() (*platformclientv2.APIResponse, diag.Diagnostics) { + + _, resp, updateErr := proxy.updateOutboundContactlist(ctx, d.Id(), &sdkContactList) + if updateErr != nil { + return resp, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to update Outbound contact list %s error: %s", name, updateErr), resp) + } + return nil, nil + }) + if diagErr != nil { + return diagErr + } + + log.Printf("Updated Outbound Contact List %s", name) + return readOutboundContactList(ctx, d, meta) +} + +func readOutboundContactList(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getOutboundContactlistProxy(sdkConfig) + cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceOutboundContactList(), constants.DefaultConsistencyChecks, resourceName) + + log.Printf("Reading Outbound Contact List %s", d.Id()) + + return util.WithRetriesForRead(ctx, d, func() *retry.RetryError { + sdkContactList, resp, getErr := proxy.getOutboundContactlistById(ctx, d.Id()) + if getErr != nil { + if util.IsStatus404(resp) { + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("failed to read Outbound Contact List %s | error: %s", d.Id(), getErr), resp)) + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("failed to read Outbound Contact List %s | error: %s", d.Id(), getErr), resp)) + } + + if sdkContactList.Name != nil { + _ = d.Set("name", *sdkContactList.Name) + } + if sdkContactList.Division != nil && sdkContactList.Division.Id != nil { + _ = d.Set("division_id", *sdkContactList.Division.Id) + } + if sdkContactList.ColumnNames != nil { + var columnNames []string + for _, name := range *sdkContactList.ColumnNames { + columnNames = append(columnNames, name) + } + _ = d.Set("column_names", columnNames) + } + if sdkContactList.PhoneColumns != nil { + _ = d.Set("phone_columns", flattenSdkOutboundContactListContactPhoneNumberColumnSlice(*sdkContactList.PhoneColumns)) + } + if sdkContactList.EmailColumns != nil { + _ = d.Set("email_columns", flattenSdkOutboundContactListContactEmailAddressColumnSlice(*sdkContactList.EmailColumns)) + } + if sdkContactList.PreviewModeColumnName != nil { + _ = d.Set("preview_mode_column_name", *sdkContactList.PreviewModeColumnName) + } + if sdkContactList.PreviewModeAcceptedValues != nil { + var acceptedValues []string + for _, val := range *sdkContactList.PreviewModeAcceptedValues { + acceptedValues = append(acceptedValues, val) + } + _ = d.Set("preview_mode_accepted_values", acceptedValues) + } + if sdkContactList.AttemptLimits != nil && sdkContactList.AttemptLimits.Id != nil { + _ = d.Set("attempt_limit_id", *sdkContactList.AttemptLimits.Id) + } + if sdkContactList.AutomaticTimeZoneMapping != nil { + _ = d.Set("automatic_time_zone_mapping", *sdkContactList.AutomaticTimeZoneMapping) + } + if sdkContactList.ZipCodeColumnName != nil { + _ = d.Set("zip_code_column_name", *sdkContactList.ZipCodeColumnName) + } + if sdkContactList.ColumnDataTypeSpecifications != nil { + _ = d.Set("column_data_type_specifications", flattenSdkOutboundContactListColumnDataTypeSpecifications(*sdkContactList.ColumnDataTypeSpecifications)) + } + + log.Printf("Read Outbound Contact List %s %s", d.Id(), *sdkContactList.Name) + return cc.CheckState(d) + }) +} + +func deleteOutboundContactList(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getOutboundContactlistProxy(sdkConfig) + + diagErr := util.RetryWhen(util.IsStatus400, func() (*platformclientv2.APIResponse, diag.Diagnostics) { + log.Printf("Deleting Outbound Contact List") + resp, err := proxy.deleteOutboundContactlist(ctx, d.Id()) + if err != nil { + return resp, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to delete Outbound Contact List %s error: %s", d.Id(), err), resp) + } + return resp, nil + }) + if diagErr != nil { + return diagErr + } + + return util.WithRetries(ctx, 30*time.Second, func() *retry.RetryError { + _, resp, err := proxy.getOutboundContactlistById(ctx, d.Id()) + if err != nil { + if util.IsStatus404(resp) { + // Outbound Contact List deleted + log.Printf("Deleted Outbound Contact List %s", d.Id()) + return nil + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("error deleting Outbound Contact List %s | error: %s", d.Id(), err), resp)) + } + + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Outbound Contact List %s still exists", d.Id()), resp)) + }) +} diff --git a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contact_list_schema.go b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contact_list_schema.go new file mode 100644 index 000000000..39d09fe70 --- /dev/null +++ b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contact_list_schema.go @@ -0,0 +1,199 @@ +package outbound_contact_list + +import ( + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" +) + +/* +resource_genesycloud_outbound_contact_list_schema.go holds three functions within it: + +1. The resource schema definitions for the outbound_contact_list resource. +2. The datasource schema definitions for the outbound_contact_list datasource. +3. The resource exporter configuration for the outbound_contact_list exporter. +*/ + +var ( + outboundContactListContactPhoneNumberColumnResource = &schema.Resource{ + Schema: map[string]*schema.Schema{ + `column_name`: { + Description: `The name of the phone column.`, + Required: true, + Type: schema.TypeString, + }, + `type`: { + Description: `Indicates the type of the phone column. For example, 'cell' or 'home'.`, + Required: true, + Type: schema.TypeString, + }, + `callable_time_column`: { + Description: `A column that indicates the timezone to use for a given contact when checking callable times. Not allowed if 'automaticTimeZoneMapping' is set to true.`, + Optional: true, + Type: schema.TypeString, + }, + }, + } + + outboundContactListEmailColumnResource = &schema.Resource{ + Schema: map[string]*schema.Schema{ + `column_name`: { + Description: `The name of the email column.`, + Required: true, + Type: schema.TypeString, + }, + `type`: { + Description: `Indicates the type of the email column. For example, 'work' or 'personal'.`, + Required: true, + Type: schema.TypeString, + }, + `contactable_time_column`: { + Description: `A column that indicates the timezone to use for a given contact when checking contactable times.`, + Optional: true, + Type: schema.TypeString, + }, + }, + } + + outboundContactListColumnDataTypeSpecification = &schema.Resource{ + Schema: map[string]*schema.Schema{ + `column_name`: { + Description: `The column name of a column selected for dynamic queueing.`, + Required: true, + Type: schema.TypeString, + }, + `column_data_type`: { + Description: `The data type of the column selected for dynamic queueing (TEXT, NUMERIC or TIMESTAMP)`, + Optional: true, + Computed: true, + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice([]string{"TEXT", "NUMERIC", "TIMESTAMP"}, false), + }, + `min`: { + Description: `The minimum length of the numeric column selected for dynamic queueing.`, + Optional: true, + Type: schema.TypeInt, + }, + `max`: { + Description: `The maximum length of the numeric column selected for dynamic queueing.`, + Optional: true, + Type: schema.TypeInt, + }, + `max_length`: { + Description: `The maximum length of the text column selected for dynamic queueing.`, + Required: true, + Type: schema.TypeInt, + }, + }, + } +) + +func ResourceOutboundContactList() *schema.Resource { + return &schema.Resource{ + Description: `Genesys Cloud Outbound Contact List`, + + CreateContext: provider.CreateWithPooledClient(createOutboundContactList), + ReadContext: provider.ReadWithPooledClient(readOutboundContactList), + UpdateContext: provider.UpdateWithPooledClient(updateOutboundContactList), + DeleteContext: provider.DeleteWithPooledClient(deleteOutboundContactList), + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + SchemaVersion: 1, + Schema: map[string]*schema.Schema{ + `name`: { + Description: `The name for the contact list.`, + Required: true, + Type: schema.TypeString, + }, + `division_id`: { + Description: `The division this entity belongs to.`, + Optional: true, + Computed: true, + Type: schema.TypeString, + }, + `column_names`: { + Description: `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`, + Required: true, + ForceNew: true, + Type: schema.TypeList, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + `phone_columns`: { + Description: `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`, + Optional: true, + ForceNew: true, + Type: schema.TypeSet, + Elem: outboundContactListContactPhoneNumberColumnResource, + }, + `email_columns`: { + Description: `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`, + Optional: true, + ForceNew: true, + Type: schema.TypeSet, + Elem: outboundContactListEmailColumnResource, + }, + `preview_mode_column_name`: { + Description: `A column to check if a contact should always be dialed in preview mode.`, + Optional: true, + Type: schema.TypeString, + }, + `preview_mode_accepted_values`: { + Description: `The values in the previewModeColumnName column that indicate a contact should always be dialed in preview mode.`, + Optional: true, + Type: schema.TypeList, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + `attempt_limit_id`: { + Description: `Attempt Limit for this ContactList.`, + Optional: true, + Type: schema.TypeString, + }, + `automatic_time_zone_mapping`: { + Description: `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`, + Optional: true, + ForceNew: true, + Type: schema.TypeBool, + }, + `zip_code_column_name`: { + Description: `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`, + Optional: true, + ForceNew: true, + Type: schema.TypeString, + }, + `column_data_type_specifications`: { + Description: `The settings of the columns selected for dynamic queueing. If updated, the contact list is dropped and recreated with a new ID`, + Optional: true, + ForceNew: true, + Type: schema.TypeList, + Elem: outboundContactListColumnDataTypeSpecification, + }, + }, + } +} + +func OutboundContactListExporter() *resourceExporter.ResourceExporter { + return &resourceExporter.ResourceExporter{ + GetResourcesFunc: provider.GetAllWithPooledClient(getAllOutboundContactLists), + RefAttrs: map[string]*resourceExporter.RefAttrSettings{ + "attempt_limit_id": {RefType: "genesyscloud_outbound_attempt_limit"}, + "division_id": {RefType: "genesyscloud_auth_division"}, + }, + } +} + +func DataSourceOutboundContactList() *schema.Resource { + return &schema.Resource{ + Description: "Data source for Genesys Cloud Outbound Contact Lists. Select a contact list by name.", + ReadContext: provider.ReadWithPooledClient(dataSourceOutboundContactListRead), + Schema: map[string]*schema.Schema{ + "name": { + Description: "Contact List name.", + Type: schema.TypeString, + Required: true, + }, + }, + } +} diff --git a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contact_list_test.go b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contact_list_test.go new file mode 100644 index 000000000..037a23526 --- /dev/null +++ b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contact_list_test.go @@ -0,0 +1,364 @@ +package outbound_contact_list + +import ( + "fmt" + "strconv" + "terraform-provider-genesyscloud/genesyscloud/provider" + "terraform-provider-genesyscloud/genesyscloud/util" + "testing" + + obAttemptLimit "terraform-provider-genesyscloud/genesyscloud/outbound_attempt_limit" + + "github.com/google/uuid" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" +) + +func TestAccResourceOutboundContactListBasic(t *testing.T) { + + t.Parallel() + var ( + resourceId = "contact-list" + name = "Test Contact List " + uuid.NewString() + previewModeColumnName = "Cell" + previewModeAcceptedValues = []string{strconv.Quote(previewModeColumnName)} + columnNames = []string{ + strconv.Quote("Cell"), + strconv.Quote("Home"), + strconv.Quote("Work"), + strconv.Quote("Personal"), + } + automaticTimeZoneMapping = util.FalseValue + attemptLimitResourceID = "attempt-limit" + attemptLimitDataSourceID = "attempt-limit-data" + attemptLimitName = "Test Attempt Limit " + uuid.NewString() + + nameUpdated = "Test Contact List " + uuid.NewString() + automaticTimeZoneMappingUpdated = util.TrueValue + zipCodeColumnName = "Zipcode" + columnNamesUpdated = append(columnNames, strconv.Quote(zipCodeColumnName)) + previewModeColumnNameUpdated = "Home" + previewModeAcceptedValuesUpdated = []string{strconv.Quote(previewModeColumnName), strconv.Quote(previewModeColumnNameUpdated)} + ) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { util.TestAccPreCheck(t) }, + ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + Steps: []resource.TestStep{ + { + Config: GenerateOutboundContactList( + resourceId, + name, + util.NullValue, + strconv.Quote(previewModeColumnName), + previewModeAcceptedValues, + columnNames, + automaticTimeZoneMapping, + util.NullValue, + util.NullValue, + GeneratePhoneColumnsBlock( + "Cell", + "cell", + strconv.Quote("Cell"), + ), + GeneratePhoneColumnsBlock( + "Home", + "home", + strconv.Quote("Home"), + ), + GenerateEmailColumnsBlock( + "Work", + "work", + util.NullValue, + ), + GenerateEmailColumnsBlock( + "Personal", + "personal", + util.NullValue, + ), + ), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "name", name), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.#", "0"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_names.#", "4"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Cell"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Home"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Work"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Personal"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.0.column_name", "Cell"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.0.type", "cell"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.0.callable_time_column", "Cell"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.1.column_name", "Home"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.1.type", "home"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.1.callable_time_column", "Home"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.1.column_name", "Work"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.1.type", "work"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.0.column_name", "Personal"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.0.type", "personal"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "preview_mode_column_name", previewModeColumnName), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "preview_mode_accepted_values.0", previewModeColumnName), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "automatic_time_zone_mapping", automaticTimeZoneMapping), + provider.TestDefaultHomeDivision(resourceName+"."+resourceId), + ), + }, + // Update + { + Config: GenerateOutboundContactList( + resourceId, + name, + util.NullValue, + strconv.Quote(previewModeColumnName), + previewModeAcceptedValuesUpdated, + columnNames, + automaticTimeZoneMapping, + util.NullValue, + util.NullValue, + GeneratePhoneColumnsBlock( + "Cell", + "cell", + strconv.Quote("Cell"), + ), + GeneratePhoneColumnsBlock( + "Home", + "home", + strconv.Quote("Home"), + ), + GenerateEmailColumnsBlock( + "Work", + "work", + util.NullValue, + ), + GenerateEmailColumnsBlock( + "Personal", + "personal", + util.NullValue, + ), + ), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "name", name), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.#", "0"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_names.#", "4"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Cell"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Home"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Work"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Personal"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.0.column_name", "Cell"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.0.type", "cell"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.0.callable_time_column", "Cell"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.1.column_name", "Home"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.1.type", "home"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.1.callable_time_column", "Home"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.1.column_name", "Work"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.1.type", "work"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.0.column_name", "Personal"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.0.type", "personal"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "preview_mode_column_name", previewModeColumnName), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "preview_mode_accepted_values.0", previewModeColumnName), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "preview_mode_accepted_values.1", previewModeColumnNameUpdated), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "automatic_time_zone_mapping", automaticTimeZoneMapping), + provider.TestDefaultHomeDivision(resourceName+"."+resourceId), + ), + }, + { + // Update (forcenew) + Config: GenerateOutboundContactList( + resourceId, + nameUpdated, + util.NullValue, + strconv.Quote(previewModeColumnNameUpdated), + previewModeAcceptedValuesUpdated, + columnNames, + automaticTimeZoneMapping, + util.NullValue, + util.NullValue, + GeneratePhoneColumnsBlock( + "Cell", + "cell", + strconv.Quote("Cell"), + ), + GeneratePhoneColumnsBlock( + "Home", + "home", + strconv.Quote("Home"), + ), + GenerateEmailColumnsBlock( + "Work", + "work", + util.NullValue, + ), + GenerateEmailColumnsBlock( + "Personal", + "personal", + util.NullValue, + ), + GeneratePhoneColumnsDataTypeSpecBlock( + strconv.Quote("Cell"), // columnName + strconv.Quote("TEXT"), // columnDataType + "1", // min + "11", // max + "10", // maxLength + ), + GeneratePhoneColumnsDataTypeSpecBlock( + strconv.Quote("Home"), // columnName + strconv.Quote("TEXT"), // columnDataType + util.NullValue, // min + util.NullValue, // max + "5", // maxLength + ), + ), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "name", nameUpdated), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_names.#", "4"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Cell"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Home"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Work"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Personal"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.0.column_name", "Cell"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.0.type", "cell"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.0.callable_time_column", "Cell"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.1.column_name", "Home"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.1.type", "home"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.1.callable_time_column", "Home"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.1.column_name", "Work"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.1.type", "work"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.0.column_name", "Personal"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.0.type", "personal"), + + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.#", "2"), + + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.0.column_name", "Cell"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.0.column_data_type", "TEXT"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.0.min", "1"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.0.max", "11"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.0.max_length", "10"), + + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.1.column_name", "Home"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.1.column_data_type", "TEXT"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.1.max_length", "5"), + + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "preview_mode_column_name", previewModeColumnNameUpdated), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "preview_mode_accepted_values.0", previewModeColumnName), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "preview_mode_accepted_values.1", previewModeColumnNameUpdated), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "automatic_time_zone_mapping", automaticTimeZoneMapping), + provider.TestDefaultHomeDivision(resourceName+"."+resourceId), + ), + }, + { + Config: obAttemptLimit.GenerateAttemptLimitResource( + attemptLimitResourceID, + attemptLimitName, + "5", + "5", + "America/Chicago", + "TODAY", + ) + obAttemptLimit.GenerateOutboundAttemptLimitDataSource( + attemptLimitDataSourceID, + attemptLimitName, + "genesyscloud_outbound_attempt_limit."+attemptLimitResourceID, + ) + `data "genesyscloud_auth_division_home" "home" {}` + GenerateOutboundContactList( + resourceId, + nameUpdated, + "data.genesyscloud_auth_division_home.home.id", + strconv.Quote(previewModeColumnNameUpdated), + previewModeAcceptedValuesUpdated, + columnNamesUpdated, + automaticTimeZoneMappingUpdated, + strconv.Quote(zipCodeColumnName), + "genesyscloud_outbound_attempt_limit."+attemptLimitResourceID+".id", + GeneratePhoneColumnsBlock( + "Cell", + "cell", + util.NullValue, + ), + GeneratePhoneColumnsBlock( + "Home", + "home", + util.NullValue, + ), + GenerateEmailColumnsBlock( + "Work", + "work", + strconv.Quote(zipCodeColumnName), + ), + GenerateEmailColumnsBlock( + "Personal", + "personal", + strconv.Quote(zipCodeColumnName), + ), + GeneratePhoneColumnsDataTypeSpecBlock( + strconv.Quote("Cell"), // columnName + strconv.Quote("TEXT"), // columnDataType + "2", // min + "12", // max + "11", // maxLength + ), + ), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "name", nameUpdated), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_names.#", "5"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Cell"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Home"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Work"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Personal"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", zipCodeColumnName), + + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "zip_code_column_name", zipCodeColumnName), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.0.column_name", "Cell"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.0.type", "cell"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.0.column_name", "Personal"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.0.type", "personal"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.0.contactable_time_column", zipCodeColumnName), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.1.column_name", "Home"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.1.type", "home"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.1.column_name", "Work"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.1.type", "work"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.1.contactable_time_column", zipCodeColumnName), + + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.#", "1"), + + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.0.column_name", "Cell"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.0.column_data_type", "TEXT"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.0.min", "2"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.0.max", "12"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.0.max_length", "11"), + + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "preview_mode_column_name", previewModeColumnNameUpdated), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "preview_mode_accepted_values.0", previewModeColumnName), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "preview_mode_accepted_values.1", previewModeColumnNameUpdated), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "automatic_time_zone_mapping", automaticTimeZoneMappingUpdated), + resource.TestCheckResourceAttrPair("data.genesyscloud_outbound_attempt_limit."+attemptLimitDataSourceID, "id", + resourceName+"."+resourceId, "attempt_limit_id"), + provider.TestDefaultHomeDivision(resourceName+"."+resourceId), + ), + }, + { + ResourceName: resourceName + "." + resourceId, + ImportState: true, + ImportStateVerify: true, + }, + }, + CheckDestroy: testVerifyContactListDestroyed, + }) +} + +func testVerifyContactListDestroyed(state *terraform.State) error { + outboundAPI := platformclientv2.NewOutboundApi() + for _, rs := range state.RootModule().Resources { + if rs.Type != resourceName { + continue + } + contactList, resp, err := outboundAPI.GetOutboundContactlist(rs.Primary.ID, false, false) + if contactList != nil { + return fmt.Errorf("contact list (%s) still exists", rs.Primary.ID) + } else if util.IsStatus404(resp) { + // Contact list not found as expected + continue + } else { + // Unexpected error + return fmt.Errorf("unexpected error: %s", err) + } + } + // Success. All contact lists destroyed + return nil +} diff --git a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contact_list_utils.go b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contact_list_utils.go new file mode 100644 index 000000000..4510ecb2a --- /dev/null +++ b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contact_list_utils.go @@ -0,0 +1,228 @@ +package outbound_contact_list + +import ( + "fmt" + "strings" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" +) + +func buildSdkOutboundContactListContactPhoneNumberColumnSlice(contactPhoneNumberColumn *schema.Set) *[]platformclientv2.Contactphonenumbercolumn { + if contactPhoneNumberColumn == nil { + return nil + } + sdkContactPhoneNumberColumnSlice := make([]platformclientv2.Contactphonenumbercolumn, 0) + contactPhoneNumberColumnList := contactPhoneNumberColumn.List() + for _, configPhoneColumn := range contactPhoneNumberColumnList { + var sdkContactPhoneNumberColumn platformclientv2.Contactphonenumbercolumn + contactPhoneNumberColumnMap := configPhoneColumn.(map[string]interface{}) + if columnName := contactPhoneNumberColumnMap["column_name"].(string); columnName != "" { + sdkContactPhoneNumberColumn.ColumnName = &columnName + } + if varType := contactPhoneNumberColumnMap["type"].(string); varType != "" { + sdkContactPhoneNumberColumn.VarType = &varType + } + if callableTimeColumn := contactPhoneNumberColumnMap["callable_time_column"].(string); callableTimeColumn != "" { + sdkContactPhoneNumberColumn.CallableTimeColumn = &callableTimeColumn + } + + sdkContactPhoneNumberColumnSlice = append(sdkContactPhoneNumberColumnSlice, sdkContactPhoneNumberColumn) + } + return &sdkContactPhoneNumberColumnSlice +} + +func flattenSdkOutboundContactListContactPhoneNumberColumnSlice(contactPhoneNumberColumns []platformclientv2.Contactphonenumbercolumn) *schema.Set { + if len(contactPhoneNumberColumns) == 0 { + return nil + } + + contactPhoneNumberColumnSet := schema.NewSet(schema.HashResource(outboundContactListContactPhoneNumberColumnResource), []interface{}{}) + for _, contactPhoneNumberColumn := range contactPhoneNumberColumns { + contactPhoneNumberColumnMap := make(map[string]interface{}) + + if contactPhoneNumberColumn.ColumnName != nil { + contactPhoneNumberColumnMap["column_name"] = *contactPhoneNumberColumn.ColumnName + } + if contactPhoneNumberColumn.VarType != nil { + contactPhoneNumberColumnMap["type"] = *contactPhoneNumberColumn.VarType + } + if contactPhoneNumberColumn.CallableTimeColumn != nil { + contactPhoneNumberColumnMap["callable_time_column"] = *contactPhoneNumberColumn.CallableTimeColumn + } + + contactPhoneNumberColumnSet.Add(contactPhoneNumberColumnMap) + } + + return contactPhoneNumberColumnSet +} + +func buildSdkOutboundContactListContactEmailAddressColumnSlice(contactEmailAddressColumn *schema.Set) *[]platformclientv2.Emailcolumn { + if contactEmailAddressColumn == nil { + return nil + } + sdkContactEmailAddressColumnSlice := make([]platformclientv2.Emailcolumn, 0) + contactEmailAddressColumnList := contactEmailAddressColumn.List() + for _, configEmailColumn := range contactEmailAddressColumnList { + var sdkContactEmailAddressColumn platformclientv2.Emailcolumn + contactEmailAddressColumnMap := configEmailColumn.(map[string]interface{}) + if columnName := contactEmailAddressColumnMap["column_name"].(string); columnName != "" { + sdkContactEmailAddressColumn.ColumnName = &columnName + } + if varType := contactEmailAddressColumnMap["type"].(string); varType != "" { + sdkContactEmailAddressColumn.VarType = &varType + } + if contactableTimeColumn := contactEmailAddressColumnMap["contactable_time_column"].(string); contactableTimeColumn != "" { + sdkContactEmailAddressColumn.ContactableTimeColumn = &contactableTimeColumn + } + + sdkContactEmailAddressColumnSlice = append(sdkContactEmailAddressColumnSlice, sdkContactEmailAddressColumn) + } + return &sdkContactEmailAddressColumnSlice +} + +func flattenSdkOutboundContactListContactEmailAddressColumnSlice(contactEmailAddressColumns []platformclientv2.Emailcolumn) *schema.Set { + if len(contactEmailAddressColumns) == 0 { + return nil + } + + contactEmailAddressColumnSet := schema.NewSet(schema.HashResource(outboundContactListEmailColumnResource), []interface{}{}) + for _, contactEmailAddressColumn := range contactEmailAddressColumns { + contactEmailAddressColumnMap := make(map[string]interface{}) + + if contactEmailAddressColumn.ColumnName != nil { + contactEmailAddressColumnMap["column_name"] = *contactEmailAddressColumn.ColumnName + } + if contactEmailAddressColumn.VarType != nil { + contactEmailAddressColumnMap["type"] = *contactEmailAddressColumn.VarType + } + if contactEmailAddressColumn.ContactableTimeColumn != nil { + contactEmailAddressColumnMap["contactable_time_column"] = *contactEmailAddressColumn.ContactableTimeColumn + } + + contactEmailAddressColumnSet.Add(contactEmailAddressColumnMap) + } + + return contactEmailAddressColumnSet +} + +func buildSdkOutboundContactListColumnDataTypeSpecifications(columnDataTypeSpecifications []interface{}) *[]platformclientv2.Columndatatypespecification { + if columnDataTypeSpecifications == nil || len(columnDataTypeSpecifications) < 1 { + return nil + } + + sdkColumnDataTypeSpecificationsSlice := make([]platformclientv2.Columndatatypespecification, 0) + + for _, spec := range columnDataTypeSpecifications { + if specMap, ok := spec.(map[string]interface{}); ok { + var sdkColumnDataTypeSpecification platformclientv2.Columndatatypespecification + if columnNameStr, ok := specMap["column_name"].(string); ok { + sdkColumnDataTypeSpecification.ColumnName = &columnNameStr + } + if columnDataTypeStr, ok := specMap["column_data_type"].(string); ok && columnDataTypeStr != "" { + sdkColumnDataTypeSpecification.ColumnDataType = &columnDataTypeStr + } + if minInt, ok := specMap["min"].(int); ok { + sdkColumnDataTypeSpecification.Min = &minInt + } + if maxInt, ok := specMap["max"].(int); ok { + sdkColumnDataTypeSpecification.Max = &maxInt + } + if maxLengthInt, ok := specMap["max_length"].(int); ok { + sdkColumnDataTypeSpecification.MaxLength = &maxLengthInt + } + sdkColumnDataTypeSpecificationsSlice = append(sdkColumnDataTypeSpecificationsSlice, sdkColumnDataTypeSpecification) + } + } + + return &sdkColumnDataTypeSpecificationsSlice +} + +func flattenSdkOutboundContactListColumnDataTypeSpecifications(columnDataTypeSpecifications []platformclientv2.Columndatatypespecification) []interface{} { + if columnDataTypeSpecifications == nil || len(columnDataTypeSpecifications) == 0 { + return nil + } + + columnDataTypeSpecificationsSlice := make([]interface{}, 0) + + for _, s := range columnDataTypeSpecifications { + columnDataTypeSpecification := make(map[string]interface{}) + columnDataTypeSpecification["column_name"] = *s.ColumnName + + if s.ColumnDataType != nil { + columnDataTypeSpecification["column_data_type"] = *s.ColumnDataType + } + if s.Min != nil { + columnDataTypeSpecification["min"] = *s.Min + } + if s.Max != nil { + columnDataTypeSpecification["max"] = *s.Max + } + if s.MaxLength != nil { + columnDataTypeSpecification["max_length"] = *s.MaxLength + } + + columnDataTypeSpecificationsSlice = append(columnDataTypeSpecificationsSlice, columnDataTypeSpecification) + } + + return columnDataTypeSpecificationsSlice +} + +func GeneratePhoneColumnsBlock(columnName, columnType, callableTimeColumn string) string { + return fmt.Sprintf(` + phone_columns { + column_name = "%s" + type = "%s" + callable_time_column = %s + } +`, columnName, columnType, callableTimeColumn) +} + +func GenerateOutboundContactList( + resourceId string, + name string, + divisionId string, + previewModeColumnName string, + previewModeAcceptedValues []string, + columnNames []string, + automaticTimeZoneMapping string, + zipCodeColumnName string, + attemptLimitId string, + nestedBlocks ...string) string { + return fmt.Sprintf(` +resource "%s" "%s" { + name = "%s" + division_id = %s + preview_mode_column_name = %s + preview_mode_accepted_values = [%s] + column_names = [%s] + automatic_time_zone_mapping = %s + zip_code_column_name = %s + attempt_limit_id = %s + %s +} +`, resourceName, resourceId, name, divisionId, previewModeColumnName, strings.Join(previewModeAcceptedValues, ", "), + strings.Join(columnNames, ", "), automaticTimeZoneMapping, zipCodeColumnName, attemptLimitId, strings.Join(nestedBlocks, "\n")) +} + +func GeneratePhoneColumnsDataTypeSpecBlock(columnName, columnDataType, min, max, maxLength string) string { + return fmt.Sprintf(` + column_data_type_specifications { + column_name = %s + column_data_type = %s + min = %s + max = %s + max_length = %s + } + `, columnName, columnDataType, min, max, maxLength) +} + +func GenerateEmailColumnsBlock(columnName, columnType, contactableTimeColumn string) string { + return fmt.Sprintf(` + email_columns { + column_name = "%s" + type = "%s" + contactable_time_column = %s + } +`, columnName, columnType, contactableTimeColumn) +} diff --git a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist.go b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist.go deleted file mode 100644 index 3e0b05fdf..000000000 --- a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist.go +++ /dev/null @@ -1,637 +0,0 @@ -package outbound_contact_list - -import ( - "context" - "fmt" - "log" - "strings" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" - "terraform-provider-genesyscloud/genesyscloud/util/constants" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - - "terraform-provider-genesyscloud/genesyscloud/consistency_checker" - - resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" - lists "terraform-provider-genesyscloud/genesyscloud/util/lists" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" -) - -const ( - resourceName = "genesyscloud_outbound_contactlist" -) - -var ( - outboundContactListContactPhoneNumberColumnResource = &schema.Resource{ - Schema: map[string]*schema.Schema{ - `column_name`: { - Description: `The name of the phone column.`, - Required: true, - Type: schema.TypeString, - }, - `type`: { - Description: `Indicates the type of the phone column. For example, 'cell' or 'home'.`, - Required: true, - Type: schema.TypeString, - }, - `callable_time_column`: { - Description: `A column that indicates the timezone to use for a given contact when checking callable times. Not allowed if 'automaticTimeZoneMapping' is set to true.`, - Optional: true, - Type: schema.TypeString, - }, - }, - } - - outboundContactListEmailColumnResource = &schema.Resource{ - Schema: map[string]*schema.Schema{ - `column_name`: { - Description: `The name of the email column.`, - Required: true, - Type: schema.TypeString, - }, - `type`: { - Description: `Indicates the type of the email column. For example, 'work' or 'personal'.`, - Required: true, - Type: schema.TypeString, - }, - `contactable_time_column`: { - Description: `A column that indicates the timezone to use for a given contact when checking contactable times.`, - Optional: true, - Type: schema.TypeString, - }, - }, - } - - outboundContactListColumnDataTypeSpecification = &schema.Resource{ - Schema: map[string]*schema.Schema{ - `column_name`: { - Description: `The column name of a column selected for dynamic queueing.`, - Required: true, - Type: schema.TypeString, - }, - `column_data_type`: { - Description: `The data type of the column selected for dynamic queueing (TEXT, NUMERIC or TIMESTAMP)`, - Optional: true, - Computed: true, - Type: schema.TypeString, - ValidateFunc: validation.StringInSlice([]string{"TEXT", "NUMERIC", "TIMESTAMP"}, false), - }, - `min`: { - Description: `The minimum length of the numeric column selected for dynamic queueing.`, - Optional: true, - Type: schema.TypeInt, - }, - `max`: { - Description: `The maximum length of the numeric column selected for dynamic queueing.`, - Optional: true, - Type: schema.TypeInt, - }, - `max_length`: { - Description: `The maximum length of the text column selected for dynamic queueing.`, - Required: true, - Type: schema.TypeInt, - }, - }, - } -) - -func getAllOutboundContactLists(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { - resources := make(resourceExporter.ResourceIDMetaMap) - outboundAPI := platformclientv2.NewOutboundApiWithConfig(clientConfig) - - for pageNum := 1; ; pageNum++ { - const pageSize = 100 - contactListConfigs, resp, getErr := outboundAPI.GetOutboundContactlists(false, false, pageSize, pageNum, true, "", "", []string{}, []string{}, "", "") - if getErr != nil { - return nil, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to get page of contact list configs error: %s", getErr), resp) - } - - if contactListConfigs.Entities == nil || len(*contactListConfigs.Entities) == 0 { - break - } - - for _, contactListConfig := range *contactListConfigs.Entities { - resources[*contactListConfig.Id] = &resourceExporter.ResourceMeta{Name: *contactListConfig.Name} - } - } - - return resources, nil -} - -func OutboundContactListExporter() *resourceExporter.ResourceExporter { - return &resourceExporter.ResourceExporter{ - GetResourcesFunc: provider.GetAllWithPooledClient(getAllOutboundContactLists), - RefAttrs: map[string]*resourceExporter.RefAttrSettings{ - "attempt_limit_id": {RefType: "genesyscloud_outbound_attempt_limit"}, - "division_id": {RefType: "genesyscloud_auth_division"}, - }, - } -} - -func ResourceOutboundContactList() *schema.Resource { - return &schema.Resource{ - Description: `Genesys Cloud Outbound Contact List`, - - CreateContext: provider.CreateWithPooledClient(createOutboundContactList), - ReadContext: provider.ReadWithPooledClient(readOutboundContactList), - UpdateContext: provider.UpdateWithPooledClient(updateOutboundContactList), - DeleteContext: provider.DeleteWithPooledClient(deleteOutboundContactList), - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - SchemaVersion: 1, - Schema: map[string]*schema.Schema{ - `name`: { - Description: `The name for the contact list.`, - Required: true, - Type: schema.TypeString, - }, - `division_id`: { - Description: `The division this entity belongs to.`, - Optional: true, - Computed: true, - Type: schema.TypeString, - }, - `column_names`: { - Description: `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`, - Required: true, - ForceNew: true, - Type: schema.TypeList, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - `phone_columns`: { - Description: `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`, - Optional: true, - ForceNew: true, - Type: schema.TypeSet, - Elem: outboundContactListContactPhoneNumberColumnResource, - }, - `email_columns`: { - Description: `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`, - Optional: true, - ForceNew: true, - Type: schema.TypeSet, - Elem: outboundContactListEmailColumnResource, - }, - `preview_mode_column_name`: { - Description: `A column to check if a contact should always be dialed in preview mode.`, - Optional: true, - Type: schema.TypeString, - }, - `preview_mode_accepted_values`: { - Description: `The values in the previewModeColumnName column that indicate a contact should always be dialed in preview mode.`, - Optional: true, - Type: schema.TypeList, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - `attempt_limit_id`: { - Description: `Attempt Limit for this ContactList.`, - Optional: true, - Type: schema.TypeString, - }, - `automatic_time_zone_mapping`: { - Description: `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`, - Optional: true, - ForceNew: true, - Type: schema.TypeBool, - }, - `zip_code_column_name`: { - Description: `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`, - Optional: true, - ForceNew: true, - Type: schema.TypeString, - }, - `column_data_type_specifications`: { - Description: `The settings of the columns selected for dynamic queueing. If updated, the contact list is dropped and recreated with a new ID`, - Optional: true, - ForceNew: true, - Type: schema.TypeList, - Elem: outboundContactListColumnDataTypeSpecification, - }, - }, - } -} - -func createOutboundContactList(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - name := d.Get("name").(string) - columnNames := lists.InterfaceListToStrings(d.Get("column_names").([]interface{})) - previewModeColumnName := d.Get("preview_mode_column_name").(string) - previewModeAcceptedValues := lists.InterfaceListToStrings(d.Get("preview_mode_accepted_values").([]interface{})) - automaticTimeZoneMapping := d.Get("automatic_time_zone_mapping").(bool) - zipCodeColumnName := d.Get("zip_code_column_name").(string) - - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - outboundApi := platformclientv2.NewOutboundApiWithConfig(sdkConfig) - - sdkContactList := platformclientv2.Contactlist{ - Division: util.BuildSdkDomainEntityRef(d, "division_id"), - ColumnNames: &columnNames, - PhoneColumns: buildSdkOutboundContactListContactPhoneNumberColumnSlice(d.Get("phone_columns").(*schema.Set)), - EmailColumns: buildSdkOutboundContactListContactEmailAddressColumnSlice(d.Get("email_columns").(*schema.Set)), - PreviewModeAcceptedValues: &previewModeAcceptedValues, - AttemptLimits: util.BuildSdkDomainEntityRef(d, "attempt_limit_id"), - AutomaticTimeZoneMapping: &automaticTimeZoneMapping, - ColumnDataTypeSpecifications: buildSdkOutboundContactListColumnDataTypeSpecifications(d.Get("column_data_type_specifications").([]interface{})), - } - - if name != "" { - sdkContactList.Name = &name - } - if previewModeColumnName != "" { - sdkContactList.PreviewModeColumnName = &previewModeColumnName - } - if zipCodeColumnName != "" { - sdkContactList.ZipCodeColumnName = &zipCodeColumnName - } - - log.Printf("Creating Outbound Contact List %s", name) - outboundContactList, resp, err := outboundApi.PostOutboundContactlists(sdkContactList) - if err != nil { - return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to create Outbound Contact List %s error: %s", name, err), resp) - } - - d.SetId(*outboundContactList.Id) - - log.Printf("Created Outbound Contact List %s %s", name, *outboundContactList.Id) - return readOutboundContactList(ctx, d, meta) -} - -func updateOutboundContactList(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - name := d.Get("name").(string) - columnNames := lists.InterfaceListToStrings(d.Get("column_names").([]interface{})) - previewModeColumnName := d.Get("preview_mode_column_name").(string) - previewModeAcceptedValues := lists.InterfaceListToStrings(d.Get("preview_mode_accepted_values").([]interface{})) - automaticTimeZoneMapping := d.Get("automatic_time_zone_mapping").(bool) - zipCodeColumnName := d.Get("zip_code_column_name").(string) - - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - outboundApi := platformclientv2.NewOutboundApiWithConfig(sdkConfig) - - sdkContactList := platformclientv2.Contactlist{ - Division: util.BuildSdkDomainEntityRef(d, "division_id"), - ColumnNames: &columnNames, - PhoneColumns: buildSdkOutboundContactListContactPhoneNumberColumnSlice(d.Get("phone_columns").(*schema.Set)), - EmailColumns: buildSdkOutboundContactListContactEmailAddressColumnSlice(d.Get("email_columns").(*schema.Set)), - PreviewModeAcceptedValues: &previewModeAcceptedValues, - AttemptLimits: util.BuildSdkDomainEntityRef(d, "attempt_limit_id"), - AutomaticTimeZoneMapping: &automaticTimeZoneMapping, - ColumnDataTypeSpecifications: buildSdkOutboundContactListColumnDataTypeSpecifications(d.Get("column_data_type_specifications").([]interface{})), - } - - if name != "" { - sdkContactList.Name = &name - } - if previewModeColumnName != "" { - sdkContactList.PreviewModeColumnName = &previewModeColumnName - } - if zipCodeColumnName != "" { - sdkContactList.ZipCodeColumnName = &zipCodeColumnName - } - - log.Printf("Updating Outbound Contact List %s", name) - diagErr := util.RetryWhen(util.IsVersionMismatch, func() (*platformclientv2.APIResponse, diag.Diagnostics) { - // Get current Outbound Contact list version - outboundContactList, resp, getErr := outboundApi.GetOutboundContactlist(d.Id(), false, false) - if getErr != nil { - return resp, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to read Outbound Contact List %s error: %s", d.Id(), getErr), resp) - } - sdkContactList.Version = outboundContactList.Version - outboundContactList, resp, updateErr := outboundApi.PutOutboundContactlist(d.Id(), sdkContactList) - if updateErr != nil { - return resp, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to update Outbound contact list %s error: %s", name, updateErr), resp) - } - return nil, nil - }) - if diagErr != nil { - return diagErr - } - - log.Printf("Updated Outbound Contact List %s", name) - return readOutboundContactList(ctx, d, meta) -} - -func readOutboundContactList(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - outboundApi := platformclientv2.NewOutboundApiWithConfig(sdkConfig) - cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceOutboundContactList(), constants.DefaultConsistencyChecks, resourceName) - - log.Printf("Reading Outbound Contact List %s", d.Id()) - - return util.WithRetriesForRead(ctx, d, func() *retry.RetryError { - sdkContactList, resp, getErr := outboundApi.GetOutboundContactlist(d.Id(), false, false) - if getErr != nil { - if util.IsStatus404(resp) { - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("failed to read Outbound Contact List %s | error: %s", d.Id(), getErr), resp)) - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("failed to read Outbound Contact List %s | error: %s", d.Id(), getErr), resp)) - } - - if sdkContactList.Name != nil { - _ = d.Set("name", *sdkContactList.Name) - } - if sdkContactList.Division != nil && sdkContactList.Division.Id != nil { - _ = d.Set("division_id", *sdkContactList.Division.Id) - } - if sdkContactList.ColumnNames != nil { - var columnNames []string - for _, name := range *sdkContactList.ColumnNames { - columnNames = append(columnNames, name) - } - _ = d.Set("column_names", columnNames) - } - if sdkContactList.PhoneColumns != nil { - _ = d.Set("phone_columns", flattenSdkOutboundContactListContactPhoneNumberColumnSlice(*sdkContactList.PhoneColumns)) - } - if sdkContactList.EmailColumns != nil { - _ = d.Set("email_columns", flattenSdkOutboundContactListContactEmailAddressColumnSlice(*sdkContactList.EmailColumns)) - } - if sdkContactList.PreviewModeColumnName != nil { - _ = d.Set("preview_mode_column_name", *sdkContactList.PreviewModeColumnName) - } - if sdkContactList.PreviewModeAcceptedValues != nil { - var acceptedValues []string - for _, val := range *sdkContactList.PreviewModeAcceptedValues { - acceptedValues = append(acceptedValues, val) - } - _ = d.Set("preview_mode_accepted_values", acceptedValues) - } - if sdkContactList.AttemptLimits != nil && sdkContactList.AttemptLimits.Id != nil { - _ = d.Set("attempt_limit_id", *sdkContactList.AttemptLimits.Id) - } - if sdkContactList.AutomaticTimeZoneMapping != nil { - _ = d.Set("automatic_time_zone_mapping", *sdkContactList.AutomaticTimeZoneMapping) - } - if sdkContactList.ZipCodeColumnName != nil { - _ = d.Set("zip_code_column_name", *sdkContactList.ZipCodeColumnName) - } - if sdkContactList.ColumnDataTypeSpecifications != nil { - _ = d.Set("column_data_type_specifications", flattenSdkOutboundContactListColumnDataTypeSpecifications(*sdkContactList.ColumnDataTypeSpecifications)) - } - - log.Printf("Read Outbound Contact List %s %s", d.Id(), *sdkContactList.Name) - return cc.CheckState(d) - }) -} - -func deleteOutboundContactList(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - outboundApi := platformclientv2.NewOutboundApiWithConfig(sdkConfig) - - diagErr := util.RetryWhen(util.IsStatus400, func() (*platformclientv2.APIResponse, diag.Diagnostics) { - log.Printf("Deleting Outbound Contact List") - resp, err := outboundApi.DeleteOutboundContactlist(d.Id()) - if err != nil { - return resp, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to delete Outbound Contact List %s error: %s", d.Id(), err), resp) - } - return resp, nil - }) - if diagErr != nil { - return diagErr - } - - return util.WithRetries(ctx, 30*time.Second, func() *retry.RetryError { - _, resp, err := outboundApi.GetOutboundContactlist(d.Id(), false, false) - if err != nil { - if util.IsStatus404(resp) { - // Outbound Contact List deleted - log.Printf("Deleted Outbound Contact List %s", d.Id()) - return nil - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("error deleting Outbound Contact List %s | error: %s", d.Id(), err), resp)) - } - - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Outbound Contact List %s still exists", d.Id()), resp)) - }) -} - -func buildSdkOutboundContactListContactPhoneNumberColumnSlice(contactPhoneNumberColumn *schema.Set) *[]platformclientv2.Contactphonenumbercolumn { - if contactPhoneNumberColumn == nil { - return nil - } - sdkContactPhoneNumberColumnSlice := make([]platformclientv2.Contactphonenumbercolumn, 0) - contactPhoneNumberColumnList := contactPhoneNumberColumn.List() - for _, configPhoneColumn := range contactPhoneNumberColumnList { - var sdkContactPhoneNumberColumn platformclientv2.Contactphonenumbercolumn - contactPhoneNumberColumnMap := configPhoneColumn.(map[string]interface{}) - if columnName := contactPhoneNumberColumnMap["column_name"].(string); columnName != "" { - sdkContactPhoneNumberColumn.ColumnName = &columnName - } - if varType := contactPhoneNumberColumnMap["type"].(string); varType != "" { - sdkContactPhoneNumberColumn.VarType = &varType - } - if callableTimeColumn := contactPhoneNumberColumnMap["callable_time_column"].(string); callableTimeColumn != "" { - sdkContactPhoneNumberColumn.CallableTimeColumn = &callableTimeColumn - } - - sdkContactPhoneNumberColumnSlice = append(sdkContactPhoneNumberColumnSlice, sdkContactPhoneNumberColumn) - } - return &sdkContactPhoneNumberColumnSlice -} - -func flattenSdkOutboundContactListContactPhoneNumberColumnSlice(contactPhoneNumberColumns []platformclientv2.Contactphonenumbercolumn) *schema.Set { - if len(contactPhoneNumberColumns) == 0 { - return nil - } - - contactPhoneNumberColumnSet := schema.NewSet(schema.HashResource(outboundContactListContactPhoneNumberColumnResource), []interface{}{}) - for _, contactPhoneNumberColumn := range contactPhoneNumberColumns { - contactPhoneNumberColumnMap := make(map[string]interface{}) - - if contactPhoneNumberColumn.ColumnName != nil { - contactPhoneNumberColumnMap["column_name"] = *contactPhoneNumberColumn.ColumnName - } - if contactPhoneNumberColumn.VarType != nil { - contactPhoneNumberColumnMap["type"] = *contactPhoneNumberColumn.VarType - } - if contactPhoneNumberColumn.CallableTimeColumn != nil { - contactPhoneNumberColumnMap["callable_time_column"] = *contactPhoneNumberColumn.CallableTimeColumn - } - - contactPhoneNumberColumnSet.Add(contactPhoneNumberColumnMap) - } - - return contactPhoneNumberColumnSet -} - -func buildSdkOutboundContactListContactEmailAddressColumnSlice(contactEmailAddressColumn *schema.Set) *[]platformclientv2.Emailcolumn { - if contactEmailAddressColumn == nil { - return nil - } - sdkContactEmailAddressColumnSlice := make([]platformclientv2.Emailcolumn, 0) - contactEmailAddressColumnList := contactEmailAddressColumn.List() - for _, configEmailColumn := range contactEmailAddressColumnList { - var sdkContactEmailAddressColumn platformclientv2.Emailcolumn - contactEmailAddressColumnMap := configEmailColumn.(map[string]interface{}) - if columnName := contactEmailAddressColumnMap["column_name"].(string); columnName != "" { - sdkContactEmailAddressColumn.ColumnName = &columnName - } - if varType := contactEmailAddressColumnMap["type"].(string); varType != "" { - sdkContactEmailAddressColumn.VarType = &varType - } - if contactableTimeColumn := contactEmailAddressColumnMap["contactable_time_column"].(string); contactableTimeColumn != "" { - sdkContactEmailAddressColumn.ContactableTimeColumn = &contactableTimeColumn - } - - sdkContactEmailAddressColumnSlice = append(sdkContactEmailAddressColumnSlice, sdkContactEmailAddressColumn) - } - return &sdkContactEmailAddressColumnSlice -} - -func flattenSdkOutboundContactListContactEmailAddressColumnSlice(contactEmailAddressColumns []platformclientv2.Emailcolumn) *schema.Set { - if len(contactEmailAddressColumns) == 0 { - return nil - } - - contactEmailAddressColumnSet := schema.NewSet(schema.HashResource(outboundContactListEmailColumnResource), []interface{}{}) - for _, contactEmailAddressColumn := range contactEmailAddressColumns { - contactEmailAddressColumnMap := make(map[string]interface{}) - - if contactEmailAddressColumn.ColumnName != nil { - contactEmailAddressColumnMap["column_name"] = *contactEmailAddressColumn.ColumnName - } - if contactEmailAddressColumn.VarType != nil { - contactEmailAddressColumnMap["type"] = *contactEmailAddressColumn.VarType - } - if contactEmailAddressColumn.ContactableTimeColumn != nil { - contactEmailAddressColumnMap["contactable_time_column"] = *contactEmailAddressColumn.ContactableTimeColumn - } - - contactEmailAddressColumnSet.Add(contactEmailAddressColumnMap) - } - - return contactEmailAddressColumnSet -} - -func buildSdkOutboundContactListColumnDataTypeSpecifications(columnDataTypeSpecifications []interface{}) *[]platformclientv2.Columndatatypespecification { - if columnDataTypeSpecifications == nil || len(columnDataTypeSpecifications) < 1 { - return nil - } - - sdkColumnDataTypeSpecificationsSlice := make([]platformclientv2.Columndatatypespecification, 0) - - for _, spec := range columnDataTypeSpecifications { - if specMap, ok := spec.(map[string]interface{}); ok { - var sdkColumnDataTypeSpecification platformclientv2.Columndatatypespecification - if columnNameStr, ok := specMap["column_name"].(string); ok { - sdkColumnDataTypeSpecification.ColumnName = &columnNameStr - } - if columnDataTypeStr, ok := specMap["column_data_type"].(string); ok && columnDataTypeStr != "" { - sdkColumnDataTypeSpecification.ColumnDataType = &columnDataTypeStr - } - if minInt, ok := specMap["min"].(int); ok { - sdkColumnDataTypeSpecification.Min = &minInt - } - if maxInt, ok := specMap["max"].(int); ok { - sdkColumnDataTypeSpecification.Max = &maxInt - } - if maxLengthInt, ok := specMap["max_length"].(int); ok { - sdkColumnDataTypeSpecification.MaxLength = &maxLengthInt - } - sdkColumnDataTypeSpecificationsSlice = append(sdkColumnDataTypeSpecificationsSlice, sdkColumnDataTypeSpecification) - } - } - - return &sdkColumnDataTypeSpecificationsSlice -} - -func flattenSdkOutboundContactListColumnDataTypeSpecifications(columnDataTypeSpecifications []platformclientv2.Columndatatypespecification) []interface{} { - if columnDataTypeSpecifications == nil || len(columnDataTypeSpecifications) == 0 { - return nil - } - - columnDataTypeSpecificationsSlice := make([]interface{}, 0) - - for _, s := range columnDataTypeSpecifications { - columnDataTypeSpecification := make(map[string]interface{}) - columnDataTypeSpecification["column_name"] = *s.ColumnName - - if s.ColumnDataType != nil { - columnDataTypeSpecification["column_data_type"] = *s.ColumnDataType - } - if s.Min != nil { - columnDataTypeSpecification["min"] = *s.Min - } - if s.Max != nil { - columnDataTypeSpecification["max"] = *s.Max - } - if s.MaxLength != nil { - columnDataTypeSpecification["max_length"] = *s.MaxLength - } - - columnDataTypeSpecificationsSlice = append(columnDataTypeSpecificationsSlice, columnDataTypeSpecification) - } - - return columnDataTypeSpecificationsSlice -} - -// type OutboundContactListInstance struct{ -// } - -// func (*OutboundContactListInstance) ResourceOutboundContactList() *schema.Resource { -// ResourceOutboundContactList() *schema.Resource -// } - -func GeneratePhoneColumnsBlock(columnName, columnType, callableTimeColumn string) string { - return fmt.Sprintf(` - phone_columns { - column_name = "%s" - type = "%s" - callable_time_column = %s - } -`, columnName, columnType, callableTimeColumn) -} - -func GenerateOutboundContactList( - resourceId string, - name string, - divisionId string, - previewModeColumnName string, - previewModeAcceptedValues []string, - columnNames []string, - automaticTimeZoneMapping string, - zipCodeColumnName string, - attemptLimitId string, - nestedBlocks ...string) string { - return fmt.Sprintf(` -resource "genesyscloud_outbound_contact_list" "%s" { - name = "%s" - division_id = %s - preview_mode_column_name = %s - preview_mode_accepted_values = [%s] - column_names = [%s] - automatic_time_zone_mapping = %s - zip_code_column_name = %s - attempt_limit_id = %s - %s -} -`, resourceId, name, divisionId, previewModeColumnName, strings.Join(previewModeAcceptedValues, ", "), - strings.Join(columnNames, ", "), automaticTimeZoneMapping, zipCodeColumnName, attemptLimitId, strings.Join(nestedBlocks, "\n")) -} - -func GeneratePhoneColumnsDataTypeSpecBlock(columnName, columnDataType, min, max, maxLength string) string { - return fmt.Sprintf(` - column_data_type_specifications { - column_name = %s - column_data_type = %s - min = %s - max = %s - max_length = %s - } - `, columnName, columnDataType, min, max, maxLength) -} - -func GenerateEmailColumnsBlock(columnName, columnType, contactableTimeColumn string) string { - return fmt.Sprintf(` - email_columns { - column_name = "%s" - type = "%s" - contactable_time_column = %s - } -`, columnName, columnType, contactableTimeColumn) -} diff --git a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist_test.go b/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist_test.go deleted file mode 100644 index a07bfdedf..000000000 --- a/genesyscloud/outbound_contact_list/resource_genesyscloud_outbound_contactlist_test.go +++ /dev/null @@ -1,364 +0,0 @@ -package outbound_contact_list - -import ( - "fmt" - "strconv" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" - "testing" - - obAttemptLimit "terraform-provider-genesyscloud/genesyscloud/outbound_attempt_limit" - - "github.com/google/uuid" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" -) - -func TestAccResourceOutboundContactListBasic(t *testing.T) { - - t.Parallel() - var ( - resourceId = "contact-list" - name = "Test Contact List " + uuid.NewString() - previewModeColumnName = "Cell" - previewModeAcceptedValues = []string{strconv.Quote(previewModeColumnName)} - columnNames = []string{ - strconv.Quote("Cell"), - strconv.Quote("Home"), - strconv.Quote("Work"), - strconv.Quote("Personal"), - } - automaticTimeZoneMapping = util.FalseValue - attemptLimitResourceID = "attempt-limit" - attemptLimitDataSourceID = "attempt-limit-data" - attemptLimitName = "Test Attempt Limit " + uuid.NewString() - - nameUpdated = "Test Contact List " + uuid.NewString() - automaticTimeZoneMappingUpdated = util.TrueValue - zipCodeColumnName = "Zipcode" - columnNamesUpdated = append(columnNames, strconv.Quote(zipCodeColumnName)) - previewModeColumnNameUpdated = "Home" - previewModeAcceptedValuesUpdated = []string{strconv.Quote(previewModeColumnName), strconv.Quote(previewModeColumnNameUpdated)} - ) - - resource.Test(t, resource.TestCase{ - PreCheck: func() { util.TestAccPreCheck(t) }, - ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), - Steps: []resource.TestStep{ - { - Config: GenerateOutboundContactList( - resourceId, - name, - util.NullValue, - strconv.Quote(previewModeColumnName), - previewModeAcceptedValues, - columnNames, - automaticTimeZoneMapping, - util.NullValue, - util.NullValue, - GeneratePhoneColumnsBlock( - "Cell", - "cell", - strconv.Quote("Cell"), - ), - GeneratePhoneColumnsBlock( - "Home", - "home", - strconv.Quote("Home"), - ), - GenerateEmailColumnsBlock( - "Work", - "work", - util.NullValue, - ), - GenerateEmailColumnsBlock( - "Personal", - "personal", - util.NullValue, - ), - ), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "name", name), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "column_data_type_specifications.#", "0"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "column_names.#", "4"), - util.ValidateStringInArray("genesyscloud_outbound_contact_list."+resourceId, "column_names", "Cell"), - util.ValidateStringInArray("genesyscloud_outbound_contact_list."+resourceId, "column_names", "Home"), - util.ValidateStringInArray("genesyscloud_outbound_contact_list."+resourceId, "column_names", "Work"), - util.ValidateStringInArray("genesyscloud_outbound_contact_list."+resourceId, "column_names", "Personal"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "phone_columns.0.column_name", "Cell"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "phone_columns.0.type", "cell"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "phone_columns.0.callable_time_column", "Cell"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "phone_columns.1.column_name", "Home"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "phone_columns.1.type", "home"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "phone_columns.1.callable_time_column", "Home"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "email_columns.1.column_name", "Work"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "email_columns.1.type", "work"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "email_columns.0.column_name", "Personal"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "email_columns.0.type", "personal"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "preview_mode_column_name", previewModeColumnName), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "preview_mode_accepted_values.0", previewModeColumnName), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "automatic_time_zone_mapping", automaticTimeZoneMapping), - provider.TestDefaultHomeDivision("genesyscloud_outbound_contact_list."+resourceId), - ), - }, - // Update - { - Config: GenerateOutboundContactList( - resourceId, - name, - util.NullValue, - strconv.Quote(previewModeColumnName), - previewModeAcceptedValuesUpdated, - columnNames, - automaticTimeZoneMapping, - util.NullValue, - util.NullValue, - GeneratePhoneColumnsBlock( - "Cell", - "cell", - strconv.Quote("Cell"), - ), - GeneratePhoneColumnsBlock( - "Home", - "home", - strconv.Quote("Home"), - ), - GenerateEmailColumnsBlock( - "Work", - "work", - util.NullValue, - ), - GenerateEmailColumnsBlock( - "Personal", - "personal", - util.NullValue, - ), - ), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "name", name), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "column_data_type_specifications.#", "0"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "column_names.#", "4"), - util.ValidateStringInArray("genesyscloud_outbound_contact_list."+resourceId, "column_names", "Cell"), - util.ValidateStringInArray("genesyscloud_outbound_contact_list."+resourceId, "column_names", "Home"), - util.ValidateStringInArray("genesyscloud_outbound_contact_list."+resourceId, "column_names", "Work"), - util.ValidateStringInArray("genesyscloud_outbound_contact_list."+resourceId, "column_names", "Personal"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "phone_columns.0.column_name", "Cell"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "phone_columns.0.type", "cell"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "phone_columns.0.callable_time_column", "Cell"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "phone_columns.1.column_name", "Home"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "phone_columns.1.type", "home"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "phone_columns.1.callable_time_column", "Home"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "email_columns.1.column_name", "Work"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "email_columns.1.type", "work"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "email_columns.0.column_name", "Personal"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "email_columns.0.type", "personal"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "preview_mode_column_name", previewModeColumnName), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "preview_mode_accepted_values.0", previewModeColumnName), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "preview_mode_accepted_values.1", previewModeColumnNameUpdated), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "automatic_time_zone_mapping", automaticTimeZoneMapping), - provider.TestDefaultHomeDivision("genesyscloud_outbound_contact_list."+resourceId), - ), - }, - { - // Update (forcenew) - Config: GenerateOutboundContactList( - resourceId, - nameUpdated, - util.NullValue, - strconv.Quote(previewModeColumnNameUpdated), - previewModeAcceptedValuesUpdated, - columnNames, - automaticTimeZoneMapping, - util.NullValue, - util.NullValue, - GeneratePhoneColumnsBlock( - "Cell", - "cell", - strconv.Quote("Cell"), - ), - GeneratePhoneColumnsBlock( - "Home", - "home", - strconv.Quote("Home"), - ), - GenerateEmailColumnsBlock( - "Work", - "work", - util.NullValue, - ), - GenerateEmailColumnsBlock( - "Personal", - "personal", - util.NullValue, - ), - GeneratePhoneColumnsDataTypeSpecBlock( - strconv.Quote("Cell"), // columnName - strconv.Quote("TEXT"), // columnDataType - "1", // min - "11", // max - "10", // maxLength - ), - GeneratePhoneColumnsDataTypeSpecBlock( - strconv.Quote("Home"), // columnName - strconv.Quote("TEXT"), // columnDataType - util.NullValue, // min - util.NullValue, // max - "5", // maxLength - ), - ), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "name", nameUpdated), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "column_names.#", "4"), - util.ValidateStringInArray("genesyscloud_outbound_contact_list."+resourceId, "column_names", "Cell"), - util.ValidateStringInArray("genesyscloud_outbound_contact_list."+resourceId, "column_names", "Home"), - util.ValidateStringInArray("genesyscloud_outbound_contact_list."+resourceId, "column_names", "Work"), - util.ValidateStringInArray("genesyscloud_outbound_contact_list."+resourceId, "column_names", "Personal"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "phone_columns.0.column_name", "Cell"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "phone_columns.0.type", "cell"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "phone_columns.0.callable_time_column", "Cell"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "phone_columns.1.column_name", "Home"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "phone_columns.1.type", "home"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "phone_columns.1.callable_time_column", "Home"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "email_columns.1.column_name", "Work"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "email_columns.1.type", "work"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "email_columns.0.column_name", "Personal"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "email_columns.0.type", "personal"), - - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "column_data_type_specifications.#", "2"), - - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "column_data_type_specifications.0.column_name", "Cell"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "column_data_type_specifications.0.column_data_type", "TEXT"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "column_data_type_specifications.0.min", "1"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "column_data_type_specifications.0.max", "11"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "column_data_type_specifications.0.max_length", "10"), - - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "column_data_type_specifications.1.column_name", "Home"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "column_data_type_specifications.1.column_data_type", "TEXT"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "column_data_type_specifications.1.max_length", "5"), - - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "preview_mode_column_name", previewModeColumnNameUpdated), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "preview_mode_accepted_values.0", previewModeColumnName), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "preview_mode_accepted_values.1", previewModeColumnNameUpdated), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "automatic_time_zone_mapping", automaticTimeZoneMapping), - provider.TestDefaultHomeDivision("genesyscloud_outbound_contact_list."+resourceId), - ), - }, - { - Config: obAttemptLimit.GenerateAttemptLimitResource( - attemptLimitResourceID, - attemptLimitName, - "5", - "5", - "America/Chicago", - "TODAY", - ) + obAttemptLimit.GenerateOutboundAttemptLimitDataSource( - attemptLimitDataSourceID, - attemptLimitName, - "genesyscloud_outbound_attempt_limit."+attemptLimitResourceID, - ) + `data "genesyscloud_auth_division_home" "home" {}` + GenerateOutboundContactList( - resourceId, - nameUpdated, - "data.genesyscloud_auth_division_home.home.id", - strconv.Quote(previewModeColumnNameUpdated), - previewModeAcceptedValuesUpdated, - columnNamesUpdated, - automaticTimeZoneMappingUpdated, - strconv.Quote(zipCodeColumnName), - "genesyscloud_outbound_attempt_limit."+attemptLimitResourceID+".id", - GeneratePhoneColumnsBlock( - "Cell", - "cell", - util.NullValue, - ), - GeneratePhoneColumnsBlock( - "Home", - "home", - util.NullValue, - ), - GenerateEmailColumnsBlock( - "Work", - "work", - strconv.Quote(zipCodeColumnName), - ), - GenerateEmailColumnsBlock( - "Personal", - "personal", - strconv.Quote(zipCodeColumnName), - ), - GeneratePhoneColumnsDataTypeSpecBlock( - strconv.Quote("Cell"), // columnName - strconv.Quote("TEXT"), // columnDataType - "2", // min - "12", // max - "11", // maxLength - ), - ), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "name", nameUpdated), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "column_names.#", "5"), - util.ValidateStringInArray("genesyscloud_outbound_contact_list."+resourceId, "column_names", "Cell"), - util.ValidateStringInArray("genesyscloud_outbound_contact_list."+resourceId, "column_names", "Home"), - util.ValidateStringInArray("genesyscloud_outbound_contact_list."+resourceId, "column_names", "Work"), - util.ValidateStringInArray("genesyscloud_outbound_contact_list."+resourceId, "column_names", "Personal"), - util.ValidateStringInArray("genesyscloud_outbound_contact_list."+resourceId, "column_names", zipCodeColumnName), - - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "zip_code_column_name", zipCodeColumnName), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "phone_columns.0.column_name", "Cell"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "phone_columns.0.type", "cell"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "email_columns.0.column_name", "Personal"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "email_columns.0.type", "personal"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "email_columns.0.contactable_time_column", zipCodeColumnName), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "phone_columns.1.column_name", "Home"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "phone_columns.1.type", "home"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "email_columns.1.column_name", "Work"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "email_columns.1.type", "work"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "email_columns.1.contactable_time_column", zipCodeColumnName), - - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "column_data_type_specifications.#", "1"), - - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "column_data_type_specifications.0.column_name", "Cell"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "column_data_type_specifications.0.column_data_type", "TEXT"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "column_data_type_specifications.0.min", "2"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "column_data_type_specifications.0.max", "12"), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "column_data_type_specifications.0.max_length", "11"), - - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "preview_mode_column_name", previewModeColumnNameUpdated), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "preview_mode_accepted_values.0", previewModeColumnName), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "preview_mode_accepted_values.1", previewModeColumnNameUpdated), - resource.TestCheckResourceAttr("genesyscloud_outbound_contact_list."+resourceId, "automatic_time_zone_mapping", automaticTimeZoneMappingUpdated), - resource.TestCheckResourceAttrPair("data.genesyscloud_outbound_attempt_limit."+attemptLimitDataSourceID, "id", - "genesyscloud_outbound_contact_list."+resourceId, "attempt_limit_id"), - provider.TestDefaultHomeDivision("genesyscloud_outbound_contact_list."+resourceId), - ), - }, - { - ResourceName: "genesyscloud_outbound_contact_list." + resourceId, - ImportState: true, - ImportStateVerify: true, - }, - }, - CheckDestroy: testVerifyContactListDestroyed, - }) -} - -func testVerifyContactListDestroyed(state *terraform.State) error { - outboundAPI := platformclientv2.NewOutboundApi() - for _, rs := range state.RootModule().Resources { - if rs.Type != "genesyscloud_outbound_contact_list" { - continue - } - contactList, resp, err := outboundAPI.GetOutboundContactlist(rs.Primary.ID, false, false) - if contactList != nil { - return fmt.Errorf("contact list (%s) still exists", rs.Primary.ID) - } else if util.IsStatus404(resp) { - // Contact list not found as expected - continue - } else { - // Unexpected error - return fmt.Errorf("unexpected error: %s", err) - } - } - // Success. All contact lists destroyed - return nil -} diff --git a/genesyscloud/outbound_contact_list_template/data_source_genesyscloud_outbound_contact_list_template.go b/genesyscloud/outbound_contact_list_template/data_source_genesyscloud_outbound_contact_list_template.go new file mode 100644 index 000000000..653462c7c --- /dev/null +++ b/genesyscloud/outbound_contact_list_template/data_source_genesyscloud_outbound_contact_list_template.go @@ -0,0 +1,36 @@ +package outbound_contact_list_template + +import ( + "context" + "fmt" + "terraform-provider-genesyscloud/genesyscloud/provider" + "terraform-provider-genesyscloud/genesyscloud/util" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceOutboundContactListTemplateRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + sdkConfig := m.(*provider.ProviderMeta).ClientConfig + proxy := getOutboundContactlisttemplateProxy(sdkConfig) + name := d.Get("name").(string) + + return util.WithRetries(ctx, 15*time.Second, func() *retry.RetryError { + const pageNum = 1 + const pageSize = 100 + contactListTemplateId, retryable, resp, getErr := proxy.getOutboundContactlisttemplateIdByName(ctx, name) + + if getErr != nil && !retryable { + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("error requesting contact list template %s | error: %s", name, getErr), resp)) + } + if retryable { + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("no contact list templates found with name %s", name), resp)) + } + + d.SetId(contactListTemplateId) + return nil + }) +} diff --git a/genesyscloud/outbound_contact_list_template/data_source_genesyscloud_outbound_contact_list_template_test.go b/genesyscloud/outbound_contact_list_template/data_source_genesyscloud_outbound_contact_list_template_test.go new file mode 100644 index 000000000..fbf8ff335 --- /dev/null +++ b/genesyscloud/outbound_contact_list_template/data_source_genesyscloud_outbound_contact_list_template_test.go @@ -0,0 +1,61 @@ +package outbound_contact_list_template + +import ( + "fmt" + "strconv" + "terraform-provider-genesyscloud/genesyscloud/provider" + "terraform-provider-genesyscloud/genesyscloud/util" + "testing" + + "github.com/google/uuid" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccDataSourceOutboundContactListTemplate(t *testing.T) { + + var ( + resourceId = "contact_list_template" + dataSourceId = "contact_list_template_data" + contactListName = "Contact List Template" + uuid.NewString() + ) + resource.Test(t, resource.TestCase{ + PreCheck: func() { util.TestAccPreCheck(t) }, + ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + Steps: []resource.TestStep{ + { + Config: GenerateOutboundContactListTemplate( + resourceId, + contactListName, + util.NullValue, // previewModeColumnName + []string{}, // previewModeAcceptedValues + []string{strconv.Quote("Cell")}, + util.FalseValue, // automaticTimeZoneMapping + util.NullValue, // zipCodeColumnName + util.NullValue, // attemptLimitId + GeneratePhoneColumnsBlock( + "Cell", + "cell", + util.NullValue, + ), + ) + generateOutboundContactListTemplateDataSource( + dataSourceId, + contactListName, + resourceName+"."+resourceId, + ), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair("data."+resourceName+"."+dataSourceId, "id", + resourceName+"."+resourceId, "id"), + ), + }, + }, + }) +} + +func generateOutboundContactListTemplateDataSource(id string, name string, dependsOn string) string { + return fmt.Sprintf(` +data "%s" "%s" { + name = "%s" + depends_on = [%s] +} +`, resourceName, id, name, dependsOn) +} diff --git a/genesyscloud/outbound_contact_list_template/genesyscloud_outbound_contact_list_template_proxy.go b/genesyscloud/outbound_contact_list_template/genesyscloud_outbound_contact_list_template_proxy.go new file mode 100644 index 000000000..5e1d171c1 --- /dev/null +++ b/genesyscloud/outbound_contact_list_template/genesyscloud_outbound_contact_list_template_proxy.go @@ -0,0 +1,185 @@ +package outbound_contact_list_template + +import ( + "context" + "fmt" + "log" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" +) + +/* +The genesyscloud_outbound_contact_list_template_proxy.go file contains the proxy structures and methods that interact +with the Genesys Cloud SDK. We use composition here for each function on the proxy so individual functions can be stubbed +out during testing. +*/ + +// internalProxy holds a proxy instance that can be used throughout the package +var internalProxy *outboundContactlisttemplateProxy + +// Type definitions for each func on our proxy so we can easily mock them out later +type createOutboundContactlisttemplateFunc func(ctx context.Context, p *outboundContactlisttemplateProxy, Contactlisttemplate *platformclientv2.Contactlisttemplate) (*platformclientv2.Contactlisttemplate, *platformclientv2.APIResponse, error) +type getAllOutboundContactlisttemplateFunc func(ctx context.Context, p *outboundContactlisttemplateProxy, name string) (*[]platformclientv2.Contactlisttemplate, *platformclientv2.APIResponse, error) +type getOutboundContactlisttemplateIdByNameFunc func(ctx context.Context, p *outboundContactlisttemplateProxy, name string) (id string, retryable bool, response *platformclientv2.APIResponse, err error) +type getOutboundContactlisttemplateByIdFunc func(ctx context.Context, p *outboundContactlisttemplateProxy, id string) (Contactlisttemplate *platformclientv2.Contactlisttemplate, response *platformclientv2.APIResponse, err error) +type updateOutboundContactlisttemplateFunc func(ctx context.Context, p *outboundContactlisttemplateProxy, id string, Contactlisttemplate *platformclientv2.Contactlisttemplate) (*platformclientv2.Contactlisttemplate, *platformclientv2.APIResponse, error) +type deleteOutboundContactlisttemplateFunc func(ctx context.Context, p *outboundContactlisttemplateProxy, id string) (response *platformclientv2.APIResponse, err error) + +// outboundContactlisttemplateProxy contains all of the methods that call genesys cloud APIs. +type outboundContactlisttemplateProxy struct { + clientConfig *platformclientv2.Configuration + outboundApi *platformclientv2.OutboundApi + createOutboundContactlisttemplateAttr createOutboundContactlisttemplateFunc + getAllOutboundContactlisttemplateAttr getAllOutboundContactlisttemplateFunc + getOutboundContactlisttemplateIdByNameAttr getOutboundContactlisttemplateIdByNameFunc + getOutboundContactlisttemplateByIdAttr getOutboundContactlisttemplateByIdFunc + updateOutboundContactlisttemplateAttr updateOutboundContactlisttemplateFunc + deleteOutboundContactlisttemplateAttr deleteOutboundContactlisttemplateFunc +} + +// newOutboundContactlisttemplateProxy initializes the outbound Contactlisttemplate proxy with all of the data needed to communicate with Genesys Cloud +func newOutboundContactlisttemplateProxy(clientConfig *platformclientv2.Configuration) *outboundContactlisttemplateProxy { + api := platformclientv2.NewOutboundApiWithConfig(clientConfig) + return &outboundContactlisttemplateProxy{ + clientConfig: clientConfig, + outboundApi: api, + createOutboundContactlisttemplateAttr: createOutboundContactlisttemplateFn, + getAllOutboundContactlisttemplateAttr: getAllOutboundContactlisttemplateFn, + getOutboundContactlisttemplateIdByNameAttr: getOutboundContactlisttemplateIdByNameFn, + getOutboundContactlisttemplateByIdAttr: getOutboundContactlisttemplateByIdFn, + updateOutboundContactlisttemplateAttr: updateOutboundContactlisttemplateFn, + deleteOutboundContactlisttemplateAttr: deleteOutboundContactlisttemplateFn, + } +} + +// getOutboundContactlisttemplateProxy acts as a singleton to for the internalProxy. It also ensures +// that we can still proxy our tests by directly setting internalProxy package variable +func getOutboundContactlisttemplateProxy(clientConfig *platformclientv2.Configuration) *outboundContactlisttemplateProxy { + if internalProxy == nil { + internalProxy = newOutboundContactlisttemplateProxy(clientConfig) + } + return internalProxy +} + +// createOutboundContactlisttemplate creates a Genesys Cloud outbound Contactlisttemplate +func (p *outboundContactlisttemplateProxy) createOutboundContactlisttemplate(ctx context.Context, outboundContactlisttemplate *platformclientv2.Contactlisttemplate) (*platformclientv2.Contactlisttemplate, *platformclientv2.APIResponse, error) { + return p.createOutboundContactlisttemplateAttr(ctx, p, outboundContactlisttemplate) +} + +// getOutboundContactlisttemplate retrieves all Genesys Cloud outbound Contactlisttemplate +func (p *outboundContactlisttemplateProxy) getAllOutboundContactlisttemplate(ctx context.Context) (*[]platformclientv2.Contactlisttemplate, *platformclientv2.APIResponse, error) { + return p.getAllOutboundContactlisttemplateAttr(ctx, p, "") +} + +// getOutboundContactlisttemplateIdByName returns a single Genesys Cloud outbound Contactlisttemplate by a name +func (p *outboundContactlisttemplateProxy) getOutboundContactlisttemplateIdByName(ctx context.Context, name string) (id string, retryable bool, response *platformclientv2.APIResponse, err error) { + return p.getOutboundContactlisttemplateIdByNameAttr(ctx, p, name) +} + +// getOutboundContactlisttemplateById returns a single Genesys Cloud outbound Contactlisttemplate by Id +func (p *outboundContactlisttemplateProxy) getOutboundContactlisttemplateById(ctx context.Context, id string) (outboundContactlisttemplate *platformclientv2.Contactlisttemplate, response *platformclientv2.APIResponse, err error) { + return p.getOutboundContactlisttemplateByIdAttr(ctx, p, id) +} + +// updateOutboundContactlisttemplate updates a Genesys Cloud outbound Contactlisttemplate +func (p *outboundContactlisttemplateProxy) updateOutboundContactlisttemplate(ctx context.Context, id string, outboundContactlisttemplate *platformclientv2.Contactlisttemplate) (*platformclientv2.Contactlisttemplate, *platformclientv2.APIResponse, error) { + return p.updateOutboundContactlisttemplateAttr(ctx, p, id, outboundContactlisttemplate) +} + +// deleteOutboundContactlisttemplate deletes a Genesys Cloud outbound Contactlisttemplate by Id +func (p *outboundContactlisttemplateProxy) deleteOutboundContactlisttemplate(ctx context.Context, id string) (response *platformclientv2.APIResponse, err error) { + return p.deleteOutboundContactlisttemplateAttr(ctx, p, id) +} + +// createOutboundContactlisttemplateFn is an implementation function for creating a Genesys Cloud outbound Contactlisttemplate +func createOutboundContactlisttemplateFn(ctx context.Context, p *outboundContactlisttemplateProxy, outboundContactlisttemplate *platformclientv2.Contactlisttemplate) (*platformclientv2.Contactlisttemplate, *platformclientv2.APIResponse, error) { + Contactlisttemplate, resp, err := p.outboundApi.PostOutboundContactlisttemplates(*outboundContactlisttemplate) + if err != nil { + return nil, resp, err + } + return Contactlisttemplate, resp, nil +} + +// getAllOutboundContactlisttemplateFn is the implementation for retrieving all outbound Contactlisttemplate in Genesys Cloud +func getAllOutboundContactlisttemplateFn(ctx context.Context, p *outboundContactlisttemplateProxy, name string) (*[]platformclientv2.Contactlisttemplate, *platformclientv2.APIResponse, error) { + var allContactlisttemplates []platformclientv2.Contactlisttemplate + const pageSize = 100 + + Contactlisttemplates, resp, err := p.outboundApi.GetOutboundContactlisttemplates(pageSize, 1, true, "", name, "", "") + if err != nil { + return nil, resp, fmt.Errorf("failed to get page of contact list template: %v", err) + } + + if Contactlisttemplates.Entities == nil || len(*Contactlisttemplates.Entities) == 0 { + return &allContactlisttemplates, resp, nil + } + + for _, Contactlisttemplate := range *Contactlisttemplates.Entities { + allContactlisttemplates = append(allContactlisttemplates, Contactlisttemplate) + } + + for pageNum := 2; pageNum <= *Contactlisttemplates.PageCount; pageNum++ { + Contactlisttemplates, resp, err := p.outboundApi.GetOutboundContactlisttemplates(pageSize, pageNum, true, "", name, "", "") + if err != nil { + return nil, resp, fmt.Errorf("failed to get page of contact list template: %v", err) + } + + if Contactlisttemplates.Entities == nil || len(*Contactlisttemplates.Entities) == 0 { + break + } + + for _, Contactlisttemplate := range *Contactlisttemplates.Entities { + allContactlisttemplates = append(allContactlisttemplates, Contactlisttemplate) + } + } + + return &allContactlisttemplates, resp, nil +} + +// getOutboundContactlisttemplateIdByNameFn is an implementation of the function to get a Genesys Cloud outbound Contactlisttemplate by name +func getOutboundContactlisttemplateIdByNameFn(ctx context.Context, p *outboundContactlisttemplateProxy, name string) (id string, retryable bool, response *platformclientv2.APIResponse, err error) { + Contactlisttemplates, resp, err := getAllOutboundContactlisttemplateFn(ctx, p, name) + if err != nil { + return "", false, resp, fmt.Errorf("error searching outbound contact list template %s: %s", name, err) + } + + var list platformclientv2.Contactlisttemplate + for _, Contactlisttemplate := range *Contactlisttemplates { + if *Contactlisttemplate.Name == name { + log.Printf("Retrieved the contact list template id %s by name %s", *Contactlisttemplate.Id, name) + list = Contactlisttemplate + return *list.Id, false, resp, nil + } + } + + return "", true, resp, nil +} + +// getOutboundContactlisttemplateByIdFn is an implementation of the function to get a Genesys Cloud outbound Contactlisttemplate by Id +func getOutboundContactlisttemplateByIdFn(ctx context.Context, p *outboundContactlisttemplateProxy, id string) (outboundContactlisttemplate *platformclientv2.Contactlisttemplate, response *platformclientv2.APIResponse, err error) { + Contactlisttemplate, resp, err := p.outboundApi.GetOutboundContactlisttemplate(id) + if err != nil { + return nil, resp, err + } + return Contactlisttemplate, resp, nil +} + +// updateOutboundContactlisttemplateFn is an implementation of the function to update a Genesys Cloud outbound Contactlisttemplate +func updateOutboundContactlisttemplateFn(ctx context.Context, p *outboundContactlisttemplateProxy, id string, outboundContactlisttemplate *platformclientv2.Contactlisttemplate) (*platformclientv2.Contactlisttemplate, *platformclientv2.APIResponse, error) { + Contactlisttemplate, resp, err := p.outboundApi.GetOutboundContactlisttemplate(id) + if err != nil { + return nil, resp, err + } + + outboundContactlisttemplate.Version = Contactlisttemplate.Version + outboundContactlisttemplate, resp, updateErr := p.outboundApi.PutOutboundContactlisttemplate(id, *outboundContactlisttemplate) + if updateErr != nil { + return nil, resp, updateErr + } + return outboundContactlisttemplate, resp, nil +} + +// deleteOutboundContactlisttemplateFn is an implementation function for deleting a Genesys Cloud outbound Contactlisttemplate +func deleteOutboundContactlisttemplateFn(ctx context.Context, p *outboundContactlisttemplateProxy, id string) (response *platformclientv2.APIResponse, err error) { + return p.outboundApi.DeleteOutboundContactlisttemplate(id) +} diff --git a/genesyscloud/outbound_contact_list_template/outbound_contact_list_template_resource_init.go b/genesyscloud/outbound_contact_list_template/outbound_contact_list_template_resource_init.go new file mode 100644 index 000000000..7448784b5 --- /dev/null +++ b/genesyscloud/outbound_contact_list_template/outbound_contact_list_template_resource_init.go @@ -0,0 +1,15 @@ +package outbound_contact_list_template + +import ( + registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" +) + +const ( + resourceName = "genesyscloud_outbound_contact_list_template" +) + +func SetRegistrar(regInstance registrar.Registrar) { + regInstance.RegisterDataSource(resourceName, DataSourceOutboundContactListTemplate()) + regInstance.RegisterResource(resourceName, ResourceOutboundContactListTemplate()) + regInstance.RegisterExporter(resourceName, OutboundContactListTemplateExporter()) +} diff --git a/genesyscloud/outbound_contact_list_template/outbound_contact_list_template_resource_init_test.go b/genesyscloud/outbound_contact_list_template/outbound_contact_list_template_resource_init_test.go new file mode 100644 index 000000000..8c9f4b6d1 --- /dev/null +++ b/genesyscloud/outbound_contact_list_template/outbound_contact_list_template_resource_init_test.go @@ -0,0 +1,51 @@ +package outbound_contact_list_template + +import ( + "sync" + obAttemptLimit "terraform-provider-genesyscloud/genesyscloud/outbound_attempt_limit" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +var providerDataSources map[string]*schema.Resource +var providerResources map[string]*schema.Resource + +func initTestResources() { + providerDataSources = make(map[string]*schema.Resource) + providerResources = make(map[string]*schema.Resource) + + regInstance := ®isterTestInstance{} + + regInstance.registerTestResources() + regInstance.registerTestDataSources() +} + +type registerTestInstance struct { + resourceMapMutex sync.RWMutex + datasourceMapMutex sync.RWMutex +} + +func (r *registerTestInstance) registerTestResources() { + r.resourceMapMutex.Lock() + defer r.resourceMapMutex.Unlock() + + providerResources[resourceName] = ResourceOutboundContactListTemplate() + providerResources["genesyscloud_outbound_attempt_limit"] = obAttemptLimit.ResourceOutboundAttemptLimit() +} + +func (r *registerTestInstance) registerTestDataSources() { + r.datasourceMapMutex.Lock() + defer r.datasourceMapMutex.Unlock() + + providerDataSources[resourceName] = DataSourceOutboundContactListTemplate() + providerDataSources["genesyscloud_outbound_attempt_limit"] = obAttemptLimit.DataSourceOutboundAttemptLimit() +} + +func TestMain(m *testing.M) { + // Run setup function before starting the test suite + initTestResources() + + // Run the test suite for outbound ruleset + m.Run() +} diff --git a/genesyscloud/outbound_contact_list_template/resource_genesyscloud_outbound_contact_list_template.go b/genesyscloud/outbound_contact_list_template/resource_genesyscloud_outbound_contact_list_template.go new file mode 100644 index 000000000..5fd6b380d --- /dev/null +++ b/genesyscloud/outbound_contact_list_template/resource_genesyscloud_outbound_contact_list_template.go @@ -0,0 +1,220 @@ +package outbound_contact_list_template + +import ( + "context" + "fmt" + "log" + "terraform-provider-genesyscloud/genesyscloud/provider" + "terraform-provider-genesyscloud/genesyscloud/util" + "terraform-provider-genesyscloud/genesyscloud/util/constants" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + + "terraform-provider-genesyscloud/genesyscloud/consistency_checker" + + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + lists "terraform-provider-genesyscloud/genesyscloud/util/lists" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" +) + +func getAllOutboundContactListTemplates(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { + resources := make(resourceExporter.ResourceIDMetaMap) + proxy := getOutboundContactlisttemplateProxy(clientConfig) + + contactListTemplates, resp, getErr := proxy.getAllOutboundContactlisttemplate(ctx) + if getErr != nil { + return nil, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to get contact list templates error: %s", getErr), resp) + } + + for _, contactListTemplate := range *contactListTemplates { + resources[*contactListTemplate.Id] = &resourceExporter.ResourceMeta{Name: *contactListTemplate.Name} + } + + return resources, nil +} + +func createOutboundContactListTemplate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + name := d.Get("name").(string) + columnNames := lists.InterfaceListToStrings(d.Get("column_names").([]interface{})) + previewModeColumnName := d.Get("preview_mode_column_name").(string) + previewModeAcceptedValues := lists.InterfaceListToStrings(d.Get("preview_mode_accepted_values").([]interface{})) + automaticTimeZoneMapping := d.Get("automatic_time_zone_mapping").(bool) + zipCodeColumnName := d.Get("zip_code_column_name").(string) + + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getOutboundContactlisttemplateProxy(sdkConfig) + + sdkContactListTemplate := platformclientv2.Contactlisttemplate{ + ColumnNames: &columnNames, + PhoneColumns: buildSdkOutboundContactListTemplateContactPhoneNumberColumnSlice(d.Get("phone_columns").(*schema.Set)), + EmailColumns: buildSdkOutboundContactListContactEmailAddressColumnSlice(d.Get("email_columns").(*schema.Set)), + PreviewModeAcceptedValues: &previewModeAcceptedValues, + AttemptLimits: util.BuildSdkDomainEntityRef(d, "attempt_limit_id"), + AutomaticTimeZoneMapping: &automaticTimeZoneMapping, + ColumnDataTypeSpecifications: buildSdkOutboundContactListTemplateColumnDataTypeSpecifications(d.Get("column_data_type_specifications").([]interface{})), + } + + if name != "" { + sdkContactListTemplate.Name = &name + } + if previewModeColumnName != "" { + sdkContactListTemplate.PreviewModeColumnName = &previewModeColumnName + } + if zipCodeColumnName != "" { + sdkContactListTemplate.ZipCodeColumnName = &zipCodeColumnName + } + + log.Printf("Creating Outbound Contact List Template %s", name) + outboundContactListTemplate, resp, err := proxy.createOutboundContactlisttemplate(ctx, &sdkContactListTemplate) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to create Outbound Contact List Template %s error: %s", name, err), resp) + } + + d.SetId(*outboundContactListTemplate.Id) + + log.Printf("Created Outbound Contact List Template %s %s", name, *outboundContactListTemplate.Id) + return readOutboundContactListTemplate(ctx, d, meta) +} + +func updateOutboundContactListTemplate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + name := d.Get("name").(string) + columnNames := lists.InterfaceListToStrings(d.Get("column_names").([]interface{})) + previewModeColumnName := d.Get("preview_mode_column_name").(string) + previewModeAcceptedValues := lists.InterfaceListToStrings(d.Get("preview_mode_accepted_values").([]interface{})) + automaticTimeZoneMapping := d.Get("automatic_time_zone_mapping").(bool) + zipCodeColumnName := d.Get("zip_code_column_name").(string) + + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getOutboundContactlisttemplateProxy(sdkConfig) + + sdkContactListTemplate := platformclientv2.Contactlisttemplate{ + ColumnNames: &columnNames, + PhoneColumns: buildSdkOutboundContactListTemplateContactPhoneNumberColumnSlice(d.Get("phone_columns").(*schema.Set)), + EmailColumns: buildSdkOutboundContactListContactEmailAddressColumnSlice(d.Get("email_columns").(*schema.Set)), + PreviewModeAcceptedValues: &previewModeAcceptedValues, + AttemptLimits: util.BuildSdkDomainEntityRef(d, "attempt_limit_id"), + AutomaticTimeZoneMapping: &automaticTimeZoneMapping, + ColumnDataTypeSpecifications: buildSdkOutboundContactListTemplateColumnDataTypeSpecifications(d.Get("column_data_type_specifications").([]interface{})), + } + + if name != "" { + sdkContactListTemplate.Name = &name + } + if previewModeColumnName != "" { + sdkContactListTemplate.PreviewModeColumnName = &previewModeColumnName + } + if zipCodeColumnName != "" { + sdkContactListTemplate.ZipCodeColumnName = &zipCodeColumnName + } + + log.Printf("Updating Outbound Contact List Template %s", name) + diagErr := util.RetryWhen(util.IsVersionMismatch, func() (*platformclientv2.APIResponse, diag.Diagnostics) { + + _, resp, updateErr := proxy.updateOutboundContactlisttemplate(ctx, d.Id(), &sdkContactListTemplate) + if updateErr != nil { + return resp, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to update Outbound Contact List Template %s error: %s", name, updateErr), resp) + } + return nil, nil + }) + if diagErr != nil { + return diagErr + } + + log.Printf("Updated Outbound Contact List Template %s", name) + return readOutboundContactListTemplate(ctx, d, meta) +} + +func readOutboundContactListTemplate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getOutboundContactlisttemplateProxy(sdkConfig) + cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceOutboundContactListTemplate(), constants.DefaultConsistencyChecks, resourceName) + + log.Printf("Reading Outbound Contact List Template %s", d.Id()) + + return util.WithRetriesForRead(ctx, d, func() *retry.RetryError { + sdkContactListTemplate, resp, getErr := proxy.getOutboundContactlisttemplateById(ctx, d.Id()) + if getErr != nil { + if util.IsStatus404(resp) { + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("failed to read Outbound Contact List Template %s | error: %s", d.Id(), getErr), resp)) + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("failed to read Outbound Contact List Template %s | error: %s", d.Id(), getErr), resp)) + } + + if sdkContactListTemplate.Name != nil { + _ = d.Set("name", *sdkContactListTemplate.Name) + } + if sdkContactListTemplate.ColumnNames != nil { + var columnNames []string + for _, name := range *sdkContactListTemplate.ColumnNames { + columnNames = append(columnNames, name) + } + _ = d.Set("column_names", columnNames) + } + if sdkContactListTemplate.PhoneColumns != nil { + _ = d.Set("phone_columns", flattenSdkOutboundContactListTemplateContactPhoneNumberColumnSlice(*sdkContactListTemplate.PhoneColumns)) + } + if sdkContactListTemplate.EmailColumns != nil { + _ = d.Set("email_columns", flattenSdkOutboundContactListTemplateContactEmailAddressColumnSlice(*sdkContactListTemplate.EmailColumns)) + } + if sdkContactListTemplate.PreviewModeColumnName != nil { + _ = d.Set("preview_mode_column_name", *sdkContactListTemplate.PreviewModeColumnName) + } + if sdkContactListTemplate.PreviewModeAcceptedValues != nil { + var acceptedValues []string + for _, val := range *sdkContactListTemplate.PreviewModeAcceptedValues { + acceptedValues = append(acceptedValues, val) + } + _ = d.Set("preview_mode_accepted_values", acceptedValues) + } + if sdkContactListTemplate.AttemptLimits != nil && sdkContactListTemplate.AttemptLimits.Id != nil { + _ = d.Set("attempt_limit_id", *sdkContactListTemplate.AttemptLimits.Id) + } + if sdkContactListTemplate.AutomaticTimeZoneMapping != nil { + _ = d.Set("automatic_time_zone_mapping", *sdkContactListTemplate.AutomaticTimeZoneMapping) + } + if sdkContactListTemplate.ZipCodeColumnName != nil { + _ = d.Set("zip_code_column_name", *sdkContactListTemplate.ZipCodeColumnName) + } + if sdkContactListTemplate.ColumnDataTypeSpecifications != nil { + _ = d.Set("column_data_type_specifications", flattenSdkOutboundContactListTemplateColumnDataTypeSpecifications(*sdkContactListTemplate.ColumnDataTypeSpecifications)) + } + + log.Printf("Read Outbound Contact List Template %s %s", d.Id(), *sdkContactListTemplate.Name) + return cc.CheckState(d) + }) +} + +func deleteOutboundContactListTemplate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getOutboundContactlisttemplateProxy(sdkConfig) + + diagErr := util.RetryWhen(util.IsStatus400, func() (*platformclientv2.APIResponse, diag.Diagnostics) { + log.Printf("Deleting Outbound Contact List Template") + resp, err := proxy.deleteOutboundContactlisttemplate(ctx, d.Id()) + if err != nil { + return resp, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to delete Outbound Contact List Template %s error: %s", d.Id(), err), resp) + } + return resp, nil + }) + if diagErr != nil { + return diagErr + } + + return util.WithRetries(ctx, 30*time.Second, func() *retry.RetryError { + _, resp, err := proxy.getOutboundContactlisttemplateById(ctx, d.Id()) + if err != nil { + if util.IsStatus404(resp) { + // Outbound Contact List Template deleted + log.Printf("Deleted Outbound Contact List Template %s", d.Id()) + return nil + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("error deleting Outbound Contact List Template %s | error: %s", d.Id(), err), resp)) + } + + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Outbound Contact List Template %s still exists", d.Id()), resp)) + }) +} diff --git a/genesyscloud/outbound_contact_list_template/resource_genesyscloud_outbound_contact_list_template_schema.go b/genesyscloud/outbound_contact_list_template/resource_genesyscloud_outbound_contact_list_template_schema.go new file mode 100644 index 000000000..8496e838e --- /dev/null +++ b/genesyscloud/outbound_contact_list_template/resource_genesyscloud_outbound_contact_list_template_schema.go @@ -0,0 +1,194 @@ +package outbound_contact_list_template + +import ( + "terraform-provider-genesyscloud/genesyscloud/provider" + + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" +) + +/* +resource_genesycloud_outbound_contact_list_template_schema.go holds three functions within it: + +1. The resource schema definitions for the outbound_contact_list_template resource. +2. The datasource schema definitions for the outbound_contact_list_template datasource. +3. The resource exporter configuration for the outbound_contact_list_template exporter. +*/ + +var ( + outboundContactListTemplateContactPhoneNumberColumnResource = &schema.Resource{ + Schema: map[string]*schema.Schema{ + `column_name`: { + Description: `The name of the phone column.`, + Required: true, + Type: schema.TypeString, + }, + `type`: { + Description: `Indicates the type of the phone column. For example, 'cell' or 'home'.`, + Required: true, + Type: schema.TypeString, + }, + `callable_time_column`: { + Description: `A column that indicates the timezone to use for a given contact when checking callable times. Not allowed if 'automaticTimeZoneMapping' is set to true.`, + Optional: true, + Type: schema.TypeString, + }, + }, + } + + outboundContactListTemplateEmailColumnResource = &schema.Resource{ + Schema: map[string]*schema.Schema{ + `column_name`: { + Description: `The name of the email column.`, + Required: true, + Type: schema.TypeString, + }, + `type`: { + Description: `Indicates the type of the email column. For example, 'work' or 'personal'.`, + Required: true, + Type: schema.TypeString, + }, + `contactable_time_column`: { + Description: `A column that indicates the timezone to use for a given contact when checking contactable times.`, + Optional: true, + Type: schema.TypeString, + }, + }, + } + + outboundContactListTemplateColumnDataTypeSpecification = &schema.Resource{ + Schema: map[string]*schema.Schema{ + `column_name`: { + Description: `The column name of a column selected for dynamic queueing.`, + Required: true, + Type: schema.TypeString, + }, + `column_data_type`: { + Description: `The data type of the column selected for dynamic queueing (TEXT, NUMERIC or TIMESTAMP)`, + Optional: true, + Computed: true, + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice([]string{"TEXT", "NUMERIC", "TIMESTAMP"}, false), + }, + `min`: { + Description: `The minimum length of the numeric column selected for dynamic queueing.`, + Optional: true, + Type: schema.TypeInt, + }, + `max`: { + Description: `The maximum length of the numeric column selected for dynamic queueing.`, + Optional: true, + Type: schema.TypeInt, + }, + `max_length`: { + Description: `The maximum length of the text column selected for dynamic queueing.`, + Required: true, + Type: schema.TypeInt, + }, + }, + } +) + +func ResourceOutboundContactListTemplate() *schema.Resource { + return &schema.Resource{ + Description: `Genesys Cloud Outbound Contact List Template`, + + CreateContext: provider.CreateWithPooledClient(createOutboundContactListTemplate), + ReadContext: provider.ReadWithPooledClient(readOutboundContactListTemplate), + UpdateContext: provider.UpdateWithPooledClient(updateOutboundContactListTemplate), + DeleteContext: provider.DeleteWithPooledClient(deleteOutboundContactListTemplate), + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + SchemaVersion: 1, + Schema: map[string]*schema.Schema{ + `name`: { + Description: `The name for the contact list template.`, + Required: true, + Type: schema.TypeString, + }, + `column_names`: { + Description: `The names of the contact template data columns. Changing the column_names attribute will cause the outbound_contact_list_template object to be dropped and recreated with a new ID`, + Required: true, + ForceNew: true, + Type: schema.TypeList, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + `phone_columns`: { + Description: `Indicates which columns are phone numbers. Changing the phone_columns attribute will cause the outbound_contact_list_template object to be dropped and recreated with a new ID. Required if email_columns is empty`, + Optional: true, + ForceNew: true, + Type: schema.TypeSet, + Elem: outboundContactListTemplateContactPhoneNumberColumnResource, + }, + `email_columns`: { + Description: `Indicates which columns are email addresses. Changing the email_columns attribute will cause the outbound_contact_list_template object to be dropped and recreated with a new ID. Required if phone_columns is empty`, + Optional: true, + ForceNew: true, + Type: schema.TypeSet, + Elem: outboundContactListTemplateEmailColumnResource, + }, + `preview_mode_column_name`: { + Description: `A column to check if a contact should always be dialed in preview mode.`, + Optional: true, + Type: schema.TypeString, + }, + `preview_mode_accepted_values`: { + Description: `The values in the preview_mode_column_name column that indicate a contact should always be dialed in preview mode.`, + Optional: true, + Type: schema.TypeList, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + `attempt_limit_id`: { + Description: `Attempt Limit for this Contact List Template.`, + Optional: true, + Type: schema.TypeString, + }, + `automatic_time_zone_mapping`: { + Description: `Indicates if automatic time zone mapping is to be used for this Contact List Template. Changing the automatic_time_zone_mappings attribute will cause the outbound_contact_list_template object to be dropped and recreated with a new ID`, + Optional: true, + ForceNew: true, + Type: schema.TypeBool, + }, + `zip_code_column_name`: { + Description: `The name of contact list column containing the zip code for use with automatic time zone mapping. Only allowed if 'automatic_time_zone_mapping' is set to true. Changing the zip_code_column_name attribute will cause the outbound_contact_list_template object to be dropped and recreated with a new ID`, + Optional: true, + ForceNew: true, + Type: schema.TypeString, + }, + `column_data_type_specifications`: { + Description: `The settings of the columns selected for dynamic queueing. If updated, the contact list template is dropped and recreated with a new ID`, + Optional: true, + ForceNew: true, + Type: schema.TypeList, + Elem: outboundContactListTemplateColumnDataTypeSpecification, + }, + }, + } +} + +func OutboundContactListTemplateExporter() *resourceExporter.ResourceExporter { + return &resourceExporter.ResourceExporter{ + GetResourcesFunc: provider.GetAllWithPooledClient(getAllOutboundContactListTemplates), + RefAttrs: map[string]*resourceExporter.RefAttrSettings{ + "attempt_limit_id": {RefType: "genesyscloud_outbound_attempt_limit"}, + "division_id": {RefType: "genesyscloud_auth_division"}, + }, + } +} + +func DataSourceOutboundContactListTemplate() *schema.Resource { + return &schema.Resource{ + Description: "Data source for Genesys Cloud Outbound Contact Lists Templates. Select a contact list template by name.", + ReadContext: provider.ReadWithPooledClient(dataSourceOutboundContactListTemplateRead), + Schema: map[string]*schema.Schema{ + "name": { + Description: "Contact List Template name.", + Type: schema.TypeString, + Required: true, + }, + }, + } +} diff --git a/genesyscloud/outbound_contact_list_template/resource_genesyscloud_outbound_contact_list_template_test.go b/genesyscloud/outbound_contact_list_template/resource_genesyscloud_outbound_contact_list_template_test.go new file mode 100644 index 000000000..71f30ea96 --- /dev/null +++ b/genesyscloud/outbound_contact_list_template/resource_genesyscloud_outbound_contact_list_template_test.go @@ -0,0 +1,356 @@ +package outbound_contact_list_template + +import ( + "fmt" + "strconv" + "terraform-provider-genesyscloud/genesyscloud/provider" + "terraform-provider-genesyscloud/genesyscloud/util" + "testing" + + obAttemptLimit "terraform-provider-genesyscloud/genesyscloud/outbound_attempt_limit" + + "github.com/google/uuid" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" +) + +func TestAccResourceOutboundContactListTemplateBasic(t *testing.T) { + + t.Parallel() + var ( + resourceId = "contact-list-template" + name = "Test Contact List Template" + uuid.NewString() + previewModeColumnName = "Cell" + previewModeAcceptedValues = []string{strconv.Quote(previewModeColumnName)} + columnNames = []string{ + strconv.Quote("Cell"), + strconv.Quote("Home"), + strconv.Quote("Work"), + strconv.Quote("Personal"), + } + automaticTimeZoneMapping = util.FalseValue + attemptLimitResourceID = "attempt-limit" + attemptLimitDataSourceID = "attempt-limit-data" + attemptLimitName = "Test Attempt Limit " + uuid.NewString() + + nameUpdated = "Test Contact List Template" + uuid.NewString() + automaticTimeZoneMappingUpdated = util.TrueValue + zipCodeColumnName = "Zipcode" + columnNamesUpdated = append(columnNames, strconv.Quote(zipCodeColumnName)) + previewModeColumnNameUpdated = "Home" + previewModeAcceptedValuesUpdated = []string{strconv.Quote(previewModeColumnName), strconv.Quote(previewModeColumnNameUpdated)} + ) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { util.TestAccPreCheck(t) }, + ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + Steps: []resource.TestStep{ + { + Config: GenerateOutboundContactListTemplate( + resourceId, + name, + strconv.Quote(previewModeColumnName), + previewModeAcceptedValues, + columnNames, + automaticTimeZoneMapping, + util.NullValue, + util.NullValue, + GeneratePhoneColumnsBlock( + "Cell", + "cell", + strconv.Quote("Cell"), + ), + GeneratePhoneColumnsBlock( + "Home", + "home", + strconv.Quote("Home"), + ), + GenerateEmailColumnsBlock( + "Work", + "work", + util.NullValue, + ), + GenerateEmailColumnsBlock( + "Personal", + "personal", + util.NullValue, + ), + ), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "name", name), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.#", "0"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_names.#", "4"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Cell"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Home"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Work"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Personal"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.0.column_name", "Cell"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.0.type", "cell"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.0.callable_time_column", "Cell"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.1.column_name", "Home"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.1.type", "home"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.1.callable_time_column", "Home"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.1.column_name", "Work"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.1.type", "work"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.0.column_name", "Personal"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.0.type", "personal"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "preview_mode_column_name", previewModeColumnName), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "preview_mode_accepted_values.0", previewModeColumnName), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "automatic_time_zone_mapping", automaticTimeZoneMapping), + ), + }, + // Update + { + Config: GenerateOutboundContactListTemplate( + resourceId, + name, + strconv.Quote(previewModeColumnName), + previewModeAcceptedValuesUpdated, + columnNames, + automaticTimeZoneMapping, + util.NullValue, + util.NullValue, + GeneratePhoneColumnsBlock( + "Cell", + "cell", + strconv.Quote("Cell"), + ), + GeneratePhoneColumnsBlock( + "Home", + "home", + strconv.Quote("Home"), + ), + GenerateEmailColumnsBlock( + "Work", + "work", + util.NullValue, + ), + GenerateEmailColumnsBlock( + "Personal", + "personal", + util.NullValue, + ), + ), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "name", name), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.#", "0"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_names.#", "4"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Cell"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Home"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Work"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Personal"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.0.column_name", "Cell"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.0.type", "cell"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.0.callable_time_column", "Cell"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.1.column_name", "Home"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.1.type", "home"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.1.callable_time_column", "Home"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.1.column_name", "Work"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.1.type", "work"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.0.column_name", "Personal"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.0.type", "personal"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "preview_mode_column_name", previewModeColumnName), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "preview_mode_accepted_values.0", previewModeColumnName), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "preview_mode_accepted_values.1", previewModeColumnNameUpdated), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "automatic_time_zone_mapping", automaticTimeZoneMapping), + ), + }, + { + // Update (forcenew) + Config: GenerateOutboundContactListTemplate( + resourceId, + nameUpdated, + strconv.Quote(previewModeColumnNameUpdated), + previewModeAcceptedValuesUpdated, + columnNames, + automaticTimeZoneMapping, + util.NullValue, + util.NullValue, + GeneratePhoneColumnsBlock( + "Cell", + "cell", + strconv.Quote("Cell"), + ), + GeneratePhoneColumnsBlock( + "Home", + "home", + strconv.Quote("Home"), + ), + GenerateEmailColumnsBlock( + "Work", + "work", + util.NullValue, + ), + GenerateEmailColumnsBlock( + "Personal", + "personal", + util.NullValue, + ), + GeneratePhoneColumnsDataTypeSpecBlock( + strconv.Quote("Cell"), // columnName + strconv.Quote("TEXT"), // columnDataType + "1", // min + "11", // max + "10", // maxLength + ), + GeneratePhoneColumnsDataTypeSpecBlock( + strconv.Quote("Home"), // columnName + strconv.Quote("TEXT"), // columnDataType + util.NullValue, // min + util.NullValue, // max + "5", // maxLength + ), + ), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "name", nameUpdated), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_names.#", "4"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Cell"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Home"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Work"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Personal"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.0.column_name", "Cell"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.0.type", "cell"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.0.callable_time_column", "Cell"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.1.column_name", "Home"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.1.type", "home"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.1.callable_time_column", "Home"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.1.column_name", "Work"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.1.type", "work"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.0.column_name", "Personal"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.0.type", "personal"), + + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.#", "2"), + + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.0.column_name", "Cell"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.0.column_data_type", "TEXT"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.0.min", "1"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.0.max", "11"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.0.max_length", "10"), + + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.1.column_name", "Home"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.1.column_data_type", "TEXT"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.1.max_length", "5"), + + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "preview_mode_column_name", previewModeColumnNameUpdated), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "preview_mode_accepted_values.0", previewModeColumnName), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "preview_mode_accepted_values.1", previewModeColumnNameUpdated), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "automatic_time_zone_mapping", automaticTimeZoneMapping), + ), + }, + { + Config: obAttemptLimit.GenerateAttemptLimitResource( + attemptLimitResourceID, + attemptLimitName, + "5", + "5", + "America/Chicago", + "TODAY", + ) + obAttemptLimit.GenerateOutboundAttemptLimitDataSource( + attemptLimitDataSourceID, + attemptLimitName, + "genesyscloud_outbound_attempt_limit."+attemptLimitResourceID, + ) + GenerateOutboundContactListTemplate( + resourceId, + nameUpdated, + strconv.Quote(previewModeColumnNameUpdated), + previewModeAcceptedValuesUpdated, + columnNamesUpdated, + automaticTimeZoneMappingUpdated, + strconv.Quote(zipCodeColumnName), + "genesyscloud_outbound_attempt_limit."+attemptLimitResourceID+".id", + GeneratePhoneColumnsBlock( + "Cell", + "cell", + util.NullValue, + ), + GeneratePhoneColumnsBlock( + "Home", + "home", + util.NullValue, + ), + GenerateEmailColumnsBlock( + "Work", + "work", + strconv.Quote(zipCodeColumnName), + ), + GenerateEmailColumnsBlock( + "Personal", + "personal", + strconv.Quote(zipCodeColumnName), + ), + GeneratePhoneColumnsDataTypeSpecBlock( + strconv.Quote("Cell"), // columnName + strconv.Quote("TEXT"), // columnDataType + "2", // min + "12", // max + "11", // maxLength + ), + ), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "name", nameUpdated), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_names.#", "5"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Cell"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Home"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Work"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", "Personal"), + util.ValidateStringInArray(resourceName+"."+resourceId, "column_names", zipCodeColumnName), + + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "zip_code_column_name", zipCodeColumnName), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.0.column_name", "Cell"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.0.type", "cell"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.0.column_name", "Personal"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.0.type", "personal"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.0.contactable_time_column", zipCodeColumnName), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.1.column_name", "Home"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "phone_columns.1.type", "home"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.1.column_name", "Work"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.1.type", "work"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "email_columns.1.contactable_time_column", zipCodeColumnName), + + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.#", "1"), + + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.0.column_name", "Cell"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.0.column_data_type", "TEXT"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.0.min", "2"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.0.max", "12"), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "column_data_type_specifications.0.max_length", "11"), + + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "preview_mode_column_name", previewModeColumnNameUpdated), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "preview_mode_accepted_values.0", previewModeColumnName), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "preview_mode_accepted_values.1", previewModeColumnNameUpdated), + resource.TestCheckResourceAttr(resourceName+"."+resourceId, "automatic_time_zone_mapping", automaticTimeZoneMappingUpdated), + resource.TestCheckResourceAttrPair("data.genesyscloud_outbound_attempt_limit."+attemptLimitDataSourceID, "id", + resourceName+"."+resourceId, "attempt_limit_id"), + ), + }, + { + ResourceName: resourceName + "." + resourceId, + ImportState: true, + ImportStateVerify: true, + }, + }, + CheckDestroy: testVerifyContactListTemplateDestroyed, + }) +} + +func testVerifyContactListTemplateDestroyed(state *terraform.State) error { + outboundAPI := platformclientv2.NewOutboundApi() + for _, rs := range state.RootModule().Resources { + if rs.Type != resourceName { + continue + } + contactList, resp, err := outboundAPI.GetOutboundContactlisttemplate(rs.Primary.ID) + if contactList != nil { + return fmt.Errorf("contact list template (%s) still exists", rs.Primary.ID) + } else if util.IsStatus404(resp) { + // Contact list template not found as expected + continue + } else { + // Unexpected error + return fmt.Errorf("unexpected error: %s", err) + } + } + // Success. All contact lists template destroyed + return nil +} diff --git a/genesyscloud/outbound_contact_list_template/resource_genesyscloud_outbound_contact_list_template_utils.go b/genesyscloud/outbound_contact_list_template/resource_genesyscloud_outbound_contact_list_template_utils.go new file mode 100644 index 000000000..4e02e407e --- /dev/null +++ b/genesyscloud/outbound_contact_list_template/resource_genesyscloud_outbound_contact_list_template_utils.go @@ -0,0 +1,233 @@ +package outbound_contact_list_template + +import ( + "fmt" + "strings" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" +) + +func buildSdkOutboundContactListTemplateContactPhoneNumberColumnSlice(contactPhoneNumberColumn *schema.Set) *[]platformclientv2.Contactphonenumbercolumn { + if contactPhoneNumberColumn == nil { + return nil + } + sdkContactPhoneNumberColumnSlice := make([]platformclientv2.Contactphonenumbercolumn, 0) + contactPhoneNumberColumnList := contactPhoneNumberColumn.List() + for _, configPhoneColumn := range contactPhoneNumberColumnList { + var sdkContactPhoneNumberColumn platformclientv2.Contactphonenumbercolumn + contactPhoneNumberColumnMap := configPhoneColumn.(map[string]interface{}) + if columnName := contactPhoneNumberColumnMap["column_name"].(string); columnName != "" { + sdkContactPhoneNumberColumn.ColumnName = &columnName + } + if varType := contactPhoneNumberColumnMap["type"].(string); varType != "" { + sdkContactPhoneNumberColumn.VarType = &varType + } + if callableTimeColumn := contactPhoneNumberColumnMap["callable_time_column"].(string); callableTimeColumn != "" { + sdkContactPhoneNumberColumn.CallableTimeColumn = &callableTimeColumn + } + + sdkContactPhoneNumberColumnSlice = append(sdkContactPhoneNumberColumnSlice, sdkContactPhoneNumberColumn) + } + return &sdkContactPhoneNumberColumnSlice +} + +func flattenSdkOutboundContactListTemplateContactPhoneNumberColumnSlice(contactPhoneNumberColumns []platformclientv2.Contactphonenumbercolumn) *schema.Set { + if len(contactPhoneNumberColumns) == 0 { + return nil + } + + contactPhoneNumberColumnSet := schema.NewSet(schema.HashResource(outboundContactListTemplateContactPhoneNumberColumnResource), []interface{}{}) + for _, contactPhoneNumberColumn := range contactPhoneNumberColumns { + contactPhoneNumberColumnMap := make(map[string]interface{}) + + if contactPhoneNumberColumn.ColumnName != nil { + contactPhoneNumberColumnMap["column_name"] = *contactPhoneNumberColumn.ColumnName + } + if contactPhoneNumberColumn.VarType != nil { + contactPhoneNumberColumnMap["type"] = *contactPhoneNumberColumn.VarType + } + if contactPhoneNumberColumn.CallableTimeColumn != nil { + contactPhoneNumberColumnMap["callable_time_column"] = *contactPhoneNumberColumn.CallableTimeColumn + } + + contactPhoneNumberColumnSet.Add(contactPhoneNumberColumnMap) + } + + return contactPhoneNumberColumnSet +} + +func buildSdkOutboundContactListContactEmailAddressColumnSlice(contactEmailAddressColumn *schema.Set) *[]platformclientv2.Emailcolumn { + if contactEmailAddressColumn == nil { + return nil + } + sdkContactEmailAddressColumnSlice := make([]platformclientv2.Emailcolumn, 0) + contactEmailAddressColumnList := contactEmailAddressColumn.List() + for _, configEmailColumn := range contactEmailAddressColumnList { + var sdkContactEmailAddressColumn platformclientv2.Emailcolumn + contactEmailAddressColumnMap := configEmailColumn.(map[string]interface{}) + if columnName := contactEmailAddressColumnMap["column_name"].(string); columnName != "" { + sdkContactEmailAddressColumn.ColumnName = &columnName + } + if varType := contactEmailAddressColumnMap["type"].(string); varType != "" { + sdkContactEmailAddressColumn.VarType = &varType + } + if contactableTimeColumn := contactEmailAddressColumnMap["contactable_time_column"].(string); contactableTimeColumn != "" { + sdkContactEmailAddressColumn.ContactableTimeColumn = &contactableTimeColumn + } + + sdkContactEmailAddressColumnSlice = append(sdkContactEmailAddressColumnSlice, sdkContactEmailAddressColumn) + } + return &sdkContactEmailAddressColumnSlice +} + +func flattenSdkOutboundContactListTemplateContactEmailAddressColumnSlice(contactEmailAddressColumns []platformclientv2.Emailcolumn) *schema.Set { + if len(contactEmailAddressColumns) == 0 { + return nil + } + + contactEmailAddressColumnSet := schema.NewSet(schema.HashResource(outboundContactListTemplateEmailColumnResource), []interface{}{}) + for _, contactEmailAddressColumn := range contactEmailAddressColumns { + contactEmailAddressColumnMap := make(map[string]interface{}) + + if contactEmailAddressColumn.ColumnName != nil { + contactEmailAddressColumnMap["column_name"] = *contactEmailAddressColumn.ColumnName + } + if contactEmailAddressColumn.VarType != nil { + contactEmailAddressColumnMap["type"] = *contactEmailAddressColumn.VarType + } + if contactEmailAddressColumn.ContactableTimeColumn != nil { + contactEmailAddressColumnMap["contactable_time_column"] = *contactEmailAddressColumn.ContactableTimeColumn + } + + contactEmailAddressColumnSet.Add(contactEmailAddressColumnMap) + } + + return contactEmailAddressColumnSet +} + +func buildSdkOutboundContactListTemplateColumnDataTypeSpecifications(columnDataTypeSpecifications []interface{}) *[]platformclientv2.Columndatatypespecification { + if columnDataTypeSpecifications == nil || len(columnDataTypeSpecifications) < 1 { + return nil + } + + sdkColumnDataTypeSpecificationsSlice := make([]platformclientv2.Columndatatypespecification, 0) + + for _, spec := range columnDataTypeSpecifications { + if specMap, ok := spec.(map[string]interface{}); ok { + var sdkColumnDataTypeSpecification platformclientv2.Columndatatypespecification + if columnNameStr, ok := specMap["column_name"].(string); ok { + sdkColumnDataTypeSpecification.ColumnName = &columnNameStr + } + if columnDataTypeStr, ok := specMap["column_data_type"].(string); ok && columnDataTypeStr != "" { + sdkColumnDataTypeSpecification.ColumnDataType = &columnDataTypeStr + } + if minInt, ok := specMap["min"].(int); ok { + sdkColumnDataTypeSpecification.Min = &minInt + } + if maxInt, ok := specMap["max"].(int); ok { + sdkColumnDataTypeSpecification.Max = &maxInt + } + if maxLengthInt, ok := specMap["max_length"].(int); ok { + sdkColumnDataTypeSpecification.MaxLength = &maxLengthInt + } + sdkColumnDataTypeSpecificationsSlice = append(sdkColumnDataTypeSpecificationsSlice, sdkColumnDataTypeSpecification) + } + } + + return &sdkColumnDataTypeSpecificationsSlice +} + +func flattenSdkOutboundContactListTemplateColumnDataTypeSpecifications(columnDataTypeSpecifications []platformclientv2.Columndatatypespecification) []interface{} { + if columnDataTypeSpecifications == nil || len(columnDataTypeSpecifications) == 0 { + return nil + } + + columnDataTypeSpecificationsSlice := make([]interface{}, 0) + + for _, s := range columnDataTypeSpecifications { + columnDataTypeSpecification := make(map[string]interface{}) + columnDataTypeSpecification["column_name"] = *s.ColumnName + + if s.ColumnDataType != nil { + columnDataTypeSpecification["column_data_type"] = *s.ColumnDataType + } + if s.Min != nil { + columnDataTypeSpecification["min"] = *s.Min + } + if s.Max != nil { + columnDataTypeSpecification["max"] = *s.Max + } + if s.MaxLength != nil { + columnDataTypeSpecification["max_length"] = *s.MaxLength + } + + columnDataTypeSpecificationsSlice = append(columnDataTypeSpecificationsSlice, columnDataTypeSpecification) + } + + return columnDataTypeSpecificationsSlice +} + +// type OutboundContactListInstance struct{ +// } + +// func (*OutboundContactListInstance) ResourceOutboundContactList() *schema.Resource { +// ResourceOutboundContactList() *schema.Resource +// } + +func GeneratePhoneColumnsBlock(columnName, columnType, callableTimeColumn string) string { + return fmt.Sprintf(` + phone_columns { + column_name = "%s" + type = "%s" + callable_time_column = %s + } +`, columnName, columnType, callableTimeColumn) +} + +func GenerateOutboundContactListTemplate( + resourceId string, + name string, + previewModeColumnName string, + previewModeAcceptedValues []string, + columnNames []string, + automaticTimeZoneMapping string, + zipCodeColumnName string, + attemptLimitId string, + nestedBlocks ...string) string { + return fmt.Sprintf(` +resource "%s" "%s" { + name = "%s" + preview_mode_column_name = %s + preview_mode_accepted_values = [%s] + column_names = [%s] + automatic_time_zone_mapping = %s + zip_code_column_name = %s + attempt_limit_id = %s + %s +} +`, resourceName, resourceId, name, previewModeColumnName, strings.Join(previewModeAcceptedValues, ", "), + strings.Join(columnNames, ", "), automaticTimeZoneMapping, zipCodeColumnName, attemptLimitId, strings.Join(nestedBlocks, "\n")) +} + +func GeneratePhoneColumnsDataTypeSpecBlock(columnName, columnDataType, min, max, maxLength string) string { + return fmt.Sprintf(` + column_data_type_specifications { + column_name = %s + column_data_type = %s + min = %s + max = %s + max_length = %s + } + `, columnName, columnDataType, min, max, maxLength) +} + +func GenerateEmailColumnsBlock(columnName, columnType, contactableTimeColumn string) string { + return fmt.Sprintf(` + email_columns { + column_name = "%s" + type = "%s" + contactable_time_column = %s + } +`, columnName, columnType, contactableTimeColumn) +} diff --git a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter.go b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter.go index ec48254e9..0ab00b849 100644 --- a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter.go +++ b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter.go @@ -76,7 +76,15 @@ func readOutboundContactlistfilter(ctx context.Context, d *schema.ResourceData, } resourcedata.SetNillableValue(d, "name", sdkContactListFilter.Name) - resourcedata.SetNillableReference(d, "contact_list_id", sdkContactListFilter.ContactList) + + switch { + case *sdkContactListFilter.SourceType == "ContactList": + resourcedata.SetNillableReference(d, "contact_list_id", sdkContactListFilter.ContactList) + case *sdkContactListFilter.SourceType == "ContactListTemplate": + resourcedata.SetNillableReference(d, "contact_list_template_id", sdkContactListFilter.ContactListTemplate) + default: + } + resourcedata.SetNillableValueWithInterfaceArrayWithFunc(d, "clauses", sdkContactListFilter.Clauses, flattenContactListFilterClauses) resourcedata.SetNillableValue(d, "filter_type", sdkContactListFilter.FilterType) diff --git a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_schema.go b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_schema.go index bfa6c7188..11f1c1505 100644 --- a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_schema.go +++ b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_schema.go @@ -1,11 +1,12 @@ package outbound_contactlistfilter import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "terraform-provider-genesyscloud/genesyscloud/provider" resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) /* @@ -134,9 +135,16 @@ func ResourceOutboundContactlistfilter() *schema.Resource { Type: schema.TypeString, }, `contact_list_id`: { - Description: `The contact list the filter is based on.`, - Required: true, - Type: schema.TypeString, + Description: `The contact list the filter is based on. Mutually exclusive to 'contact_list_template_id', however, one of the two must be specified`, + Optional: true, + Type: schema.TypeString, + ExactlyOneOf: []string{"contact_list_id", "contact_list_template_id"}, + }, + `contact_list_template_id`: { + Description: `The contact list template the filter is based on. Mutually exclusive to 'contact_list_id', however, one of the two must be specified.`, + Optional: true, + Type: schema.TypeString, + ExactlyOneOf: []string{"contact_list_id", "contact_list_template_id"}, }, `clauses`: { Description: `Groups of conditions to filter the contacts by.`, @@ -160,7 +168,8 @@ func OutboundContactlistfilterExporter() *resourceExporter.ResourceExporter { return &resourceExporter.ResourceExporter{ GetResourcesFunc: provider.GetAllWithPooledClient(getAllAuthOutboundContactlistfilters), RefAttrs: map[string]*resourceExporter.RefAttrSettings{ - "contact_list_id": {RefType: "genesyscloud_outbound_contact_list"}, + "contact_list_id": {RefType: "genesyscloud_outbound_contact_list"}, + "contact_list_template_id": {RefType: "genesyscloud_outbound_contact_list_template"}, }, } } diff --git a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_utils.go b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_utils.go index c76d07fdc..dd62522e1 100644 --- a/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_utils.go +++ b/genesyscloud/outbound_contactlistfilter/resource_genesyscloud_outbound_contactlistfilter_utils.go @@ -12,9 +12,21 @@ import ( func getContactlistfilterFromResourceData(d *schema.ResourceData) platformclientv2.Contactlistfilter { filter := platformclientv2.Contactlistfilter{ - Name: platformclientv2.String(d.Get("name").(string)), - ContactList: util.BuildSdkDomainEntityRef(d, "contact_list_id"), - Clauses: buildContactListFilterClauses(d.Get("clauses").([]interface{})), + Name: platformclientv2.String(d.Get("name").(string)), + Clauses: buildContactListFilterClauses(d.Get("clauses").([]interface{})), + } + contactList := util.BuildSdkDomainEntityRef(d, "contact_list_id") + contactListTemplate := util.BuildSdkDomainEntityRef(d, "contact_list_template_id") + + if contactList != nil { + filter.ContactList = contactList + contactListSource := "ContactList" + filter.SourceType = &contactListSource + } + if contactListTemplate != nil { + filter.ContactListTemplate = contactListTemplate + contactListTemplateSource := "ContactListTemplate" + filter.SourceType = &contactListTemplateSource } filterType := d.Get("filter_type").(string) @@ -224,7 +236,7 @@ func GenerateOutboundContactListFilterPredicates( %s %s %s - %s + %s %s } `, column, columnType, operator, value, inverted, varRangeBlock) diff --git a/genesyscloud/tfexporter/tf_exporter_resource_test.go b/genesyscloud/tfexporter/tf_exporter_resource_test.go index 2b164ee24..a64563797 100644 --- a/genesyscloud/tfexporter/tf_exporter_resource_test.go +++ b/genesyscloud/tfexporter/tf_exporter_resource_test.go @@ -39,6 +39,7 @@ import ( obCampaignRule "terraform-provider-genesyscloud/genesyscloud/outbound_campaignrule" outboundContactList "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list" outboundContactListContact "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list_contact" + outboundContactListTemplate "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list_template" obContactListFilter "terraform-provider-genesyscloud/genesyscloud/outbound_contactlistfilter" obDncList "terraform-provider-genesyscloud/genesyscloud/outbound_dnclist" obfst "terraform-provider-genesyscloud/genesyscloud/outbound_filespecificationtemplate" @@ -183,6 +184,7 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_outbound_callabletimeset"] = obCallableTimeset.ResourceOutboundCallabletimeset() providerResources["genesyscloud_outbound_campaign"] = obCampaign.ResourceOutboundCampaign() providerResources["genesyscloud_outbound_contact_list"] = outboundContactList.ResourceOutboundContactList() + providerResources["genesyscloud_outbound_contact_list_template"] = outboundContactListTemplate.ResourceOutboundContactListTemplate() providerResources["genesyscloud_outbound_contact_list_contact"] = outboundContactListContact.ResourceOutboundContactListContact() providerResources["genesyscloud_outbound_contactlistfilter"] = obContactListFilter.ResourceOutboundContactlistfilter() providerResources["genesyscloud_outbound_messagingcampaign"] = ob.ResourceOutboundMessagingCampaign() @@ -249,6 +251,7 @@ func (r *registerTestInstance) registerTestExporters() { RegisterExporter("genesyscloud_outbound_callabletimeset", obCallableTimeset.OutboundCallableTimesetExporter()) RegisterExporter("genesyscloud_outbound_campaign", obCampaign.OutboundCampaignExporter()) RegisterExporter("genesyscloud_outbound_contact_list", outboundContactList.OutboundContactListExporter()) + RegisterExporter("genesyscloud_outbound_contact_list_template", outboundContactListTemplate.OutboundContactListTemplateExporter()) RegisterExporter("genesyscloud_outbound_contact_list_contact", outboundContactListContact.ContactExporter()) RegisterExporter("genesyscloud_outbound_contactlistfilter", obContactListFilter.OutboundContactlistfilterExporter()) RegisterExporter("genesyscloud_outbound_messagingcampaign", ob.OutboundMessagingcampaignExporter()) diff --git a/main.go b/main.go index 300196cb3..2f64f1afa 100644 --- a/main.go +++ b/main.go @@ -47,6 +47,7 @@ import ( obCampaignRule "terraform-provider-genesyscloud/genesyscloud/outbound_campaignrule" obContactList "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list" outboundContactListContact "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list_contact" + obContactListTemplate "terraform-provider-genesyscloud/genesyscloud/outbound_contact_list_template" obContactListFilter "terraform-provider-genesyscloud/genesyscloud/outbound_contactlistfilter" obDncList "terraform-provider-genesyscloud/genesyscloud/outbound_dnclist" obfst "terraform-provider-genesyscloud/genesyscloud/outbound_filespecificationtemplate" @@ -183,6 +184,7 @@ func registerResources() { obCampaign.SetRegistrar(regInstance) //Registering outbound campaign obContactList.SetRegistrar(regInstance) //Registering outbound contact list obContactListFilter.SetRegistrar(regInstance) //Registering outbound contact list filter + obContactListTemplate.SetRegistrar(regInstance) //Registering outbound contact list template obSequence.SetRegistrar(regInstance) //Registering outbound sequence obCampaignRule.SetRegistrar(regInstance) //Registering outbound campaignrule obSettings.SetRegistrar(regInstance) //Registering outbound settings From 548e670d84b4e5c05c3fbe93f1b592cfaf8b8dc3 Mon Sep 17 00:00:00 2001 From: michalk-genesys Date: Tue, 16 Jul 2024 10:02:57 +0100 Subject: [PATCH 56/62] feat/GPE-14606 add support for Outcome Quantile Conditions (#1156) * feat/GPE-14606 add support for Outcome Quantile Conditions when working with Action Maps When setting up an Action Map with outcome scores tracking, Trigger With Outcome Quantile Conditions should now be used instead of Probability Conditions. * fix typo * reorder tests, add quantiles trigger * remove unnecessary comment * use deprecated attribute on resource --- docs/resources/journey_action_map.md | 16 +++++- ...esource_genesyscloud_journey_action_map.go | 54 +++++++++++++++++++ .../basic_optional_attributes/01_create.tf | 5 ++ .../02_update_all_optional_changed.tf | 6 +++ ...ger_with_outcome_probability_conditions.tf | 6 +++ .../04_update_remove_page_url_conditions.tf | 6 +++ .../05_update_remove_ignore_frequency_cap.tf | 6 +++ .../06_update_remove_end_date.tf | 6 +++ ...rigger_with_outcome_quantile_conditions.tf | 41 ++++++++++++++ ...08_update_remove_trigger_with_segments.tf} | 0 10 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/07_update_remove_trigger_with_outcome_quantile_conditions.tf rename test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/{07_update_remove_trigger_with_segments.tf => 08_update_remove_trigger_with_segments.tf} (100%) diff --git a/docs/resources/journey_action_map.md b/docs/resources/journey_action_map.md index 883fd233a..95b29d98c 100644 --- a/docs/resources/journey_action_map.md +++ b/docs/resources/journey_action_map.md @@ -54,7 +54,8 @@ resource "genesyscloud_journey_action_map" "example_journey_action_map" { - `is_active` (Boolean) Whether the action map is active. Defaults to `true`. - `page_url_conditions` (Block Set) URL conditions that a page must match for web actions to be displayable. (see [below for nested schema](#nestedblock--page_url_conditions)) - `trigger_with_event_conditions` (Block Set) List of event conditions that must be satisfied to trigger the action map. (see [below for nested schema](#nestedblock--trigger_with_event_conditions)) -- `trigger_with_outcome_probability_conditions` (Block Set) Probability conditions for outcomes that must be satisfied to trigger the action map. (see [below for nested schema](#nestedblock--trigger_with_outcome_probability_conditions)) +- `trigger_with_outcome_probability_conditions` (Block Set, Deprecated) Probability conditions for outcomes that must be satisfied to trigger the action map. (see [below for nested schema](#nestedblock--trigger_with_outcome_probability_conditions)) +- `trigger_with_outcome_quantile_conditions` (Block Set) Quantile conditions for outcomes that must be satisfied to trigger the action map. (see [below for nested schema](#nestedblock--trigger_with_outcome_quantile_conditions)) - `trigger_with_segments` (Set of String) Trigger action map if any segment in the list is assigned to a given customer. - `weight` (Number) Weight of the action map with higher number denoting higher weight. Low=1, Medium=2, High=3. Defaults to `2`. @@ -192,3 +193,16 @@ Optional: - `probability` (Number) Additional probability condition, where if set, the action map will trigger if the current outcome probability is lower or equal to the value. + + +### Nested Schema for `trigger_with_outcome_quantile_conditions` + +Required: + +- `max_quantile_threshold` (Number) This Outcome Quantile Condition is met when sessionMaxQuantile of the OutcomeScore is above this value, (unless fallbackQuantile is set). Range 0.00-1.00 +- `outcome_id` (String) The outcome ID. + +Optional: + +- `fallback_quantile_threshold` (Number) If set, this Condition is met when max_quantile_threshold is met, AND the current quantile of the OutcomeScore is below this fallback_quantile_threshold. Range 0.00-1.00 + diff --git a/genesyscloud/resource_genesyscloud_journey_action_map.go b/genesyscloud/resource_genesyscloud_journey_action_map.go index 2b9100ec4..6d74a105f 100644 --- a/genesyscloud/resource_genesyscloud_journey_action_map.go +++ b/genesyscloud/resource_genesyscloud_journey_action_map.go @@ -58,6 +58,13 @@ var ( Type: schema.TypeSet, Optional: true, Elem: outcomeProbabilityConditionResource, + Deprecated: "Use trigger_with_outcome_quantile_conditions attribute instead.", + }, + "trigger_with_outcome_quantile_conditions": { + Description: "Quantile conditions for outcomes that must be satisfied to trigger the action map.", + Type: schema.TypeSet, + Optional: true, + Elem: outcomeQuantileConditionResource, }, "page_url_conditions": { Description: "URL conditions that a page must match for web actions to be displayable.", @@ -173,6 +180,26 @@ var ( }, } + outcomeQuantileConditionResource = &schema.Resource{ + Schema: map[string]*schema.Schema{ + "outcome_id": { + Description: "The outcome ID.", + Type: schema.TypeString, + Required: true, + }, + "max_quantile_threshold": { + Description: "This Outcome Quantile Condition is met when sessionMaxQuantile of the OutcomeScore is above this value, (unless fallbackQuantile is set). Range 0.00-1.00", + Type: schema.TypeFloat, + Required: true, + }, + "fallback_quantile_threshold": { + Description: "If set, this Condition is met when max_quantile_threshold is met, AND the current quantile of the OutcomeScore is below this fallback_quantile_threshold. Range 0.00-1.00", + Type: schema.TypeFloat, + Optional: true, + }, + }, + } + urlConditionResource = &schema.Resource{ Schema: map[string]*schema.Schema{ "values": { @@ -388,6 +415,7 @@ func JourneyActionMapExporter() *resourceExporter.ResourceExporter { RefAttrs: map[string]*resourceExporter.RefAttrSettings{ "trigger_with_segments": {RefType: "genesyscloud_journey_segment"}, "trigger_with_outcome_probability_conditions.outcome_id": {RefType: "genesyscloud_journey_outcome"}, + "trigger_with_outcome_quantile_conditions.outcome_id": {RefType: "genesyscloud_journey_outcome"}, "action.architect_flow_fields.architect_flow_id": {RefType: "genesyscloud_flow"}, "action_map_schedule_groups.action_map_schedule_group_id": {RefType: "genesyscloud_architect_schedulegroups"}, "action_map_schedule_groups.emergency_action_map_schedule_group_id": {RefType: "genesyscloud_architect_schedulegroups"}, @@ -512,6 +540,7 @@ func flattenActionMap(d *schema.ResourceData, actionMap *platformclientv2.Action d.Set("trigger_with_segments", lists.StringListToSetOrNil(actionMap.TriggerWithSegments)) resourcedata.SetNillableValue(d, "trigger_with_event_conditions", lists.FlattenList(actionMap.TriggerWithEventConditions, flattenEventCondition)) resourcedata.SetNillableValue(d, "trigger_with_outcome_probability_conditions", lists.FlattenList(actionMap.TriggerWithOutcomeProbabilityConditions, flattenOutcomeProbabilityCondition)) + resourcedata.SetNillableValue(d, "trigger_with_outcome_quantile_conditions", lists.FlattenList(actionMap.TriggerWithOutcomeQuantileConditions, flattenOutcomeQuantileCondition)) resourcedata.SetNillableValue(d, "page_url_conditions", lists.FlattenList(actionMap.PageUrlConditions, flattenUrlCondition)) d.Set("activation", lists.FlattenAsList(actionMap.Activation, flattenActivation)) d.Set("weight", *actionMap.Weight) @@ -528,6 +557,7 @@ func buildSdkActionMap(actionMap *schema.ResourceData) *platformclientv2.Actionm triggerWithSegments := lists.BuildSdkStringList(actionMap, "trigger_with_segments") triggerWithEventConditions := resourcedata.BuildSdkList(actionMap, "trigger_with_event_conditions", buildSdkEventCondition) triggerWithOutcomeProbabilityConditions := resourcedata.BuildSdkList(actionMap, "trigger_with_outcome_probability_conditions", buildSdkOutcomeProbabilityCondition) + triggerWithOutcomeQuantileConditions := resourcedata.BuildSdkList(actionMap, "trigger_with_outcome_quantile_conditions", buildSdkOutcomeQuantileCondition) pageUrlConditions := resourcedata.BuildSdkList(actionMap, "page_url_conditions", buildSdkUrlCondition) activation := resourcedata.BuildSdkListFirstElement(actionMap, "activation", buildSdkActivation, true) weight := actionMap.Get("weight").(int) @@ -543,6 +573,7 @@ func buildSdkActionMap(actionMap *schema.ResourceData) *platformclientv2.Actionm TriggerWithSegments: triggerWithSegments, TriggerWithEventConditions: triggerWithEventConditions, TriggerWithOutcomeProbabilityConditions: triggerWithOutcomeProbabilityConditions, + TriggerWithOutcomeQuantileConditions: triggerWithOutcomeQuantileConditions, PageUrlConditions: pageUrlConditions, Activation: activation, Weight: &weight, @@ -560,6 +591,7 @@ func buildSdkPatchActionMap(patchActionMap *schema.ResourceData) *platformclient triggerWithSegments := lists.BuildSdkStringList(patchActionMap, "trigger_with_segments") triggerWithEventConditions := lists.NilToEmptyList(resourcedata.BuildSdkList(patchActionMap, "trigger_with_event_conditions", buildSdkEventCondition)) triggerWithOutcomeProbabilityConditions := lists.NilToEmptyList(resourcedata.BuildSdkList(patchActionMap, "trigger_with_outcome_probability_conditions", buildSdkOutcomeProbabilityCondition)) + triggerWithOutcomeQuantileConditions := lists.NilToEmptyList(resourcedata.BuildSdkList(patchActionMap, "trigger_with_outcome_quantile_conditions", buildSdkOutcomeQuantileCondition)) pageUrlConditions := lists.NilToEmptyList(resourcedata.BuildSdkList(patchActionMap, "page_url_conditions", buildSdkUrlCondition)) activation := resourcedata.BuildSdkListFirstElement(patchActionMap, "activation", buildSdkActivation, true) weight := patchActionMap.Get("weight").(int) @@ -575,6 +607,7 @@ func buildSdkPatchActionMap(patchActionMap *schema.ResourceData) *platformclient sdkPatchActionMap.SetField("TriggerWithSegments", triggerWithSegments) sdkPatchActionMap.SetField("TriggerWithEventConditions", triggerWithEventConditions) sdkPatchActionMap.SetField("TriggerWithOutcomeProbabilityConditions", triggerWithOutcomeProbabilityConditions) + sdkPatchActionMap.SetField("TriggerWithOutcomeQuantileConditions", triggerWithOutcomeQuantileConditions) sdkPatchActionMap.SetField("PageUrlConditions", pageUrlConditions) sdkPatchActionMap.SetField("Activation", activation) sdkPatchActionMap.SetField("Weight", &weight) @@ -636,6 +669,27 @@ func buildSdkOutcomeProbabilityCondition(outcomeProbabilityCondition map[string] } } +func flattenOutcomeQuantileCondition(outcomeQuantileCondition *platformclientv2.Outcomequantilecondition) map[string]interface{} { + outcomeQuantileConditionMap := make(map[string]interface{}) + outcomeQuantileConditionMap["outcome_id"] = *outcomeQuantileCondition.OutcomeId + outcomeQuantileConditionMap["max_quantile_threshold"] = *typeconv.Float32to64(outcomeQuantileCondition.MaxQuantileThreshold) + stringmap.SetValueIfNotNil(outcomeQuantileConditionMap, "fallback_quantile_threshold", typeconv.Float32to64(outcomeQuantileCondition.FallbackQuantileThreshold)) + return outcomeQuantileConditionMap +} + +func buildSdkOutcomeQuantileCondition(outcomeQuantileCondition map[string]interface{}) *platformclientv2.Outcomequantilecondition { + outcomeId := outcomeQuantileCondition["outcome_id"].(string) + maxQuantileThreshold64 := outcomeQuantileCondition["max_quantile_threshold"].(float64) + maxQuantileThreshold := typeconv.Float64to32(&maxQuantileThreshold64) + fallbackQuantileThreshold := typeconv.Float64to32(stringmap.GetNonDefaultValue[float64](outcomeQuantileCondition, "fallback_quantile_threshold")) + + return &platformclientv2.Outcomequantilecondition{ + OutcomeId: &outcomeId, + MaxQuantileThreshold: maxQuantileThreshold, + FallbackQuantileThreshold: fallbackQuantileThreshold, + } +} + func flattenUrlCondition(urlCondition *platformclientv2.Urlcondition) map[string]interface{} { urlConditionMap := make(map[string]interface{}) urlConditionMap["values"] = lists.StringListToSet(*urlCondition.Values) diff --git a/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/01_create.tf b/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/01_create.tf index c1296e27c..7441d8767 100644 --- a/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/01_create.tf +++ b/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/01_create.tf @@ -14,6 +14,11 @@ resource "genesyscloud_journey_action_map" "terraform_test_-TEST-CASE-" { outcome_id = genesyscloud_journey_outcome.terraform_test_-TEST-CASE-_action_map_dependency.id maximum_probability = 0.333 } + # optional + trigger_with_outcome_quantile_conditions { + outcome_id = genesyscloud_journey_outcome.terraform_test_-TEST-CASE-_action_map_dependency.id + max_quantile_threshold = 0.333 + } page_url_conditions { values = ["some_value"] operator = "containsAll" diff --git a/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/02_update_all_optional_changed.tf b/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/02_update_all_optional_changed.tf index dd73fb053..589c2a26d 100644 --- a/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/02_update_all_optional_changed.tf +++ b/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/02_update_all_optional_changed.tf @@ -15,6 +15,12 @@ resource "genesyscloud_journey_action_map" "terraform_test_-TEST-CASE-" { maximum_probability = 0.666 probability = 0.125 } + # optional + trigger_with_outcome_quantile_conditions { + outcome_id = genesyscloud_journey_outcome.terraform_test_-TEST-CASE-_action_map_dependency.id + max_quantile_threshold = 0.666 + fallback_quantile_threshold = 0.125 + } page_url_conditions { values = ["some_other_value", "some_other_value_2"] operator = "containsAny" diff --git a/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/03_update_remove_trigger_with_outcome_probability_conditions.tf b/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/03_update_remove_trigger_with_outcome_probability_conditions.tf index b4f800610..5dfede2fc 100644 --- a/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/03_update_remove_trigger_with_outcome_probability_conditions.tf +++ b/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/03_update_remove_trigger_with_outcome_probability_conditions.tf @@ -10,6 +10,12 @@ resource "genesyscloud_journey_action_map" "terraform_test_-TEST-CASE-" { } start_date = "2022-07-04T12:00:00.000000" # optional + trigger_with_outcome_quantile_conditions { + outcome_id = genesyscloud_journey_outcome.terraform_test_-TEST-CASE-_action_map_dependency.id + max_quantile_threshold = 0.666 + fallback_quantile_threshold = 0.125 + } + # optional page_url_conditions { values = ["some_other_value", "some_other_value_2"] operator = "containsAny" diff --git a/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/04_update_remove_page_url_conditions.tf b/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/04_update_remove_page_url_conditions.tf index 7cf97033c..a51657575 100644 --- a/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/04_update_remove_page_url_conditions.tf +++ b/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/04_update_remove_page_url_conditions.tf @@ -10,6 +10,12 @@ resource "genesyscloud_journey_action_map" "terraform_test_-TEST-CASE-" { } start_date = "2022-07-04T12:00:00.000000" # optional + trigger_with_outcome_quantile_conditions { + outcome_id = genesyscloud_journey_outcome.terraform_test_-TEST-CASE-_action_map_dependency.id + max_quantile_threshold = 0.666 + fallback_quantile_threshold = 0.125 + } + # optional ignore_frequency_cap = true end_date = "2022-08-01T10:30:00.999000" diff --git a/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/05_update_remove_ignore_frequency_cap.tf b/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/05_update_remove_ignore_frequency_cap.tf index a62c9d674..a05ee3dfd 100644 --- a/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/05_update_remove_ignore_frequency_cap.tf +++ b/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/05_update_remove_ignore_frequency_cap.tf @@ -10,6 +10,12 @@ resource "genesyscloud_journey_action_map" "terraform_test_-TEST-CASE-" { } start_date = "2022-07-04T12:00:00.000000" # optional + trigger_with_outcome_quantile_conditions { + outcome_id = genesyscloud_journey_outcome.terraform_test_-TEST-CASE-_action_map_dependency.id + max_quantile_threshold = 0.666 + fallback_quantile_threshold = 0.125 + } + # optional end_date = "2022-08-01T10:30:00.999000" depends_on = [genesyscloud_journey_segment.terraform_test_-TEST-CASE-_action_map_dependency] diff --git a/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/06_update_remove_end_date.tf b/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/06_update_remove_end_date.tf index e2f3c347b..2f674200d 100644 --- a/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/06_update_remove_end_date.tf +++ b/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/06_update_remove_end_date.tf @@ -10,6 +10,12 @@ resource "genesyscloud_journey_action_map" "terraform_test_-TEST-CASE-" { } start_date = "2022-07-04T12:00:00.000000" # optional + trigger_with_outcome_quantile_conditions { + outcome_id = genesyscloud_journey_outcome.terraform_test_-TEST-CASE-_action_map_dependency.id + max_quantile_threshold = 0.666 + fallback_quantile_threshold = 0.125 + } + # optional depends_on = [genesyscloud_journey_segment.terraform_test_-TEST-CASE-_action_map_dependency] } diff --git a/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/07_update_remove_trigger_with_outcome_quantile_conditions.tf b/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/07_update_remove_trigger_with_outcome_quantile_conditions.tf new file mode 100644 index 000000000..b4f800610 --- /dev/null +++ b/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/07_update_remove_trigger_with_outcome_quantile_conditions.tf @@ -0,0 +1,41 @@ +resource "genesyscloud_journey_action_map" "terraform_test_-TEST-CASE-" { + # required + display_name = "terraform_test_-TEST-CASE-_updated" + trigger_with_segments = [genesyscloud_journey_segment.terraform_test_-TEST-CASE-_action_map_dependency.id] + activation { + type = "immediate" + } + action { + media_type = "webMessagingOffer" + } + start_date = "2022-07-04T12:00:00.000000" + # optional + page_url_conditions { + values = ["some_other_value", "some_other_value_2"] + operator = "containsAny" + } + ignore_frequency_cap = true + end_date = "2022-08-01T10:30:00.999000" + + depends_on = [genesyscloud_journey_segment.terraform_test_-TEST-CASE-_action_map_dependency] +} + +resource "genesyscloud_journey_segment" "terraform_test_-TEST-CASE-_action_map_dependency" { + display_name = "terraform_test_-TEST-CASE-_action_map_dependency" + color = "#008000" + scope = "Session" + should_display_to_agent = false + journey { + patterns { + criteria { + key = "page.title" + values = ["Title"] + operator = "notEqual" + should_ignore_case = true + } + count = 1 + stream_type = "Web" + session_type = "web" + } + } +} diff --git a/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/07_update_remove_trigger_with_segments.tf b/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/08_update_remove_trigger_with_segments.tf similarity index 100% rename from test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/07_update_remove_trigger_with_segments.tf rename to test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/08_update_remove_trigger_with_segments.tf From 3fc2b8a6531a240e50231318444c87b7eebf8314 Mon Sep 17 00:00:00 2001 From: Brian Moyles <157126600+BrianMoyles@users.noreply.github.com> Date: Tue, 16 Jul 2024 10:11:33 +0100 Subject: [PATCH 57/62] Refactor Routing language (#1141) --- ...ta_source_genesyscloud_routing_language.go | 59 ------- ...d_recording_media_retention_policy_test.go | 3 +- ...ording_media_retention_policy_init_test.go | 3 +- ...d_recording_media_retention_policy_test.go | 9 +- genesyscloud/resource_genesyscloud_init.go | 3 - .../resource_genesyscloud_init_test.go | 5 +- .../resource_genesyscloud_routing_language.go | 164 ------------------ .../resource_genesyscloud_user_test.go | 9 +- ...esyscloud_routing_email_route_init_test.go | 4 +- ...e_genesyscloud_routing_email_route_test.go | 10 +- ...ta_source_genesyscloud_routing_language.go | 34 ++++ ...urce_genesyscloud_routing_language_test.go | 2 +- ...genesyscloud_routing_language_init_test.go | 60 +++++++ .../genesyscloud_routing_language_proxy.go | 154 ++++++++++++++++ .../resource_genesyscloud_routing_language.go | 119 +++++++++++++ ...ce_genesyscloud_routing_language_schema.go | 70 ++++++++ ...urce_genesyscloud_routing_language_test.go | 2 +- ...loud_task_management_workitem_init_test.go | 3 +- ...esyscloud_task_management_workitem_test.go | 3 +- ...loud_task_management_worktype_init_test.go | 3 +- ...esyscloud_task_management_worktype_test.go | 3 +- .../tfexporter/tf_exporter_resource_test.go | 6 +- main.go | 2 + 23 files changed, 477 insertions(+), 253 deletions(-) delete mode 100644 genesyscloud/data_source_genesyscloud_routing_language.go delete mode 100644 genesyscloud/resource_genesyscloud_routing_language.go create mode 100644 genesyscloud/routing_language/data_source_genesyscloud_routing_language.go rename genesyscloud/{ => routing_language}/data_source_genesyscloud_routing_language_test.go (98%) create mode 100644 genesyscloud/routing_language/genesyscloud_routing_language_init_test.go create mode 100644 genesyscloud/routing_language/genesyscloud_routing_language_proxy.go create mode 100644 genesyscloud/routing_language/resource_genesyscloud_routing_language.go create mode 100644 genesyscloud/routing_language/resource_genesyscloud_routing_language_schema.go rename genesyscloud/{ => routing_language}/resource_genesyscloud_routing_language_test.go (98%) diff --git a/genesyscloud/data_source_genesyscloud_routing_language.go b/genesyscloud/data_source_genesyscloud_routing_language.go deleted file mode 100644 index 729080fc8..000000000 --- a/genesyscloud/data_source_genesyscloud_routing_language.go +++ /dev/null @@ -1,59 +0,0 @@ -package genesyscloud - -import ( - "context" - "fmt" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" -) - -func dataSourceRoutingLanguage() *schema.Resource { - return &schema.Resource{ - Description: "Data source for Genesys Cloud Routing Languages. Select a language by name.", - ReadContext: provider.ReadWithPooledClient(dataSourceRoutingLanguageRead), - Schema: map[string]*schema.Schema{ - "name": { - Description: "Language name.", - Type: schema.TypeString, - Required: true, - }, - }, - } -} - -func dataSourceRoutingLanguageRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - sdkConfig := m.(*provider.ProviderMeta).ClientConfig - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - - name := d.Get("name").(string) - - // Find first non-deleted language by name. Retry in case new language is not yet indexed by search - return util.WithRetries(ctx, 15*time.Second, func() *retry.RetryError { - for pageNum := 1; ; pageNum++ { - const pageSize = 50 - languages, resp, getErr := routingAPI.GetRoutingLanguages(pageSize, pageNum, "", name, nil) - if getErr != nil { - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_language", fmt.Sprintf("Error requesting language %s | error: %s", name, getErr), resp)) - } - - if languages.Entities == nil || len(*languages.Entities) == 0 { - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_language", fmt.Sprintf("No routing languages found with name %s", name), resp)) - } - - for _, language := range *languages.Entities { - if language.Name != nil && *language.Name == name && - language.State != nil && *language.State != "deleted" { - d.SetId(*language.Id) - return nil - } - } - } - }) -} diff --git a/genesyscloud/recording_media_retention_policy/data_source_genesyscloud_recording_media_retention_policy_test.go b/genesyscloud/recording_media_retention_policy/data_source_genesyscloud_recording_media_retention_policy_test.go index 961f058bf..5f7992a0f 100644 --- a/genesyscloud/recording_media_retention_policy/data_source_genesyscloud_recording_media_retention_policy_test.go +++ b/genesyscloud/recording_media_retention_policy/data_source_genesyscloud_recording_media_retention_policy_test.go @@ -8,6 +8,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/architect_flow" authRole "terraform-provider-genesyscloud/genesyscloud/auth_role" "terraform-provider-genesyscloud/genesyscloud/provider" + routingLanguage "terraform-provider-genesyscloud/genesyscloud/routing_language" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" routingEmailDomain "terraform-provider-genesyscloud/genesyscloud/routing_email_domain" userRoles "terraform-provider-genesyscloud/genesyscloud/user_roles" @@ -170,7 +171,7 @@ func TestAccDataSourceRecordingMediaRetentionPolicy(t *testing.T) { gcloud.GenerateEvaluationFormResource(evaluationFormResource1, &evaluationFormResourceBody) + gcloud.GenerateSurveyFormResource(surveyFormResource1, &surveyFormResourceBody) + integration.GenerateIntegrationResource(integrationResource1, strconv.Quote(integrationIntendedState), strconv.Quote(integrationType), "") + - gcloud.GenerateRoutingLanguageResource(languageResource1, languageName) + + routingLanguage.GenerateRoutingLanguageResource(languageResource1, languageName) + gcloud.GenerateRoutingWrapupcodeResource(wrapupCodeResource1, wrapupCodeName) + architect_flow.GenerateFlowResource( flowResource1, diff --git a/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_init_test.go b/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_init_test.go index 903d045d6..b506ae6e5 100644 --- a/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_init_test.go +++ b/genesyscloud/recording_media_retention_policy/genesyscloud_recording_media_retention_policy_init_test.go @@ -9,6 +9,7 @@ import ( integration "terraform-provider-genesyscloud/genesyscloud/integration" "terraform-provider-genesyscloud/genesyscloud/provider" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" + routingLanguage "terraform-provider-genesyscloud/genesyscloud/routing_language" userRoles "terraform-provider-genesyscloud/genesyscloud/user_roles" routingEmailDomain "terraform-provider-genesyscloud/genesyscloud/routing_email_domain" @@ -53,7 +54,7 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_quality_forms_evaluation"] = gcloud.ResourceEvaluationForm() providerResources["genesyscloud_quality_forms_survey"] = gcloud.ResourceSurveyForm() providerResources["genesyscloud_integration"] = integration.ResourceIntegration() - providerResources["genesyscloud_routing_language"] = gcloud.ResourceRoutingLanguage() + providerResources["genesyscloud_routing_language"] = routingLanguage.ResourceRoutingLanguage() providerResources["genesyscloud_routing_wrapupcode"] = gcloud.ResourceRoutingWrapupCode() providerResources["genesyscloud_flow"] = flow.ResourceArchitectFlow() } diff --git a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_test.go b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_test.go index 8d38638ae..83cc84fa5 100644 --- a/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_test.go +++ b/genesyscloud/recording_media_retention_policy/resource_genesyscloud_recording_media_retention_policy_test.go @@ -10,6 +10,7 @@ import ( "terraform-provider-genesyscloud/genesyscloud/architect_flow" authRole "terraform-provider-genesyscloud/genesyscloud/auth_role" "terraform-provider-genesyscloud/genesyscloud/provider" + routingLanguage "terraform-provider-genesyscloud/genesyscloud/routing_language" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" routingEmailDomain "terraform-provider-genesyscloud/genesyscloud/routing_email_domain" userRoles "terraform-provider-genesyscloud/genesyscloud/user_roles" @@ -956,7 +957,7 @@ func TestAccResourceMediaRetentionPolicyBasic(t *testing.T) { gcloud.GenerateEvaluationFormResource(evaluationFormResource1, &evaluationFormResourceBody) + gcloud.GenerateSurveyFormResource(surveyFormResource1, &surveyFormResourceBody) + integration.GenerateIntegrationResource(integrationResource1, strconv.Quote(integrationIntendedState), strconv.Quote(integrationType), "") + - gcloud.GenerateRoutingLanguageResource(languageResource1, languageName) + + routingLanguage.GenerateRoutingLanguageResource(languageResource1, languageName) + gcloud.GenerateRoutingWrapupcodeResource(wrapupCodeResource1, wrapupCodeName) + architect_flow.GenerateFlowResource( flowResource1, @@ -1063,7 +1064,7 @@ func TestAccResourceMediaRetentionPolicyBasic(t *testing.T) { gcloud.GenerateEvaluationFormResource(evaluationFormResource1, &evaluationFormResourceBody) + gcloud.GenerateSurveyFormResource(surveyFormResource1, &surveyFormResourceBody) + integration.GenerateIntegrationResource(integrationResource1, strconv.Quote(integrationIntendedState), strconv.Quote(integrationType), "") + - gcloud.GenerateRoutingLanguageResource(languageResource1, languageName) + + routingLanguage.GenerateRoutingLanguageResource(languageResource1, languageName) + gcloud.GenerateRoutingWrapupcodeResource(wrapupCodeResource1, wrapupCodeName) + architect_flow.GenerateFlowResource( flowResource1, @@ -1170,7 +1171,7 @@ func TestAccResourceMediaRetentionPolicyBasic(t *testing.T) { gcloud.GenerateEvaluationFormResource(evaluationFormResource1, &evaluationFormResourceBody) + gcloud.GenerateSurveyFormResource(surveyFormResource1, &surveyFormResourceBody) + integration.GenerateIntegrationResource(integrationResource1, strconv.Quote(integrationIntendedState), strconv.Quote(integrationType), "") + - gcloud.GenerateRoutingLanguageResource(languageResource1, languageName) + + routingLanguage.GenerateRoutingLanguageResource(languageResource1, languageName) + gcloud.GenerateRoutingWrapupcodeResource(wrapupCodeResource1, wrapupCodeName) + architect_flow.GenerateFlowResource( flowResource1, @@ -1277,7 +1278,7 @@ func TestAccResourceMediaRetentionPolicyBasic(t *testing.T) { gcloud.GenerateEvaluationFormResource(evaluationFormResource1, &evaluationFormResourceBody) + gcloud.GenerateSurveyFormResource(surveyFormResource1, &surveyFormResourceBody) + integration.GenerateIntegrationResource(integrationResource1, strconv.Quote(integrationIntendedState), strconv.Quote(integrationType), "") + - gcloud.GenerateRoutingLanguageResource(languageResource1, languageName) + + routingLanguage.GenerateRoutingLanguageResource(languageResource1, languageName) + gcloud.GenerateRoutingWrapupcodeResource(wrapupCodeResource1, wrapupCodeName) + architect_flow.GenerateFlowResource( flowResource1, diff --git a/genesyscloud/resource_genesyscloud_init.go b/genesyscloud/resource_genesyscloud_init.go index cec0f5e64..1f1db0c9b 100644 --- a/genesyscloud/resource_genesyscloud_init.go +++ b/genesyscloud/resource_genesyscloud_init.go @@ -29,7 +29,6 @@ func registerDataSources(l registrar.Registrar) { l.RegisterDataSource("genesyscloud_organizations_me", DataSourceOrganizationsMe()) l.RegisterDataSource("genesyscloud_quality_forms_evaluation", DataSourceQualityFormsEvaluations()) l.RegisterDataSource("genesyscloud_quality_forms_survey", dataSourceQualityFormsSurvey()) - l.RegisterDataSource("genesyscloud_routing_language", dataSourceRoutingLanguage()) l.RegisterDataSource("genesyscloud_routing_skill", dataSourceRoutingSkill()) l.RegisterDataSource("genesyscloud_routing_skill_group", dataSourceRoutingSkillGroup()) l.RegisterDataSource("genesyscloud_routing_wrapupcode", DataSourceRoutingWrapupcode()) @@ -55,7 +54,6 @@ func registerResources(l registrar.Registrar) { l.RegisterResource("genesyscloud_location", ResourceLocation()) l.RegisterResource("genesyscloud_quality_forms_evaluation", ResourceEvaluationForm()) l.RegisterResource("genesyscloud_quality_forms_survey", ResourceSurveyForm()) - l.RegisterResource("genesyscloud_routing_language", ResourceRoutingLanguage()) l.RegisterResource("genesyscloud_routing_skill", ResourceRoutingSkill()) l.RegisterResource("genesyscloud_routing_skill_group", ResourceRoutingSkillGroup()) l.RegisterResource("genesyscloud_routing_wrapupcode", ResourceRoutingWrapupCode()) @@ -76,7 +74,6 @@ func registerExporters(l registrar.Registrar) { l.RegisterExporter("genesyscloud_location", LocationExporter()) l.RegisterExporter("genesyscloud_quality_forms_evaluation", EvaluationFormExporter()) l.RegisterExporter("genesyscloud_quality_forms_survey", SurveyFormExporter()) - l.RegisterExporter("genesyscloud_routing_language", RoutingLanguageExporter()) l.RegisterExporter("genesyscloud_routing_skill", RoutingSkillExporter()) l.RegisterExporter("genesyscloud_routing_skill_group", ResourceSkillGroupExporter()) l.RegisterExporter("genesyscloud_routing_wrapupcode", RoutingWrapupCodeExporter()) diff --git a/genesyscloud/resource_genesyscloud_init_test.go b/genesyscloud/resource_genesyscloud_init_test.go index d0b5ee2eb..4d46ea6ee 100644 --- a/genesyscloud/resource_genesyscloud_init_test.go +++ b/genesyscloud/resource_genesyscloud_init_test.go @@ -8,6 +8,7 @@ import ( architectSchedules "terraform-provider-genesyscloud/genesyscloud/architect_schedules" "terraform-provider-genesyscloud/genesyscloud/group" "terraform-provider-genesyscloud/genesyscloud/provider" + routinglanguage "terraform-provider-genesyscloud/genesyscloud/routing_language" routingEmailDomain "terraform-provider-genesyscloud/genesyscloud/routing_email_domain" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" routingSettings "terraform-provider-genesyscloud/genesyscloud/routing_settings" @@ -54,8 +55,8 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_location"] = ResourceLocation() providerResources["genesyscloud_quality_forms_evaluation"] = ResourceEvaluationForm() providerResources["genesyscloud_quality_forms_survey"] = ResourceSurveyForm() + providerResources["genesyscloud_routing_language"] = routinglanguage.ResourceRoutingLanguage() providerResources["genesyscloud_routing_email_domain"] = routingEmailDomain.ResourceRoutingEmailDomain() - providerResources["genesyscloud_routing_language"] = ResourceRoutingLanguage() providerResources["genesyscloud_routing_skill"] = ResourceRoutingSkill() providerResources["genesyscloud_routing_skill_group"] = ResourceRoutingSkillGroup() providerResources["genesyscloud_routing_settings"] = routingSettings.ResourceRoutingSettings() @@ -93,7 +94,7 @@ func (r *registerTestInstance) registerTestDataSources() { providerDataSources["genesyscloud_organizations_me"] = DataSourceOrganizationsMe() providerDataSources["genesyscloud_quality_forms_evaluation"] = DataSourceQualityFormsEvaluations() providerDataSources["genesyscloud_quality_forms_survey"] = dataSourceQualityFormsSurvey() - providerDataSources["genesyscloud_routing_language"] = dataSourceRoutingLanguage() + providerDataSources["genesyscloud_routing_language"] = routinglanguage.DataSourceRoutingLanguage() providerDataSources["genesyscloud_routing_skill"] = dataSourceRoutingSkill() providerDataSources["genesyscloud_routing_skill_group"] = dataSourceRoutingSkillGroup() providerDataSources["genesyscloud_routing_email_domain"] = routingEmailDomain.DataSourceRoutingEmailDomain() diff --git a/genesyscloud/resource_genesyscloud_routing_language.go b/genesyscloud/resource_genesyscloud_routing_language.go deleted file mode 100644 index 9340ff2b7..000000000 --- a/genesyscloud/resource_genesyscloud_routing_language.go +++ /dev/null @@ -1,164 +0,0 @@ -package genesyscloud - -import ( - "context" - "fmt" - "log" - "terraform-provider-genesyscloud/genesyscloud/provider" - "terraform-provider-genesyscloud/genesyscloud/util" - "terraform-provider-genesyscloud/genesyscloud/util/constants" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - - "terraform-provider-genesyscloud/genesyscloud/consistency_checker" - - resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" -) - -func getAllRoutingLanguages(_ context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { - resources := make(resourceExporter.ResourceIDMetaMap) - routingAPI := platformclientv2.NewRoutingApiWithConfig(clientConfig) - - for pageNum := 1; ; pageNum++ { - const pageSize = 100 - languages, resp, getErr := routingAPI.GetRoutingLanguages(pageSize, pageNum, "", "", nil) - if getErr != nil { - return nil, util.BuildAPIDiagnosticError("genesyscloud_routing_language", fmt.Sprintf("Failed to get page of languages: %v", getErr), resp) - } - - if languages.Entities == nil || len(*languages.Entities) == 0 { - break - } - - for _, language := range *languages.Entities { - if language.State != nil && *language.State != "deleted" { - resources[*language.Id] = &resourceExporter.ResourceMeta{Name: *language.Name} - } - } - } - - return resources, nil -} - -func RoutingLanguageExporter() *resourceExporter.ResourceExporter { - return &resourceExporter.ResourceExporter{ - GetResourcesFunc: provider.GetAllWithPooledClient(getAllRoutingLanguages), - RefAttrs: map[string]*resourceExporter.RefAttrSettings{}, // No references - } -} - -func ResourceRoutingLanguage() *schema.Resource { - return &schema.Resource{ - Description: "Genesys Cloud Routing Language", - - CreateContext: provider.CreateWithPooledClient(createRoutingLanguage), - ReadContext: provider.ReadWithPooledClient(readRoutingLanguage), - DeleteContext: provider.DeleteWithPooledClient(deleteRoutingLanguage), - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - SchemaVersion: 1, - Schema: map[string]*schema.Schema{ - "name": { - Description: "Language name. Changing the language_name attribute will cause the language object to be dropped and recreated with a new ID.", - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func createRoutingLanguage(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - name := d.Get("name").(string) - - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - - log.Printf("Creating language %s", name) - language, resp, err := routingAPI.PostRoutingLanguages(platformclientv2.Language{ - Name: &name, - }) - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_routing_language", fmt.Sprintf("Failed to create language %s error: %s", name, err), resp) - } - - d.SetId(*language.Id) - - log.Printf("Created language %s %s", name, *language.Id) - return readRoutingLanguage(ctx, d, meta) -} - -func readRoutingLanguage(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - routingApi := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceRoutingLanguage(), constants.DefaultConsistencyChecks, "genesyscloud_routing_language") - - log.Printf("Reading language %s", d.Id()) - return util.WithRetriesForRead(ctx, d, func() *retry.RetryError { - language, resp, getErr := routingApi.GetRoutingLanguage(d.Id()) - if getErr != nil { - if util.IsStatus404(resp) { - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_language", fmt.Sprintf("Failed to read language %s | error: %s", d.Id(), getErr), resp)) - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_language", fmt.Sprintf("Failed to read language %s | error: %s", d.Id(), getErr), resp)) - } - - if language.State != nil && *language.State == "deleted" { - d.SetId("") - return nil - } - - d.Set("name", *language.Name) - log.Printf("Read language %s %s", d.Id(), *language.Name) - return cc.CheckState(d) - }) -} - -func deleteRoutingLanguage(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - name := d.Get("name").(string) - - sdkConfig := meta.(*provider.ProviderMeta).ClientConfig - routingApi := platformclientv2.NewRoutingApiWithConfig(sdkConfig) - - log.Printf("Deleting language %s", name) - resp, err := routingApi.DeleteRoutingLanguage(d.Id()) - - if err != nil { - return util.BuildAPIDiagnosticError("genesyscloud_routing_language", fmt.Sprintf("Failed to delete language %s error: %s", name, err), resp) - } - - return util.WithRetries(ctx, 30*time.Second, func() *retry.RetryError { - routingLanguage, resp, err := routingApi.GetRoutingLanguage(d.Id()) - if err != nil { - if util.IsStatus404(resp) { - // Routing language deleted - log.Printf("Deleted Routing language %s", d.Id()) - return nil - } - return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_language", fmt.Sprintf("Error deleting Routing language %s | error: %s", d.Id(), err), resp)) - } - - if routingLanguage.State != nil && *routingLanguage.State == "deleted" { - // Routing language deleted - log.Printf("Deleted Routing language %s", d.Id()) - return nil - } - - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_routing_language", fmt.Sprintf("Routing language %s still exists", d.Id()), resp)) - }) -} - -func GenerateRoutingLanguageResource( - resourceID string, - name string) string { - return fmt.Sprintf(`resource "genesyscloud_routing_language" "%s" { - name = "%s" - } - `, resourceID, name) -} diff --git a/genesyscloud/resource_genesyscloud_user_test.go b/genesyscloud/resource_genesyscloud_user_test.go index 4dd536e5f..825230c02 100644 --- a/genesyscloud/resource_genesyscloud_user_test.go +++ b/genesyscloud/resource_genesyscloud_user_test.go @@ -6,6 +6,7 @@ import ( "strconv" "strings" "terraform-provider-genesyscloud/genesyscloud/provider" + routinglanguage "terraform-provider-genesyscloud/genesyscloud/routing_language" routingUtilization "terraform-provider-genesyscloud/genesyscloud/routing_utilization" routingUtilizationLabel "terraform-provider-genesyscloud/genesyscloud/routing_utilization_label" "terraform-provider-genesyscloud/genesyscloud/util" @@ -486,7 +487,7 @@ func TestAccResourceUserLanguages(t *testing.T) { email1, userName1, generateUserRoutingLang("genesyscloud_routing_language."+langResource1+".id", proficiency1), - ) + GenerateRoutingLanguageResource(langResource1, langName1), + ) + routinglanguage.GenerateRoutingLanguageResource(langResource1, langName1), Check: resource.ComposeTestCheckFunc( validateUserLanguage("genesyscloud_user."+userResource1, "genesyscloud_routing_language."+langResource1, proficiency1), ), @@ -499,10 +500,10 @@ func TestAccResourceUserLanguages(t *testing.T) { userName1, generateUserRoutingLang("genesyscloud_routing_language."+langResource1+".id", proficiency1), generateUserRoutingLang("genesyscloud_routing_language."+langResource2+".id", proficiency2), - ) + GenerateRoutingLanguageResource( + ) + routinglanguage.GenerateRoutingLanguageResource( langResource1, langName1, - ) + GenerateRoutingLanguageResource( + ) + routinglanguage.GenerateRoutingLanguageResource( langResource2, langName2, ), @@ -518,7 +519,7 @@ func TestAccResourceUserLanguages(t *testing.T) { email1, userName1, generateUserRoutingLang("genesyscloud_routing_language."+langResource2+".id", proficiency1), - ) + GenerateRoutingLanguageResource( + ) + routinglanguage.GenerateRoutingLanguageResource( langResource2, langName2, ), diff --git a/genesyscloud/routing_email_route/genesyscloud_routing_email_route_init_test.go b/genesyscloud/routing_email_route/genesyscloud_routing_email_route_init_test.go index 023de9953..dd8dee2d5 100644 --- a/genesyscloud/routing_email_route/genesyscloud_routing_email_route_init_test.go +++ b/genesyscloud/routing_email_route/genesyscloud_routing_email_route_init_test.go @@ -6,8 +6,8 @@ import ( architectFlow "terraform-provider-genesyscloud/genesyscloud/architect_flow" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" + routingLanguage "terraform-provider-genesyscloud/genesyscloud/routing_language" routingEmailDomain "terraform-provider-genesyscloud/genesyscloud/routing_email_domain" - "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -37,7 +37,7 @@ func (r *registerTestInstance) registerTestResources() { providerResources[resourceName] = ResourceRoutingEmailRoute() providerResources["genesyscloud_routing_email_domain"] = routingEmailDomain.ResourceRoutingEmailDomain() providerResources["genesyscloud_routing_queue"] = routingQueue.ResourceRoutingQueue() - providerResources["genesyscloud_routing_language"] = genesyscloud.ResourceRoutingLanguage() + providerResources["genesyscloud_routing_language"] = routingLanguage.ResourceRoutingLanguage() providerResources["genesyscloud_routing_skill"] = genesyscloud.ResourceRoutingSkill() providerResources["genesyscloud_flow"] = architectFlow.ResourceArchitectFlow() providerResources["genesyscloud_routing_skill_group"] = genesyscloud.ResourceRoutingSkillGroup() diff --git a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go index 6b4804baa..075eb78e3 100644 --- a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go +++ b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go @@ -9,7 +9,9 @@ import ( "terraform-provider-genesyscloud/genesyscloud/architect_flow" "terraform-provider-genesyscloud/genesyscloud/provider" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" + routingLanguage "terraform-provider-genesyscloud/genesyscloud/routing_language" routingEmailDomain "terraform-provider-genesyscloud/genesyscloud/routing_email_domain" + "terraform-provider-genesyscloud/genesyscloud/util" "testing" "time" @@ -125,7 +127,7 @@ func TestAccResourceRoutingEmailRoute(t *testing.T) { ) + routingQueue.GenerateRoutingQueueResourceBasic( queueResource, queueName, - ) + gcloud.GenerateRoutingLanguageResource( + ) + routingLanguage.GenerateRoutingLanguageResource( langResource, langName, ) + gcloud.GenerateRoutingSkillResource( @@ -197,7 +199,7 @@ func TestAccResourceRoutingEmailRoute(t *testing.T) { queueResource, queueName, - ) + gcloud.GenerateRoutingLanguageResource( + ) + routingLanguage.GenerateRoutingLanguageResource( langResource, langName, ) + gcloud.GenerateRoutingSkillResource( @@ -254,7 +256,7 @@ func TestAccResourceRoutingEmailRoute(t *testing.T) { ) + routingQueue.GenerateRoutingQueueResourceBasic( queueResource, queueName, - ) + gcloud.GenerateRoutingLanguageResource( + ) + routingLanguage.GenerateRoutingLanguageResource( langResource, langName, ) + gcloud.GenerateRoutingSkillResource( @@ -316,7 +318,7 @@ func TestAccResourceRoutingEmailRoute(t *testing.T) { ) + routingQueue.GenerateRoutingQueueResourceBasic( queueResource, queueName, - ) + gcloud.GenerateRoutingLanguageResource( + ) + routingLanguage.GenerateRoutingLanguageResource( langResource, langName, ) + gcloud.GenerateRoutingSkillResource( diff --git a/genesyscloud/routing_language/data_source_genesyscloud_routing_language.go b/genesyscloud/routing_language/data_source_genesyscloud_routing_language.go new file mode 100644 index 000000000..fb231d336 --- /dev/null +++ b/genesyscloud/routing_language/data_source_genesyscloud_routing_language.go @@ -0,0 +1,34 @@ +package routing_language + +import ( + "context" + "fmt" + "terraform-provider-genesyscloud/genesyscloud/provider" + "terraform-provider-genesyscloud/genesyscloud/util" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceRoutingLanguageRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + sdkConfig := m.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingLanguageProxy(sdkConfig) + name := d.Get("name").(string) + + // Find first non-deleted language by name. Retry in case new language is not yet indexed by search + return util.WithRetries(ctx, 15*time.Second, func() *retry.RetryError { + languageId, resp, retryable, err := proxy.getRoutingLanguageIdByName(ctx, name) + if err != nil && !retryable { + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Error requesting language %s | error: %s", name, err), resp)) + } + if retryable { + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Error requesting language %s | error: %s", name, err), resp)) + } + + d.SetId(languageId) + return nil + }) +} diff --git a/genesyscloud/data_source_genesyscloud_routing_language_test.go b/genesyscloud/routing_language/data_source_genesyscloud_routing_language_test.go similarity index 98% rename from genesyscloud/data_source_genesyscloud_routing_language_test.go rename to genesyscloud/routing_language/data_source_genesyscloud_routing_language_test.go index 018c1d2e9..5b3a724f2 100644 --- a/genesyscloud/data_source_genesyscloud_routing_language_test.go +++ b/genesyscloud/routing_language/data_source_genesyscloud_routing_language_test.go @@ -1,4 +1,4 @@ -package genesyscloud +package routing_language import ( "fmt" diff --git a/genesyscloud/routing_language/genesyscloud_routing_language_init_test.go b/genesyscloud/routing_language/genesyscloud_routing_language_init_test.go new file mode 100644 index 000000000..5642770cb --- /dev/null +++ b/genesyscloud/routing_language/genesyscloud_routing_language_init_test.go @@ -0,0 +1,60 @@ +package routing_language + +import ( + "sync" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +/* +The genesyscloud_routing_language_init_test.go file is used to initialize the data sources and resources +used in testing the routing_language resource. +*/ + +// providerDataSources holds a map of all registered datasources +var providerDataSources map[string]*schema.Resource + +// providerResources holds a map of all registered resources +var providerResources map[string]*schema.Resource + +type registerTestInstance struct { + resourceMapMutex sync.RWMutex + dataSourceMapMutex sync.RWMutex +} + +// registerTestResources registers all resources used in the tests +func (r *registerTestInstance) registerTestResources() { + r.resourceMapMutex.Lock() + defer r.resourceMapMutex.Unlock() + + providerResources[resourceName] = ResourceRoutingLanguage() +} + +// registerTestDataSources registers all data sources used in the tests. +func (r *registerTestInstance) registerTestDataSources() { + r.dataSourceMapMutex.Lock() + defer r.dataSourceMapMutex.Unlock() + + providerDataSources[resourceName] = DataSourceRoutingLanguage() +} + +// initTestResources initializes all test resources and data sources. +func initTestResources() { + providerDataSources = make(map[string]*schema.Resource) + providerResources = make(map[string]*schema.Resource) + + regInstance := ®isterTestInstance{} + + regInstance.registerTestResources() + regInstance.registerTestDataSources() +} + +// TestMain is a "setup" function called by the testing framework when run the test +func TestMain(m *testing.M) { + // Run setup function before starting the test suite for routing_language package + initTestResources() + + // Run the test suite for the routing_language package + m.Run() +} diff --git a/genesyscloud/routing_language/genesyscloud_routing_language_proxy.go b/genesyscloud/routing_language/genesyscloud_routing_language_proxy.go new file mode 100644 index 000000000..4e989950f --- /dev/null +++ b/genesyscloud/routing_language/genesyscloud_routing_language_proxy.go @@ -0,0 +1,154 @@ +package routing_language + +import ( + "context" + "fmt" + "log" + rc "terraform-provider-genesyscloud/genesyscloud/resource_cache" + + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" +) + +var internalProxy *routingLanguageProxy + +type getAllRoutingLanguagesFunc func(ctx context.Context, p *routingLanguageProxy, name string) (*[]platformclientv2.Language, *platformclientv2.APIResponse, error) +type createRoutingLanguageFunc func(ctx context.Context, p *routingLanguageProxy, language *platformclientv2.Language) (*platformclientv2.Language, *platformclientv2.APIResponse, error) +type getRoutingLanguageByIdFunc func(ctx context.Context, p *routingLanguageProxy, id string) (*platformclientv2.Language, *platformclientv2.APIResponse, error) +type getRoutingLanguageIdByNameFunc func(ctx context.Context, p *routingLanguageProxy, name string) (string, *platformclientv2.APIResponse, bool, error) +type deleteRoutingLanguageFunc func(ctx context.Context, p *routingLanguageProxy, id string) (*platformclientv2.APIResponse, error) + +// routingLanguageProxy contains all of the methods that call genesys cloud APIs. +type routingLanguageProxy struct { + clientConfig *platformclientv2.Configuration + routingApi *platformclientv2.RoutingApi + createRoutingLanguageAttr createRoutingLanguageFunc + getAllRoutingLanguagesAttr getAllRoutingLanguagesFunc + getRoutingLanguageIdByNameAttr getRoutingLanguageIdByNameFunc + getRoutingLanguageByIdAttr getRoutingLanguageByIdFunc + deleteRoutingLanguageAttr deleteRoutingLanguageFunc + routingLanguageCache rc.CacheInterface[platformclientv2.Language] +} + +// newRoutingLanguageProxy initializes the routing language proxy with all of the data needed to communicate with Genesys Cloud +func newRoutingLanguageProxy(clientConfig *platformclientv2.Configuration) *routingLanguageProxy { + api := platformclientv2.NewRoutingApiWithConfig(clientConfig) + routingLanguageCache := rc.NewResourceCache[platformclientv2.Language]() + return &routingLanguageProxy{ + clientConfig: clientConfig, + routingApi: api, + createRoutingLanguageAttr: createRoutingLanguageFn, + getAllRoutingLanguagesAttr: getAllRoutingLanguagesFn, + getRoutingLanguageIdByNameAttr: getRoutingLanguageIdByNameFn, + getRoutingLanguageByIdAttr: getRoutingLanguageByIdFn, + deleteRoutingLanguageAttr: deleteRoutingLanguageFn, + routingLanguageCache: routingLanguageCache, + } +} + +func getRoutingLanguageProxy(clientConfig *platformclientv2.Configuration) *routingLanguageProxy { + if internalProxy == nil { + internalProxy = newRoutingLanguageProxy(clientConfig) + } + return internalProxy +} + +// getRoutingLanguage retrieves all Genesys Cloud routing language +func (p *routingLanguageProxy) getAllRoutingLanguages(ctx context.Context, name string) (*[]platformclientv2.Language, *platformclientv2.APIResponse, error) { + return p.getAllRoutingLanguagesAttr(ctx, p, name) +} + +// createRoutingLanguage creates a Genesys Cloud routing language +func (p *routingLanguageProxy) createRoutingLanguage(ctx context.Context, routingLanguage *platformclientv2.Language) (*platformclientv2.Language, *platformclientv2.APIResponse, error) { + return p.createRoutingLanguageAttr(ctx, p, routingLanguage) +} + +// getRoutingLanguageById returns a single Genesys Cloud routing language by Id +func (p *routingLanguageProxy) getRoutingLanguageById(ctx context.Context, id string) (*platformclientv2.Language, *platformclientv2.APIResponse, error) { + return p.getRoutingLanguageByIdAttr(ctx, p, id) +} + +// getRoutingLanguageIdByName returns a single Genesys Cloud routing language by a name +func (p *routingLanguageProxy) getRoutingLanguageIdByName(ctx context.Context, name string) (string, *platformclientv2.APIResponse, bool, error) { + return p.getRoutingLanguageIdByNameAttr(ctx, p, name) +} + +// deleteRoutingLanguage deletes a Genesys Cloud routing language by Id +func (p *routingLanguageProxy) deleteRoutingLanguage(ctx context.Context, id string) (*platformclientv2.APIResponse, error) { + return p.deleteRoutingLanguageAttr(ctx, p, id) +} + +// getAllRoutingLanguageFn is the implementation for retrieving all routing language in Genesys Cloud +func getAllRoutingLanguagesFn(ctx context.Context, p *routingLanguageProxy, name string) (*[]platformclientv2.Language, *platformclientv2.APIResponse, error) { + var ( + allLanguages []platformclientv2.Language + response *platformclientv2.APIResponse + pageSize = 100 + ) + + languages, resp, err := p.routingApi.GetRoutingLanguages(pageSize, 1, "", name, []string{}) + if err != nil { + return nil, resp, fmt.Errorf("failed to get language: %v", err) + } + + if languages.Entities == nil || len(*languages.Entities) == 0 { + return &allLanguages, resp, nil + } + allLanguages = append(allLanguages, *languages.Entities...) + + for pageNum := 2; pageNum <= *languages.PageCount; pageNum++ { + languages, resp, err := p.routingApi.GetRoutingLanguages(pageSize, pageNum, "", name, []string{}) + if err != nil { + return nil, resp, fmt.Errorf("failed to get language: %v", err) + } + + response = resp + if languages.Entities == nil || len(*languages.Entities) == 0 { + break + } + allLanguages = append(allLanguages, *languages.Entities...) + } + + for _, language := range allLanguages { + rc.SetCache(p.routingLanguageCache, *language.Id, language) + } + + return &allLanguages, response, nil +} + +// createRoutingLanguageFn is an implementation function for creating a Genesys Cloud routing language +func createRoutingLanguageFn(ctx context.Context, p *routingLanguageProxy, routingLanguage *platformclientv2.Language) (*platformclientv2.Language, *platformclientv2.APIResponse, error) { + return p.routingApi.PostRoutingLanguages(*routingLanguage) +} + +// getRoutingLanguageByIdFn is an implementation of the function to get a Genesys Cloud routing language by Id +func getRoutingLanguageByIdFn(ctx context.Context, p *routingLanguageProxy, id string) (*platformclientv2.Language, *platformclientv2.APIResponse, error) { + if language := rc.GetCacheItem(p.routingLanguageCache, id); language != nil { + return language, nil, nil + } + return p.routingApi.GetRoutingLanguage(id) +} + +// getRoutingLanguageIdByNameFn is an implementation of the function to get a Genesys Cloud routing language by name +func getRoutingLanguageIdByNameFn(ctx context.Context, p *routingLanguageProxy, name string) (string, *platformclientv2.APIResponse, bool, error) { + languages, resp, err := getAllRoutingLanguagesFn(ctx, p, name) + if err != nil { + return "", resp, false, err + } + + if languages == nil || len(*languages) == 0 { + return "", resp, true, fmt.Errorf("no routing language found with name %s", name) + } + + for _, language := range *languages { + if *language.Name == name { + log.Printf("Retrieved the routing language id %s by name %s", *language.Id, name) + return *language.Id, resp, false, nil + } + } + return "", resp, true, fmt.Errorf("unable to find routing language with name %s", name) +} + +// deleteRoutingLanguageFn is an implementation function for deleting a Genesys Cloud routing language +func deleteRoutingLanguageFn(ctx context.Context, p *routingLanguageProxy, id string) (*platformclientv2.APIResponse, error) { + return p.routingApi.DeleteRoutingLanguage(id) +} diff --git a/genesyscloud/routing_language/resource_genesyscloud_routing_language.go b/genesyscloud/routing_language/resource_genesyscloud_routing_language.go new file mode 100644 index 000000000..3ffee932a --- /dev/null +++ b/genesyscloud/routing_language/resource_genesyscloud_routing_language.go @@ -0,0 +1,119 @@ +package routing_language + +import ( + "context" + "fmt" + "log" + "terraform-provider-genesyscloud/genesyscloud/provider" + "terraform-provider-genesyscloud/genesyscloud/util" + "terraform-provider-genesyscloud/genesyscloud/util/constants" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + + "terraform-provider-genesyscloud/genesyscloud/consistency_checker" + + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" +) + +func getAllRoutingLanguages(ctx context.Context, clientConfig *platformclientv2.Configuration) (resourceExporter.ResourceIDMetaMap, diag.Diagnostics) { + resources := make(resourceExporter.ResourceIDMetaMap) + proxy := getRoutingLanguageProxy(clientConfig) + + languages, resp, getErr := proxy.getAllRoutingLanguages(ctx, "") + if getErr != nil { + return nil, util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to get page of languages: %v", getErr), resp) + } + + if languages == nil || len(*languages) == 0 { + return resources, nil + } + + for _, language := range *languages { + if language.State != nil && *language.State != "deleted" { + resources[*language.Id] = &resourceExporter.ResourceMeta{Name: *language.Name} + } + } + return resources, nil +} + +func createRoutingLanguage(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingLanguageProxy(sdkConfig) + name := d.Get("name").(string) + + log.Printf("Creating language %s", name) + + language, resp, err := proxy.createRoutingLanguage(ctx, &platformclientv2.Language{ + Name: &name, + }) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to create language %s error: %s", name, err), resp) + } + + d.SetId(*language.Id) + + log.Printf("Created language %s %s", name, *language.Id) + return readRoutingLanguage(ctx, d, meta) +} + +func readRoutingLanguage(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingLanguageProxy(sdkConfig) + cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceRoutingLanguage(), constants.DefaultConsistencyChecks, resourceName) + + log.Printf("Reading routing language %s", d.Id()) + return util.WithRetriesForRead(ctx, d, func() *retry.RetryError { + language, resp, getErr := proxy.getRoutingLanguageById(ctx, d.Id()) + if getErr != nil { + if util.IsStatus404(resp) { + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read language %s | error: %s", d.Id(), getErr), resp)) + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read language %s | error: %s", d.Id(), getErr), resp)) + } + + if language.State != nil && *language.State == "deleted" { + d.SetId("") + return nil + } + + _ = d.Set("name", *language.Name) + log.Printf("Read routing language %s %s", d.Id(), *language.Name) + return cc.CheckState(d) + }) +} + +func deleteRoutingLanguage(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sdkConfig := meta.(*provider.ProviderMeta).ClientConfig + proxy := getRoutingLanguageProxy(sdkConfig) + name := d.Get("name").(string) + + log.Printf("Deleting language %s", name) + resp, err := proxy.deleteRoutingLanguage(ctx, d.Id()) + if err != nil { + return util.BuildAPIDiagnosticError(resourceName, fmt.Sprintf("Failed to delete language %s error: %s", name, err), resp) + } + + return util.WithRetries(ctx, 30*time.Second, func() *retry.RetryError { + routingLanguage, resp, err := proxy.getRoutingLanguageById(ctx, d.Id()) + if err != nil { + if util.IsStatus404(resp) { + // Routing language deleted + log.Printf("Deleted Routing language %s", d.Id()) + return nil + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Error deleting Routing language %s | error: %s", d.Id(), err), resp)) + } + + if routingLanguage.State != nil && *routingLanguage.State == "deleted" { + // Routing language deleted + log.Printf("Deleted Routing language %s", d.Id()) + return nil + } + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Routing language %s still exists", d.Id()), resp)) + }) +} diff --git a/genesyscloud/routing_language/resource_genesyscloud_routing_language_schema.go b/genesyscloud/routing_language/resource_genesyscloud_routing_language_schema.go new file mode 100644 index 000000000..6ae346a4e --- /dev/null +++ b/genesyscloud/routing_language/resource_genesyscloud_routing_language_schema.go @@ -0,0 +1,70 @@ +package routing_language + +import ( + "fmt" + "terraform-provider-genesyscloud/genesyscloud/provider" + resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter" + registrar "terraform-provider-genesyscloud/genesyscloud/resource_register" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const resourceName = "genesyscloud_routing_language" + +// SetRegistrar registers all of the resources, datasources and exporters in the package +func SetRegistrar(regInstance registrar.Registrar) { + regInstance.RegisterResource(resourceName, ResourceRoutingLanguage()) + regInstance.RegisterExporter(resourceName, RoutingLanguageExporter()) + regInstance.RegisterDataSource(resourceName, DataSourceRoutingLanguage()) +} + +func ResourceRoutingLanguage() *schema.Resource { + return &schema.Resource{ + Description: "Genesys Cloud Routing Language", + + CreateContext: provider.CreateWithPooledClient(createRoutingLanguage), + ReadContext: provider.ReadWithPooledClient(readRoutingLanguage), + DeleteContext: provider.DeleteWithPooledClient(deleteRoutingLanguage), + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + SchemaVersion: 1, + Schema: map[string]*schema.Schema{ + "name": { + Description: "Language name. Changing the language_name attribute will cause the language object to be dropped and recreated with a new ID.", + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + }, + } +} + +func DataSourceRoutingLanguage() *schema.Resource { + return &schema.Resource{ + Description: "Data source for Genesys Cloud Routing Languages. Select a language by name.", + ReadContext: provider.ReadWithPooledClient(dataSourceRoutingLanguageRead), + Schema: map[string]*schema.Schema{ + "name": { + Description: "Language name.", + Type: schema.TypeString, + Required: true, + }, + }, + } +} + +func RoutingLanguageExporter() *resourceExporter.ResourceExporter { + return &resourceExporter.ResourceExporter{ + GetResourcesFunc: provider.GetAllWithPooledClient(getAllRoutingLanguages), + } +} + +func GenerateRoutingLanguageResource( + resourceID string, + name string) string { + return fmt.Sprintf(`resource "genesyscloud_routing_language" "%s" { + name = "%s" + } + `, resourceID, name) +} diff --git a/genesyscloud/resource_genesyscloud_routing_language_test.go b/genesyscloud/routing_language/resource_genesyscloud_routing_language_test.go similarity index 98% rename from genesyscloud/resource_genesyscloud_routing_language_test.go rename to genesyscloud/routing_language/resource_genesyscloud_routing_language_test.go index 5d0349c8a..b2dfbe573 100644 --- a/genesyscloud/resource_genesyscloud_routing_language_test.go +++ b/genesyscloud/routing_language/resource_genesyscloud_routing_language_test.go @@ -1,4 +1,4 @@ -package genesyscloud +package routing_language import ( "fmt" diff --git a/genesyscloud/task_management_workitem/genesyscloud_task_management_workitem_init_test.go b/genesyscloud/task_management_workitem/genesyscloud_task_management_workitem_init_test.go index d2b760c69..cad4d1e46 100644 --- a/genesyscloud/task_management_workitem/genesyscloud_task_management_workitem_init_test.go +++ b/genesyscloud/task_management_workitem/genesyscloud_task_management_workitem_init_test.go @@ -3,6 +3,7 @@ package task_management_workitem import ( "sync" authRole "terraform-provider-genesyscloud/genesyscloud/auth_role" + routingLanguage "terraform-provider-genesyscloud/genesyscloud/routing_language" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" "terraform-provider-genesyscloud/genesyscloud/user_roles" "testing" @@ -41,7 +42,7 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_task_management_workitem_schema"] = workitemSchema.ResourceTaskManagementWorkitemSchema() providerResources["genesyscloud_task_management_workbin"] = workbin.ResourceTaskManagementWorkbin() providerResources["genesyscloud_task_management_worktype"] = worktype.ResourceTaskManagementWorktype() - providerResources["genesyscloud_routing_language"] = gcloud.ResourceRoutingLanguage() + providerResources["genesyscloud_routing_language"] = routingLanguage.ResourceRoutingLanguage() providerResources["genesyscloud_user"] = gcloud.ResourceUser() providerResources["genesyscloud_externalcontacts_contact"] = externalContacts.ResourceExternalContact() providerResources["genesyscloud_routing_queue"] = routingQueue.ResourceRoutingQueue() diff --git a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_test.go b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_test.go index ae67f2425..697a3bcbf 100644 --- a/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_test.go +++ b/genesyscloud/task_management_workitem/resource_genesyscloud_task_management_workitem_test.go @@ -6,6 +6,7 @@ import ( "strings" authRole "terraform-provider-genesyscloud/genesyscloud/auth_role" "terraform-provider-genesyscloud/genesyscloud/provider" + routingLanguage "terraform-provider-genesyscloud/genesyscloud/routing_language" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" "terraform-provider-genesyscloud/genesyscloud/user_roles" "terraform-provider-genesyscloud/genesyscloud/util" @@ -194,7 +195,7 @@ func TestAccResourceTaskManagementWorkitem(t *testing.T) { { Config: taskMgmtConfig + gcloud.GenerateAuthDivisionHomeDataSource(homeDivRes) + - gcloud.GenerateRoutingLanguageResource(resLang, lang) + + routingLanguage.GenerateRoutingLanguageResource(resLang, lang) + routingQueue.GenerateRoutingQueueResourceBasic(resQueue, queueName) + gcloud.GenerateRoutingSkillResource(skillResId1, skillResName1) + gcloud.GenerateBasicUserResource(userResId1, userEmail1, userName1) + diff --git a/genesyscloud/task_management_worktype/genesyscloud_task_management_worktype_init_test.go b/genesyscloud/task_management_worktype/genesyscloud_task_management_worktype_init_test.go index 897b3b335..bdb8160ee 100644 --- a/genesyscloud/task_management_worktype/genesyscloud_task_management_worktype_init_test.go +++ b/genesyscloud/task_management_worktype/genesyscloud_task_management_worktype_init_test.go @@ -6,6 +6,7 @@ import ( "testing" gcloud "terraform-provider-genesyscloud/genesyscloud" + routingLanguage "terraform-provider-genesyscloud/genesyscloud/routing_language" workbin "terraform-provider-genesyscloud/genesyscloud/task_management_workbin" workitemSchema "terraform-provider-genesyscloud/genesyscloud/task_management_workitem_schema" @@ -36,7 +37,7 @@ func (r *registerTestInstance) registerTestResources() { providerResources[resourceName] = ResourceTaskManagementWorktype() providerResources["genesyscloud_task_management_workbin"] = workbin.ResourceTaskManagementWorkbin() providerResources["genesyscloud_task_management_workitem_schema"] = workitemSchema.ResourceTaskManagementWorkitemSchema() - providerResources["genesyscloud_routing_language"] = gcloud.ResourceRoutingLanguage() + providerResources["genesyscloud_routing_language"] = routingLanguage.ResourceRoutingLanguage() providerResources["genesyscloud_routing_queue"] = routingQueue.ResourceRoutingQueue() providerResources["genesyscloud_routing_skill"] = gcloud.ResourceRoutingSkill() } diff --git a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_test.go b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_test.go index 90bf04a63..12a109adb 100644 --- a/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_test.go +++ b/genesyscloud/task_management_worktype/resource_genesyscloud_task_management_worktype_test.go @@ -6,6 +6,7 @@ import ( "strconv" "strings" "terraform-provider-genesyscloud/genesyscloud/provider" + routingLanguage "terraform-provider-genesyscloud/genesyscloud/routing_language" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" "terraform-provider-genesyscloud/genesyscloud/util" "testing" @@ -109,7 +110,7 @@ func TestAccResourceTaskManagementWorktype(t *testing.T) { Config: workbin.GenerateWorkbinResource(wbResourceId, wbName, wbDescription, util.NullValue) + workitemSchema.GenerateWorkitemSchemaResourceBasic(wsResourceId, wsName, wsDescription) + routingQueue.GenerateRoutingQueueResourceBasic(queueResId, queueName) + - gcloud.GenerateRoutingLanguageResource(langResId, langName) + + routingLanguage.GenerateRoutingLanguageResource(langResId, langName) + gcloud.GenerateRoutingSkillResource(skillResId1, skillResName1) + gcloud.GenerateRoutingSkillResource(skillResId2, skillResName2) + generateWorktypeResource(wtRes) + diff --git a/genesyscloud/tfexporter/tf_exporter_resource_test.go b/genesyscloud/tfexporter/tf_exporter_resource_test.go index a64563797..cd42cfbfc 100644 --- a/genesyscloud/tfexporter/tf_exporter_resource_test.go +++ b/genesyscloud/tfexporter/tf_exporter_resource_test.go @@ -54,6 +54,7 @@ import ( responsemanagementResponse "terraform-provider-genesyscloud/genesyscloud/responsemanagement_response" respManagementRespAsset "terraform-provider-genesyscloud/genesyscloud/responsemanagement_responseasset" routingEmailRoute "terraform-provider-genesyscloud/genesyscloud/routing_email_route" + routinglanguage "terraform-provider-genesyscloud/genesyscloud/routing_language" routingEmailDomain "terraform-provider-genesyscloud/genesyscloud/routing_email_domain" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" routingQueueConditionalGroupRouting "terraform-provider-genesyscloud/genesyscloud/routing_queue_conditional_group_routing" @@ -76,7 +77,6 @@ import ( userRoles "terraform-provider-genesyscloud/genesyscloud/user_roles" webdeployConfig "terraform-provider-genesyscloud/genesyscloud/webdeployments_configuration" webdeployDeploy "terraform-provider-genesyscloud/genesyscloud/webdeployments_deployment" - "testing" edgePhone "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_phone" @@ -155,7 +155,7 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_responsemanagement_responseasset"] = respManagementRespAsset.ResourceResponseManagementResponseAsset() providerResources["genesyscloud_routing_email_domain"] = routingEmailDomain.ResourceRoutingEmailDomain() providerResources["genesyscloud_routing_email_route"] = routingEmailRoute.ResourceRoutingEmailRoute() - providerResources["genesyscloud_routing_language"] = gcloud.ResourceRoutingLanguage() + providerResources["genesyscloud_routing_language"] = routinglanguage.ResourceRoutingLanguage() providerResources["genesyscloud_routing_queue"] = routingQueue.ResourceRoutingQueue() providerResources["genesyscloud_routing_queue_conditional_group_routing"] = routingQueueConditionalGroupRouting.ResourceRoutingQueueConditionalGroupRouting() providerResources["genesyscloud_routing_queue_outbound_email_address"] = routingQueueOutboundEmailAddress.ResourceRoutingQueueOutboundEmailAddress() @@ -269,7 +269,7 @@ func (r *registerTestInstance) registerTestExporters() { RegisterExporter("genesyscloud_responsemanagement_responseasset", respManagementRespAsset.ExporterResponseManagementResponseAsset()) RegisterExporter("genesyscloud_routing_email_domain", routingEmailDomain.RoutingEmailDomainExporter()) RegisterExporter("genesyscloud_routing_email_route", routingEmailRoute.RoutingEmailRouteExporter()) - RegisterExporter("genesyscloud_routing_language", gcloud.RoutingLanguageExporter()) + RegisterExporter("genesyscloud_routing_language", routinglanguage.RoutingLanguageExporter()) RegisterExporter("genesyscloud_routing_queue", routingQueue.RoutingQueueExporter()) RegisterExporter("genesyscloud_routing_queue_conditional_group_routing", routingQueueConditionalGroupRouting.RoutingQueueConditionalGroupRoutingExporter()) RegisterExporter("genesyscloud_routing_queue_outbound_email_address", routingQueueOutboundEmailAddress.OutboundRoutingQueueOutboundEmailAddressExporter()) diff --git a/main.go b/main.go index 2f64f1afa..c5962bd8b 100644 --- a/main.go +++ b/main.go @@ -65,6 +65,7 @@ import ( responsemanagementResponseasset "terraform-provider-genesyscloud/genesyscloud/responsemanagement_responseasset" routingEmailDomain "terraform-provider-genesyscloud/genesyscloud/routing_email_domain" routingEmailRoute "terraform-provider-genesyscloud/genesyscloud/routing_email_route" + routingLanguage "terraform-provider-genesyscloud/genesyscloud/routing_language" routingQueue "terraform-provider-genesyscloud/genesyscloud/routing_queue" routingUtilization "terraform-provider-genesyscloud/genesyscloud/routing_utilization" routingUtilizationLabel "terraform-provider-genesyscloud/genesyscloud/routing_utilization_label" @@ -242,6 +243,7 @@ func registerResources() { routingUtilization.SetRegistrar(regInstance) //Registering routing utilization routingUtilizationLabel.SetRegistrar(regInstance) //Registering routing utilization label journeyViews.SetRegistrar(regInstance) //Registering journey views + routingLanguage.SetRegistrar(regInstance) //Registering Routing Language routingEmailDomain.SetRegistrar(regInstance) //Registering Routing Email Domain // setting resources for Use cases like TF export where provider is used in resource classes. tfexp.SetRegistrar(regInstance) //Registering tf exporter From ecf1054b7b0386e3e5f9a60ac8a3fb18bd3d6063 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 10:15:41 +0100 Subject: [PATCH 58/62] Bump github.com/nyaruka/phonenumbers from 1.3.6 to 1.4.0 (#1157) Bumps [github.com/nyaruka/phonenumbers](https://github.com/nyaruka/phonenumbers) from 1.3.6 to 1.4.0. - [Release notes](https://github.com/nyaruka/phonenumbers/releases) - [Changelog](https://github.com/nyaruka/phonenumbers/blob/main/CHANGELOG.md) - [Commits](https://github.com/nyaruka/phonenumbers/compare/v1.3.6...v1.4.0) --- updated-dependencies: - dependency-name: github.com/nyaruka/phonenumbers dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index debecdddd..fffddcf04 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/leekchan/timeutil v0.0.0-20150802142658-28917288c48d github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 github.com/mypurecloud/platform-client-sdk-go/v133 v133.0.0 - github.com/nyaruka/phonenumbers v1.3.6 + github.com/nyaruka/phonenumbers v1.4.0 github.com/rjNemo/underscore v0.6.1 github.com/zclconf/go-cty v1.14.4 gonum.org/v1/gonum v0.15.0 @@ -34,7 +34,7 @@ require ( github.com/yuin/goldmark v1.7.1 // indirect github.com/yuin/goldmark-meta v1.1.0 // indirect go.abhg.dev/goldmark/frontmatter v0.2.0 // indirect - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 // indirect + golang.org/x/exp v0.0.0-20240525044651-4c93da0ed11d // indirect golang.org/x/sync v0.7.0 // indirect golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect @@ -101,7 +101,7 @@ require ( golang.org/x/text v0.16.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/grpc v1.63.2 // indirect - google.golang.org/protobuf v1.34.0 // indirect + google.golang.org/protobuf v1.34.1 // indirect gopkg.in/ini.v1 v1.51.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index 7f2f226e0..fb5d68d5e 100644 --- a/go.sum +++ b/go.sum @@ -259,8 +259,8 @@ github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwd github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mypurecloud/platform-client-sdk-go/v133 v133.0.0 h1:QXLhk65lm4ObgEZLm49bJauEtigMLV/Xo61wF3t3eDE= github.com/mypurecloud/platform-client-sdk-go/v133 v133.0.0/go.mod h1:xzHvr5pv/axk+ieUu4gpvZEvMcqFTFcR53IzPxz55OU= -github.com/nyaruka/phonenumbers v1.3.6 h1:33owXWp4d1U+Tyaj9fpci6PbvaQZcXBUO2FybeKeLwQ= -github.com/nyaruka/phonenumbers v1.3.6/go.mod h1:Ut+eFwikULbmCenH6InMKL9csUNLyxHuBLyfkpum11s= +github.com/nyaruka/phonenumbers v1.4.0 h1:ddhWiHnHCIX3n6ETDA58Zq5dkxkjlvgrDWM2OHHPCzU= +github.com/nyaruka/phonenumbers v1.4.0/go.mod h1:gv+CtldaFz+G3vHHnasBSirAi3O2XLqZzVWz4V1pl2E= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= @@ -369,8 +369,8 @@ golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20240525044651-4c93da0ed11d h1:N0hmiNbwsSNwHBAvR3QB5w25pUwH4tK0Y/RltD1j1h4= +golang.org/x/exp v0.0.0-20240525044651-4c93da0ed11d/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -512,8 +512,8 @@ google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.34.0 h1:Qo/qEd2RZPCf2nKuorzksSknv0d3ERwp1vFG38gSmH4= -google.golang.org/protobuf v1.34.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= From ec5ee9ead3dcc9333ccf78da3c178d56167b18e3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 10:42:10 +0100 Subject: [PATCH 59/62] Bump github.com/zclconf/go-cty from 1.14.4 to 1.15.0 (#1158) Bumps [github.com/zclconf/go-cty](https://github.com/zclconf/go-cty) from 1.14.4 to 1.15.0. - [Release notes](https://github.com/zclconf/go-cty/releases) - [Changelog](https://github.com/zclconf/go-cty/blob/main/CHANGELOG.md) - [Commits](https://github.com/zclconf/go-cty/compare/v1.14.4...v1.15.0) --- updated-dependencies: - dependency-name: github.com/zclconf/go-cty dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index fffddcf04..0736603f0 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/mypurecloud/platform-client-sdk-go/v133 v133.0.0 github.com/nyaruka/phonenumbers v1.4.0 github.com/rjNemo/underscore v0.6.1 - github.com/zclconf/go-cty v1.14.4 + github.com/zclconf/go-cty v1.15.0 gonum.org/v1/gonum v0.15.0 ) diff --git a/go.sum b/go.sum index fb5d68d5e..933973a4e 100644 --- a/go.sum +++ b/go.sum @@ -344,8 +344,8 @@ github.com/yuin/goldmark v1.7.1 h1:3bajkSilaCbjdKVsKdZjZCLBNPL9pYzrCakKaf4U49U= github.com/yuin/goldmark v1.7.1/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= github.com/yuin/goldmark-meta v1.1.0 h1:pWw+JLHGZe8Rk0EGsMVssiNb/AaPMHfSRszZeUeiOUc= github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBvXi1lBb2VP0= -github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8= -github.com/zclconf/go-cty v1.14.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty v1.15.0 h1:tTCRWxsexYUmtt/wVxgDClUe+uQusuI443uL6e+5sXQ= +github.com/zclconf/go-cty v1.15.0/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6ZMSMNJFMOjqrGHynW3DIBuR2H9j0ug+Mo= go.abhg.dev/goldmark/frontmatter v0.2.0 h1:P8kPG0YkL12+aYk2yU3xHv4tcXzeVnN+gU0tJ5JnxRw= go.abhg.dev/goldmark/frontmatter v0.2.0/go.mod h1:XqrEkZuM57djk7zrlRUB02x8I5J0px76YjkOzhB4YlU= From 9f180b231505e8769ecc15bd1350def12cdd2c02 Mon Sep 17 00:00:00 2001 From: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Date: Wed, 17 Jul 2024 10:35:57 +0100 Subject: [PATCH 60/62] Fixed journey action maps (#1161) --- ...ger_with_outcome_probability_conditions.tf | 22 ++++++++++++++++-- .../04_update_remove_page_url_conditions.tf | 22 ++++++++++++++++-- .../05_update_remove_ignore_frequency_cap.tf | 22 ++++++++++++++++-- .../06_update_remove_end_date.tf | 23 ++++++++++++++++--- 4 files changed, 80 insertions(+), 9 deletions(-) diff --git a/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/03_update_remove_trigger_with_outcome_probability_conditions.tf b/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/03_update_remove_trigger_with_outcome_probability_conditions.tf index 5dfede2fc..48eb3f539 100644 --- a/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/03_update_remove_trigger_with_outcome_probability_conditions.tf +++ b/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/03_update_remove_trigger_with_outcome_probability_conditions.tf @@ -22,8 +22,6 @@ resource "genesyscloud_journey_action_map" "terraform_test_-TEST-CASE-" { } ignore_frequency_cap = true end_date = "2022-08-01T10:30:00.999000" - - depends_on = [genesyscloud_journey_segment.terraform_test_-TEST-CASE-_action_map_dependency] } resource "genesyscloud_journey_segment" "terraform_test_-TEST-CASE-_action_map_dependency" { @@ -45,3 +43,23 @@ resource "genesyscloud_journey_segment" "terraform_test_-TEST-CASE-_action_map_d } } } + +resource "genesyscloud_journey_outcome" "terraform_test_-TEST-CASE-_action_map_dependency" { + is_active = true + display_name = "terraform_test_-TEST-CASE-_action_map_dependency" + description = "test description of journey outcome" + is_positive = true + journey { + patterns { + criteria { + key = "page.title" + values = ["Title"] + operator = "notEqual" + should_ignore_case = true + } + count = 1 + stream_type = "Web" + session_type = "web" + } + } +} diff --git a/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/04_update_remove_page_url_conditions.tf b/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/04_update_remove_page_url_conditions.tf index a51657575..a681a255f 100644 --- a/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/04_update_remove_page_url_conditions.tf +++ b/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/04_update_remove_page_url_conditions.tf @@ -18,8 +18,6 @@ resource "genesyscloud_journey_action_map" "terraform_test_-TEST-CASE-" { # optional ignore_frequency_cap = true end_date = "2022-08-01T10:30:00.999000" - - depends_on = [genesyscloud_journey_segment.terraform_test_-TEST-CASE-_action_map_dependency] } resource "genesyscloud_journey_segment" "terraform_test_-TEST-CASE-_action_map_dependency" { @@ -41,3 +39,23 @@ resource "genesyscloud_journey_segment" "terraform_test_-TEST-CASE-_action_map_d } } } + +resource "genesyscloud_journey_outcome" "terraform_test_-TEST-CASE-_action_map_dependency" { + is_active = true + display_name = "terraform_test_-TEST-CASE-_action_map_dependency" + description = "test description of journey outcome" + is_positive = true + journey { + patterns { + criteria { + key = "page.title" + values = ["Title"] + operator = "notEqual" + should_ignore_case = true + } + count = 1 + stream_type = "Web" + session_type = "web" + } + } +} diff --git a/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/05_update_remove_ignore_frequency_cap.tf b/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/05_update_remove_ignore_frequency_cap.tf index a05ee3dfd..7527266fa 100644 --- a/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/05_update_remove_ignore_frequency_cap.tf +++ b/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/05_update_remove_ignore_frequency_cap.tf @@ -17,8 +17,6 @@ resource "genesyscloud_journey_action_map" "terraform_test_-TEST-CASE-" { } # optional end_date = "2022-08-01T10:30:00.999000" - - depends_on = [genesyscloud_journey_segment.terraform_test_-TEST-CASE-_action_map_dependency] } resource "genesyscloud_journey_segment" "terraform_test_-TEST-CASE-_action_map_dependency" { @@ -40,3 +38,23 @@ resource "genesyscloud_journey_segment" "terraform_test_-TEST-CASE-_action_map_d } } } + +resource "genesyscloud_journey_outcome" "terraform_test_-TEST-CASE-_action_map_dependency" { + is_active = true + display_name = "terraform_test_-TEST-CASE-_action_map_dependency" + description = "test description of journey outcome" + is_positive = true + journey { + patterns { + criteria { + key = "page.title" + values = ["Title"] + operator = "notEqual" + should_ignore_case = true + } + count = 1 + stream_type = "Web" + session_type = "web" + } + } +} diff --git a/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/06_update_remove_end_date.tf b/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/06_update_remove_end_date.tf index 2f674200d..c448a30c1 100644 --- a/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/06_update_remove_end_date.tf +++ b/test/data/resource/genesyscloud_journey_action_map/basic_optional_attributes/06_update_remove_end_date.tf @@ -15,9 +15,6 @@ resource "genesyscloud_journey_action_map" "terraform_test_-TEST-CASE-" { max_quantile_threshold = 0.666 fallback_quantile_threshold = 0.125 } - # optional - - depends_on = [genesyscloud_journey_segment.terraform_test_-TEST-CASE-_action_map_dependency] } resource "genesyscloud_journey_segment" "terraform_test_-TEST-CASE-_action_map_dependency" { @@ -39,3 +36,23 @@ resource "genesyscloud_journey_segment" "terraform_test_-TEST-CASE-_action_map_d } } } + +resource "genesyscloud_journey_outcome" "terraform_test_-TEST-CASE-_action_map_dependency" { + is_active = true + display_name = "terraform_test_-TEST-CASE-_action_map_dependency" + description = "test description of journey outcome" + is_positive = true + journey { + patterns { + criteria { + key = "page.title" + values = ["Title"] + operator = "notEqual" + should_ignore_case = true + } + count = 1 + stream_type = "Web" + session_type = "web" + } + } +} From d5b6e2e571fadb3006d67e2cf662f74e28b677fa Mon Sep 17 00:00:00 2001 From: Charlie Conneely <87772562+charliecon@users.noreply.github.com> Date: Wed, 17 Jul 2024 14:36:00 +0100 Subject: [PATCH 61/62] No jira: go checks (#1163) * Adding 'go mod tidy' & 'go vet' to workflow * Small change to go vet job in workflow --- .../workflows/{generate.yml => go-checks.yml} | 22 +++++++++++++++---- .../data_source_genesyscloud_architect_ivr.go | 1 + 2 files changed, 19 insertions(+), 4 deletions(-) rename .github/workflows/{generate.yml => go-checks.yml} (64%) diff --git a/.github/workflows/generate.yml b/.github/workflows/go-checks.yml similarity index 64% rename from .github/workflows/generate.yml rename to .github/workflows/go-checks.yml index a51777042..26d45ef2f 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/go-checks.yml @@ -1,12 +1,11 @@ -name: Ensure Documentation in Sync +name: Go Checks on: push: paths-ignore: - 'README.md' jobs: - # ensure the documentation is up to date - generate: - name: Generate + go-checks: + name: Go Checks runs-on: ubuntu-latest timeout-minutes: 5 steps: @@ -35,5 +34,20 @@ jobs: if [[ -n $(git status -s) ]]; then echo "There are untracked documentation changes:\n" git status + fi + + - name: Tidy + run: | + go mod tidy + if [[ -n $(git status -s) ]]; then + echo "go mod tidy produced changes:\n" + git status + fi + + - name: Vet + run: | + if [[ -n $(go vet ./genesyscloud/... 2>&1) ]]; then + echo "go vet highlighted the following:\n" + go vet ./genesyscloud/... exit 1 fi \ No newline at end of file diff --git a/genesyscloud/architect_ivr/data_source_genesyscloud_architect_ivr.go b/genesyscloud/architect_ivr/data_source_genesyscloud_architect_ivr.go index 01e69c1ef..f4371b944 100644 --- a/genesyscloud/architect_ivr/data_source_genesyscloud_architect_ivr.go +++ b/genesyscloud/architect_ivr/data_source_genesyscloud_architect_ivr.go @@ -18,6 +18,7 @@ func dataSourceIvrRead(ctx context.Context, d *schema.ResourceData, m interface{ sdkConfig := m.(*provider.ProviderMeta).ClientConfig ap := getArchitectIvrProxy(sdkConfig) name := d.Get("name").(string) + // Query ivr by name. Retry in case search has not yet indexed the ivr. return util.WithRetries(ctx, 15*time.Second, func() *retry.RetryError { id, retryable, resp, err := ap.getArchitectIvrIdByName(ctx, name) From 651e9b877a2cb71ee6aec120c303adee9f101941 Mon Sep 17 00:00:00 2001 From: monishapadmavathi <31921259+monishapadmavathi@users.noreply.github.com> Date: Wed, 17 Jul 2024 19:07:55 +0530 Subject: [PATCH 62/62] Fix failed acceptance testcases (#1162) * Modify order of testcase * fix division deletion * Fix testcases * Fix testcases * Fix outbound campaign * Fix ExternralTrunkBaseSettingsInboundSite testcase * Fix skipped testcases * Fix skipped testcases * Fix skipped testcases * Fix failing tests * Fix failing tests * Fix testcases * Fix testcases * Fixing test & report * fix testcases * fix testcases * fix testcases * fix tests * Fix testcase * Fix testcase * Fix tests * Fix tests * Fix tests * Fix tests * Fix tests * Fix tests * Fix tests * Fix tests * fix tests * fix tests * Resolve comments --------- Co-authored-by: Monisha Padmavathi Ragavan --- .../inboundcall_flow_example.yaml | 2 +- ...esyscloud_architect_emergencygroup_test.go | 5 + ..._source_genesyscloud_auth_division_test.go | 38 +- .../data_source_genesyscloud_user_test.go | 23 +- .../data_source_genesyscloud_group_test.go | 58 ++- .../group/resource_genesyscloud_group_test.go | 103 ++++- .../resource_genesyscloud_group_roles_test.go | 107 ++++++ .../resource_genesyscloud_integration_test.go | 91 ++++- ...enesyscloud_integration_credential_test.go | 6 + ...esyscloud_orgauthorization_pairing_test.go | 3 + ...yscloud_outbound_messagingcampaign_test.go | 21 +- ...yscloud_outbound_messagingcampaign_test.go | 21 +- ...rce_genesyscloud_outbound_campaign_test.go | 8 +- ...urce_genesyscloud_outbound_dnclist_test.go | 11 +- ...esource_genesyscloud_auth_division_test.go | 75 +++- ...e_genesyscloud_routing_skill_group_test.go | 89 +++-- .../resource_genesyscloud_user_test.go | 9 +- ...e_genesyscloud_routing_email_route_test.go | 4 +- ...esource_genesyscloud_routing_queue_test.go | 353 +++++++++++------ ...ng_queue_conditional_group_routing_test.go | 54 ++- ...genesyscloud_routing_sms_addresses_test.go | 26 +- ...genesyscloud_routing_sms_addresses_test.go | 36 +- ...syscloud_routing_utilization_label_test.go | 1 + ..._providers_edges_trunkbasesettings_test.go | 51 ++- ...lephony_providers_edges_edge_group_test.go | 1 - ...ud_telephony_providers_edges_phone_test.go | 236 ++++++------ ...lephony_providers_edges_trunk_init_test.go | 4 +- .../resource_genesyscloud_tf_export_test.go | 132 +++---- ...cloud_webdeployments_configuration_test.go | 2 +- ...syscloud_webdeployments_deployment_test.go | 2 +- jenkins/tests/Jenkinsfile | 358 +++++++++--------- 31 files changed, 1288 insertions(+), 642 deletions(-) diff --git a/examples/resources/genesyscloud_flow/inboundcall_flow_example.yaml b/examples/resources/genesyscloud_flow/inboundcall_flow_example.yaml index 47bbbf4ab..e1f261bad 100644 --- a/examples/resources/genesyscloud_flow/inboundcall_flow_example.yaml +++ b/examples/resources/genesyscloud_flow/inboundcall_flow_example.yaml @@ -1,5 +1,5 @@ inboundCall: - name: Terraform Test Flow log level f79fc952-6a58-4d00-996e-2c3873e1871a + name: Terraform Emergency Test Flow 7fa2e8a9-b1d9-4d78-93b8-05b4465314a7 defaultLanguage: en-us startUpRef: ./menus/menu[mainMenu] initialGreeting: diff --git a/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_test.go b/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_test.go index 7be483c9f..7c2b3ecb7 100644 --- a/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_test.go +++ b/genesyscloud/architect_emergencygroup/resource_genesyscloud_architect_emergencygroup_test.go @@ -2,6 +2,7 @@ package architect_emergencygroup import ( "fmt" + "os" "strconv" "strings" "terraform-provider-genesyscloud/genesyscloud/architect_flow" @@ -39,6 +40,10 @@ func TestAccResourceArchitectEmergencyGroups(t *testing.T) { // TODO: Create the IVR inside the test config once emergency group has been moved to its own package. // Currently, the ivr resource cannot be registered for these tests because of a cyclic dependency issue. ivrId := "f94e084e-40eb-470b-80d6-0f99cf22d102" + if v := os.Getenv("GENESYSCLOUD_REGION"); v == "tca" { + ivrId = "d37d14fe-1e6c-4ed6-a9bb-b6ef0dd8e9cd" + } + if !ivrExists(config, ivrId) { t.Skip("Skipping because IVR does not exists in the target org.") } diff --git a/genesyscloud/data_source_genesyscloud_auth_division_test.go b/genesyscloud/data_source_genesyscloud_auth_division_test.go index 2fbde2513..be4d3e75e 100644 --- a/genesyscloud/data_source_genesyscloud_auth_division_test.go +++ b/genesyscloud/data_source_genesyscloud_auth_division_test.go @@ -2,6 +2,7 @@ package genesyscloud import ( "fmt" + "log" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "testing" @@ -17,6 +18,7 @@ func TestAccDataSourceAuthDivision(t *testing.T) { divResource = "auth-division" divDataSource = "auth-div-data" divName = "Terraform Divisions-" + uuid.NewString() + divisionID string ) resource.Test(t, resource.TestCase{ @@ -27,6 +29,26 @@ func TestAccDataSourceAuthDivision(t *testing.T) { PreConfig: func() { time.Sleep(30 * time.Second) }, + Config: GenerateAuthDivisionResource( + divResource, + divName, + util.NullValue, + util.NullValue, + ), + Check: resource.ComposeTestCheckFunc( + func(s *terraform.State) error { + rs, ok := s.RootModule().Resources["genesyscloud_auth_division."+divResource] + if !ok { + return fmt.Errorf("not found: %s", "genesyscloud_auth_division."+divResource) + } + divisionID = rs.Primary.ID + log.Printf("Division ID: %s\n", divisionID) // Print ID + return nil + }, + ), + PreventPostDestroyRefresh: true, + }, + { Config: GenerateAuthDivisionResource( divResource, divName, @@ -39,14 +61,20 @@ func TestAccDataSourceAuthDivision(t *testing.T) { ), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair("data.genesyscloud_auth_division."+divDataSource, "id", "genesyscloud_auth_division."+divResource, "id"), - func(s *terraform.State) error { - time.Sleep(30 * time.Second) // Wait for 30 seconds for proper deletion - return nil - }, ), }, + { + // Import/Read + ResourceName: "genesyscloud_auth_division." + divResource, + ImportState: true, + ImportStateVerify: true, + Destroy: true, + }, + }, + CheckDestroy: func(state *terraform.State) error { + time.Sleep(45 * time.Second) + return testVerifyDivisionsDestroyed(state) }, - CheckDestroy: testVerifyDivisionsDestroyed, }) } diff --git a/genesyscloud/data_source_genesyscloud_user_test.go b/genesyscloud/data_source_genesyscloud_user_test.go index f5c639ac1..502d63edb 100644 --- a/genesyscloud/data_source_genesyscloud_user_test.go +++ b/genesyscloud/data_source_genesyscloud_user_test.go @@ -2,12 +2,15 @@ package genesyscloud import ( "fmt" + "log" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "testing" + "time" "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) func TestAccDataSourceUser(t *testing.T) { @@ -15,8 +18,9 @@ func TestAccDataSourceUser(t *testing.T) { userResource = "test-user" userDataSource = "test-user-data" randomString = uuid.NewString() - userEmail = "John_Doe" + randomString + "@example.com" + userEmail = "John_Doe" + randomString + "@exampleuser.com" userName = "John_Doe" + randomString + userID string ) resource.Test(t, resource.TestCase{ @@ -37,6 +41,15 @@ func TestAccDataSourceUser(t *testing.T) { ), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair("data.genesyscloud_user."+userDataSource, "id", "genesyscloud_user."+userResource, "id"), + func(s *terraform.State) error { + rs, ok := s.RootModule().Resources["genesyscloud_user."+userResource] + if !ok { + return fmt.Errorf("not found: %s", "genesyscloud_user."+userResource) + } + userID = rs.Primary.ID + log.Printf("User ID: %s\n", userID) // Print user ID + return nil + }, ), }, { @@ -53,9 +66,17 @@ func TestAccDataSourceUser(t *testing.T) { ), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair("data.genesyscloud_user."+userDataSource, "id", "genesyscloud_user."+userResource, "id"), + func(s *terraform.State) error { + time.Sleep(30 * time.Second) // Wait for 30 seconds for proper deletion + return nil + }, ), }, }, + CheckDestroy: func(state *terraform.State) error { + time.Sleep(45 * time.Second) + return testVerifyUsersDestroyed(state) + }, }) } diff --git a/genesyscloud/group/data_source_genesyscloud_group_test.go b/genesyscloud/group/data_source_genesyscloud_group_test.go index 548649fc7..24561d178 100644 --- a/genesyscloud/group/data_source_genesyscloud_group_test.go +++ b/genesyscloud/group/data_source_genesyscloud_group_test.go @@ -1,6 +1,7 @@ package group import ( + "context" "fmt" "log" "sync" @@ -13,12 +14,12 @@ import ( "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) var ( - sdkConfig *platformclientv2.Configuration - mu sync.Mutex + mu sync.Mutex ) func TestAccDataSourceGroup(t *testing.T) { @@ -37,6 +38,9 @@ func TestAccDataSourceGroup(t *testing.T) { ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), Steps: []resource.TestStep{ { + PreConfig: func() { + time.Sleep(30 * time.Second) + }, Config: generateUserWithCustomAttrs(testUserResource, testUserEmail, testUserName) + GenerateGroupResource( groupResource, @@ -62,16 +66,20 @@ func TestAccDataSourceGroup(t *testing.T) { return nil }, ), + + PreventPostDestroyRefresh: true, }, { ResourceName: "genesyscloud_user." + testUserResource, ImportState: true, ImportStateVerify: true, - Check: resource.ComposeTestCheckFunc( - checkUserDeleted(userID), - ), + Destroy: true, }, }, + CheckDestroy: func(state *terraform.State) error { + time.Sleep(45 * time.Second) + return testVerifyUsersDestroyed(state) + }, }) } @@ -89,9 +97,9 @@ func generateGroupDataSource( } func checkUserDeleted(id string) resource.TestCheckFunc { - log.Printf("Fetching user with ID: %s\n", id) return func(s *terraform.State) error { - maxAttempts := 18 + maxAttempts := 30 + fmt.Printf("Fetching user with ID: %s\n", id) for i := 0; i < maxAttempts; i++ { deleted, err := isUserDeleted(id) @@ -111,8 +119,9 @@ func isUserDeleted(id string) (bool, error) { mu.Lock() defer mu.Unlock() - usersAPI := platformclientv2.NewUsersApiWithConfig(sdkConfig) + usersAPI := platformclientv2.NewUsersApi() // Attempt to get the user + fmt.Printf("User ID: %s\n", id) _, response, err := usersAPI.GetUser(id, nil, "", "") // Check if the user is not found (deleted) @@ -129,3 +138,36 @@ func isUserDeleted(id string) (bool, error) { // If user is found, it means the user is not deleted return false, nil } + +func testVerifyUsersDestroyed(state *terraform.State) error { + usersAPI := platformclientv2.NewUsersApi() + + diagErr := util.WithRetries(context.Background(), 20*time.Second, func() *retry.RetryError { + for _, rs := range state.RootModule().Resources { + if rs.Type != "genesyscloud_user" { + continue + } + err := checkUserDeleted(rs.Primary.ID)(state) + if err != nil { + continue + } + _, resp, err := usersAPI.GetUser(rs.Primary.ID, nil, "", "") + + if err != nil { + if util.IsStatus404(resp) { + continue + } + return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_user", fmt.Sprintf("Unexpected error: %s", err), resp)) + } + return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_user", fmt.Sprintf("User (%s) still exists", rs.Primary.ID), resp)) + } + return nil + }) + + if diagErr != nil { + return fmt.Errorf(fmt.Sprintf("%v", diagErr)) + } + + // Success. All users destroyed + return nil +} diff --git a/genesyscloud/group/resource_genesyscloud_group_test.go b/genesyscloud/group/resource_genesyscloud_group_test.go index c889d8a4b..8503d22c3 100644 --- a/genesyscloud/group/resource_genesyscloud_group_test.go +++ b/genesyscloud/group/resource_genesyscloud_group_test.go @@ -28,6 +28,7 @@ func TestAccResourceGroupBasic(t *testing.T) { testUserResource = "user_resource1" testUserName = "nameUser1" + uuid.NewString() testUserEmail = uuid.NewString() + "@group.com" + userID string ) resource.Test(t, resource.TestCase{ @@ -76,19 +77,36 @@ func TestAccResourceGroupBasic(t *testing.T) { resource.TestCheckResourceAttr("genesyscloud_group."+groupResource1, "rules_visible", util.FalseValue), resource.TestCheckResourceAttr("genesyscloud_group."+groupResource1, "roles_enabled", util.TrueValue), func(s *terraform.State) error { - time.Sleep(30 * time.Second) // Wait for 30 seconds for resources to get deleted properly + rs, ok := s.RootModule().Resources["genesyscloud_user."+testUserResource] + if !ok { + return fmt.Errorf("not found: %s", "genesyscloud_user."+testUserResource) + } + userID = rs.Primary.ID + log.Printf("User ID: %s\n", userID) // Print user ID return nil }, ), + + PreventPostDestroyRefresh: true, }, { + Config: generateUserWithCustomAttrs(testUserResource, testUserEmail, testUserName) + GenerateGroupResource( + groupResource1, + groupName, + strconv.Quote(groupDesc2), + strconv.Quote(typeOfficial), // Cannot change type + strconv.Quote(visMembers), + util.FalseValue, + GenerateGroupOwners("genesyscloud_user."+testUserResource+".id"), + ), // Import/Read ResourceName: "genesyscloud_group." + groupResource1, ImportState: true, ImportStateVerify: true, + Destroy: true, }, }, - CheckDestroy: testVerifyGroupsDestroyed, + CheckDestroy: testVerifyGroupsAndUsersDestroyed, }) } @@ -105,6 +123,7 @@ func TestAccResourceGroupAddresses(t *testing.T) { testUserResource = "user_resource1" testUserName = "nameUser1" + uuid.NewString() testUserEmail = uuid.NewString() + "@groupadd.com" + userID string ) resource.Test(t, resource.TestCase{ @@ -163,6 +182,15 @@ func TestAccResourceGroupAddresses(t *testing.T) { resource.TestCheckResourceAttr("genesyscloud_group."+groupResource1, "name", groupName), resource.TestCheckResourceAttr("genesyscloud_group."+groupResource1, "addresses.0.type", typeGroupPhone), resource.TestCheckResourceAttr("genesyscloud_group."+groupResource1, "addresses.0.extension", addrPhoneExt), + func(s *terraform.State) error { + rs, ok := s.RootModule().Resources["genesyscloud_user."+testUserResource] + if !ok { + return fmt.Errorf("not found: %s", "genesyscloud_user."+testUserResource) + } + userID = rs.Primary.ID + log.Printf("User ID: %s\n", userID) // Print user ID + return nil + }, ), }, { @@ -178,24 +206,36 @@ func TestAccResourceGroupAddresses(t *testing.T) { GenerateGroupOwners("genesyscloud_user."+testUserResource+".id"), ), Check: resource.ComposeTestCheckFunc( - func(s *terraform.State) error { - time.Sleep(30 * time.Second) // Wait for 30 seconds for resources to get deleted properly - return nil - }, resource.TestCheckResourceAttr("genesyscloud_group."+groupResource1, "name", groupName), resource.TestCheckResourceAttr("genesyscloud_group."+groupResource1, "addresses.0.type", typeGroupPhone), resource.TestCheckResourceAttr("genesyscloud_group."+groupResource1, "addresses.0.extension", addrPhoneExt2), ), + + PreventPostDestroyRefresh: true, }, { + Config: generateUserWithCustomAttrs(testUserResource, testUserEmail, testUserName) + GenerateBasicGroupResource( + groupResource1, + groupName, + generateGroupAddress( + util.NullValue, + typeGroupPhone, + strconv.Quote(addrPhoneExt2), + ), + GenerateGroupOwners("genesyscloud_user."+testUserResource+".id"), + ), // Import/Read ResourceName: "genesyscloud_group." + groupResource1, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{"addresses"}, + Destroy: true, + Check: resource.ComposeTestCheckFunc( + checkUserDeleted(userID), + ), }, }, - CheckDestroy: testVerifyGroupsDestroyed, + CheckDestroy: testVerifyGroupsAndUsersDestroyed, }) } @@ -312,17 +352,19 @@ func TestAccResourceGroupMembers(t *testing.T) { return nil }, ), + PreventPostDestroyRefresh: true, }, { ResourceName: "genesyscloud_user." + testUserResource, ImportState: true, ImportStateVerify: true, - Check: resource.ComposeTestCheckFunc( - checkUserDeleted(userID), - ), + Destroy: true, }, }, - CheckDestroy: testVerifyGroupsDestroyed, + CheckDestroy: func(state *terraform.State) error { + time.Sleep(45 * time.Second) + return testVerifyGroupsAndUsersDestroyed(state) + }, }) } @@ -348,6 +390,45 @@ func testVerifyGroupsDestroyed(state *terraform.State) error { return nil } +func testVerifyGroupsAndUsersDestroyed(state *terraform.State) error { + groupsAPI := platformclientv2.NewGroupsApi() + usersAPI := platformclientv2.NewUsersApi() + for _, rs := range state.RootModule().Resources { + if rs.Type == "genesyscloud_group" { + group, resp, err := groupsAPI.GetGroup(rs.Primary.ID) + if group != nil { + return fmt.Errorf("Group (%s) still exists", rs.Primary.ID) + } else if util.IsStatus404(resp) { + // Group not found as expected + continue + } else { + // Unexpected error + return fmt.Errorf("Unexpected error: %s", err) + } + } + } + for _, rs := range state.RootModule().Resources { + if rs.Type == "genesyscloud_user" { + err := checkUserDeleted(rs.Primary.ID)(state) + if err != nil { + continue //Try one more time + } + user, resp, err := usersAPI.GetUser(rs.Primary.ID, nil, "", "") + if user != nil { + return fmt.Errorf("User Resource (%s) still exists", rs.Primary.ID) + } else if util.IsStatus404(resp) { + // User not found as expected + continue + } else { + // Unexpected error + return fmt.Errorf("Unexpected error: %s", err) + } + } + + } + return nil +} + func validateGroupMember(groupResourceName string, userResourceName string, attrName string) resource.TestCheckFunc { return func(state *terraform.State) error { groupResource, ok := state.RootModule().Resources[groupResourceName] diff --git a/genesyscloud/group_roles/resource_genesyscloud_group_roles_test.go b/genesyscloud/group_roles/resource_genesyscloud_group_roles_test.go index 308356348..dfbae37df 100644 --- a/genesyscloud/group_roles/resource_genesyscloud_group_roles_test.go +++ b/genesyscloud/group_roles/resource_genesyscloud_group_roles_test.go @@ -2,8 +2,10 @@ package group_roles import ( "fmt" + "log" "strconv" "strings" + "sync" "terraform-provider-genesyscloud/genesyscloud" "terraform-provider-genesyscloud/genesyscloud/group" "terraform-provider-genesyscloud/genesyscloud/provider" @@ -13,6 +15,7 @@ import ( "time" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" authRole "terraform-provider-genesyscloud/genesyscloud/auth_role" @@ -20,6 +23,10 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) +var ( + mu sync.Mutex +) + func TestAccResourceGroupRolesMembership(t *testing.T) { var ( groupRoleResource = "test-group-roles1" @@ -35,6 +42,7 @@ func TestAccResourceGroupRolesMembership(t *testing.T) { testUserResource = "user_resource1" testUserName = "nameUser1" + uuid.NewString() testUserEmail = uuid.NewString() + "@example.com" + userID string ) resource.Test(t, resource.TestCase{ @@ -58,6 +66,15 @@ func TestAccResourceGroupRolesMembership(t *testing.T) { ), Check: resource.ComposeTestCheckFunc( validateResourceRole("genesyscloud_group_roles."+groupRoleResource, "genesyscloud_auth_role."+roleResource1), + func(s *terraform.State) error { + rs, ok := s.RootModule().Resources["genesyscloud_user."+testUserResource] + if !ok { + return fmt.Errorf("not found: %s", "genesyscloud_user."+testUserResource) + } + userID = rs.Primary.ID + log.Printf("User ID: %s\n", userID) // Print user ID + return nil + }, ), }, { @@ -125,14 +142,25 @@ func TestAccResourceGroupRolesMembership(t *testing.T) { return nil }, ), + + PreventPostDestroyRefresh: true, }, { + Config: generateGroupRoles( + groupRoleResource, + groupResource1, + ), // Import/Read ResourceName: "genesyscloud_group_roles." + groupRoleResource, ImportState: true, ImportStateVerify: true, + Destroy: true, + Check: resource.ComposeTestCheckFunc( + checkUserDeleted(userID), + ), }, }, + CheckDestroy: testVerifyGroupsAndUsersDestroyed, }) } @@ -229,3 +257,82 @@ func generateUserWithCustomAttrs(resourceID string, email string, name string, a } `, resourceID, email, name, strings.Join(attrs, "\n")) } + +func checkUserDeleted(id string) resource.TestCheckFunc { + log.Printf("Fetching user with ID: %s\n", id) + return func(s *terraform.State) error { + maxAttempts := 30 + for i := 0; i < maxAttempts; i++ { + + deleted, err := isUserDeleted(id) + if err != nil { + return err + } + if deleted { + return nil + } + time.Sleep(10 * time.Second) + } + return fmt.Errorf("user %s was not deleted properly", id) + } +} + +func isUserDeleted(id string) (bool, error) { + mu.Lock() + defer mu.Unlock() + + usersAPI := platformclientv2.NewUsersApi() + // Attempt to get the user + _, response, err := usersAPI.GetUser(id, nil, "", "") + + // Check if the user is not found (deleted) + if response != nil && response.StatusCode == 404 { + return true, nil // User is deleted + } + + // Handle other errors + if err != nil { + log.Printf("Error fetching user: %v", err) + return false, err + } + + // If user is found, it means the user is not deleted + return false, nil +} + +func testVerifyGroupsAndUsersDestroyed(state *terraform.State) error { + groupsAPI := platformclientv2.NewGroupsApi() + usersAPI := platformclientv2.NewUsersApi() + for _, rs := range state.RootModule().Resources { + if rs.Type == "genesyscloud_group" { + group, resp, err := groupsAPI.GetGroup(rs.Primary.ID) + if group != nil { + return fmt.Errorf("Group (%s) still exists", rs.Primary.ID) + } else if util.IsStatus404(resp) { + // Group not found as expected + continue + } else { + // Unexpected error + return fmt.Errorf("Unexpected error: %s", err) + } + } + if rs.Type == "genesyscloud_user" { + err := checkUserDeleted(rs.Primary.ID)(state) + if err != nil { + continue + } + user, resp, err := usersAPI.GetUser(rs.Primary.ID, nil, "", "") + if user != nil { + return fmt.Errorf("User (%s) still exists", rs.Primary.ID) + } else if util.IsStatus404(resp) { + // User not found as expected + continue + } else { + // Unexpected error + return fmt.Errorf("Unexpected error: %s", err) + } + } + + } + return nil +} diff --git a/genesyscloud/integration/resource_genesyscloud_integration_test.go b/genesyscloud/integration/resource_genesyscloud_integration_test.go index 41a195fd3..0f607f033 100644 --- a/genesyscloud/integration/resource_genesyscloud_integration_test.go +++ b/genesyscloud/integration/resource_genesyscloud_integration_test.go @@ -2,8 +2,10 @@ package integration import ( "fmt" + "log" "strconv" "strings" + "sync" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "testing" @@ -17,6 +19,10 @@ import ( "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) +var ( + mu sync.Mutex +) + /* The resource_genesyscloud_integration_test.go contains all of the test cases for running the resource tests for integrations. @@ -333,7 +339,7 @@ func TestAccResourceIntegration(t *testing.T) { ImportStateVerify: true, }, }, - CheckDestroy: testVerifyIntegrationDestroyed, + CheckDestroy: testVerifyIntegrationAndUsersDestroyed, }) } @@ -375,22 +381,37 @@ func validateIntegrationProperties(integrationResourceName string, groupResource } } -func testVerifyIntegrationDestroyed(state *terraform.State) error { +func testVerifyIntegrationAndUsersDestroyed(state *terraform.State) error { integrationAPI := platformclientv2.NewIntegrationsApi() + usersAPI := platformclientv2.NewUsersApi() for _, rs := range state.RootModule().Resources { - if rs.Type != "genesyscloud_integration" { - continue + if rs.Type == "genesyscloud_integration" { + integration, resp, err := integrationAPI.GetIntegration(rs.Primary.ID, 100, 1, "", nil, "", "") + if integration != nil { + return fmt.Errorf("Integration (%s) still exists", rs.Primary.ID) + } else if util.IsStatus404(resp) { + // Integration not found as expected + continue + } else { + // Unexpected error + return fmt.Errorf("Unexpected error: %s", err) + } } - - integration, resp, err := integrationAPI.GetIntegration(rs.Primary.ID, 100, 1, "", nil, "", "") - if integration != nil { - return fmt.Errorf("Integration (%s) still exists", rs.Primary.ID) - } else if util.IsStatus404(resp) { - // Integration not found as expected - continue - } else { - // Unexpected error - return fmt.Errorf("Unexpected error: %s", err) + if rs.Type == "genesyscloud_user" { + err := checkUserDeleted(rs.Primary.ID)(state) + if err != nil { + continue + } + user, resp, err := usersAPI.GetUser(rs.Primary.ID, nil, "", "") + if user != nil { + return fmt.Errorf("User Resource (%s) still exists", rs.Primary.ID) + } else if util.IsStatus404(resp) { + // User not found as expected + continue + } else { + // Unexpected error + return fmt.Errorf("Unexpected error: %s", err) + } } } // Success. All integrations destroyed @@ -435,3 +456,45 @@ func generateGroupOwners(userIDs ...string) string { return fmt.Sprintf(`owner_ids = [%s] `, strings.Join(userIDs, ",")) } + +func checkUserDeleted(id string) resource.TestCheckFunc { + log.Printf("Fetching user with ID: %s\n", id) + return func(s *terraform.State) error { + maxAttempts := 30 + for i := 0; i < maxAttempts; i++ { + + deleted, err := isUserDeleted(id) + if err != nil { + return err + } + if deleted { + return nil + } + time.Sleep(10 * time.Second) + } + return fmt.Errorf("user %s was not deleted properly", id) + } +} + +func isUserDeleted(id string) (bool, error) { + mu.Lock() + defer mu.Unlock() + + usersAPI := platformclientv2.NewUsersApi() + // Attempt to get the user + _, response, err := usersAPI.GetUser(id, nil, "", "") + + // Check if the user is not found (deleted) + if response != nil && response.StatusCode == 404 { + return true, nil // User is deleted + } + + // Handle other errors + if err != nil { + log.Printf("Error fetching user: %v", err) + return false, err + } + + // If user is found, it means the user is not deleted + return false, nil +} diff --git a/genesyscloud/integration_credential/data_source_genesyscloud_integration_credential_test.go b/genesyscloud/integration_credential/data_source_genesyscloud_integration_credential_test.go index a96945459..f5cf01753 100644 --- a/genesyscloud/integration_credential/data_source_genesyscloud_integration_credential_test.go +++ b/genesyscloud/integration_credential/data_source_genesyscloud_integration_credential_test.go @@ -6,9 +6,11 @@ import ( "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "testing" + "time" "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) /* @@ -43,6 +45,10 @@ func TestAccDataSourceIntegrationCredential(t *testing.T) { credName1, "genesyscloud_integration_credential."+credResource1), Check: resource.ComposeTestCheckFunc( + func(s *terraform.State) error { + time.Sleep(30 * time.Second) // Wait for 30 seconds for proper creation + return nil + }, resource.TestCheckResourceAttrPair("data.genesyscloud_integration_credential."+credResource2, "id", "genesyscloud_integration_credential."+credResource1, "id"), // Default value would be "DISABLED" ), }, diff --git a/genesyscloud/orgauthorization_pairing/resource_genesyscloud_orgauthorization_pairing_test.go b/genesyscloud/orgauthorization_pairing/resource_genesyscloud_orgauthorization_pairing_test.go index 10117e498..65e0c948f 100644 --- a/genesyscloud/orgauthorization_pairing/resource_genesyscloud_orgauthorization_pairing_test.go +++ b/genesyscloud/orgauthorization_pairing/resource_genesyscloud_orgauthorization_pairing_test.go @@ -38,6 +38,9 @@ func TestAccResourceOrgAuthorizationPairing(t *testing.T) { Steps: []resource.TestStep{ // 1 user and 1 group { + PreConfig: func() { + time.Sleep(45 * time.Second) + }, Config: generateUserWithCustomAttrs(testUserResource, testUserEmail, testUserName) + genesyscloud.GenerateBasicUserResource( userResource1, email1, diff --git a/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign_test.go b/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign_test.go index 56192696e..e80e5f35f 100644 --- a/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign_test.go +++ b/genesyscloud/outbound/data_source_genesyscloud_outbound_messagingcampaign_test.go @@ -2,6 +2,7 @@ package outbound import ( "fmt" + "os" "strconv" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" @@ -86,21 +87,23 @@ func TestAccDataSourceOutboundMessagingCampaign(t *testing.T) { ) ) + if v := os.Getenv("GENESYSCLOUD_REGION"); v == "tca" { + smsConfigSenderSMSPhoneNumber = "+18159823725" + } + config, err := provider.AuthorizeSdk() if err != nil { t.Errorf("failed to authorize client: %v", err) } - api := platformclientv2.NewRoutingApiWithConfig(config) - err = createRoutingSmsPhoneNumber(smsConfigSenderSMSPhoneNumber, api) - if err != nil { - t.Errorf("error creating sms phone number %s: %v", smsConfigSenderSMSPhoneNumber, err) - } - defer func() { - _, err := api.DeleteRoutingSmsPhonenumber(smsConfigSenderSMSPhoneNumber) + + if v := os.Getenv("GENESYSCLOUD_REGION"); v == "us-east-1" { + api := platformclientv2.NewRoutingApiWithConfig(config) + err = createRoutingSmsPhoneNumber(smsConfigSenderSMSPhoneNumber, api) if err != nil { - t.Logf("error deleting phone number %s: %v", smsConfigSenderSMSPhoneNumber, err) + t.Errorf("error creating sms phone number %s: %v", smsConfigSenderSMSPhoneNumber, err) } - }() + //Do not delete the smsPhoneNumber + } resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) }, diff --git a/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign_test.go b/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign_test.go index 7f4e83de3..a43ed30e0 100644 --- a/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign_test.go +++ b/genesyscloud/outbound/resource_genesyscloud_outbound_messagingcampaign_test.go @@ -3,6 +3,7 @@ package outbound import ( "fmt" "net/http" + "os" "strconv" "strings" obDnclist "terraform-provider-genesyscloud/genesyscloud/outbound_dnclist" @@ -107,21 +108,23 @@ func TestAccResourceOutboundMessagingCampaign(t *testing.T) { ) ) + if v := os.Getenv("GENESYSCLOUD_REGION"); v == "tca" { + smsConfigSenderSMSPhoneNumber = "+18159823725" + } + config, err := provider.AuthorizeSdk() if err != nil { t.Errorf("failed to authorize client: %v", err) } - api := platformclientv2.NewRoutingApiWithConfig(config) - err = createRoutingSmsPhoneNumber(smsConfigSenderSMSPhoneNumber, api) - if err != nil { - t.Errorf("error creating sms phone number %s: %v", smsConfigSenderSMSPhoneNumber, err) - } - defer func() { - _, err := api.DeleteRoutingSmsPhonenumber(smsConfigSenderSMSPhoneNumber) + + if v := os.Getenv("GENESYSCLOUD_REGION"); v == "us-east-1" { + api := platformclientv2.NewRoutingApiWithConfig(config) + err = createRoutingSmsPhoneNumber(smsConfigSenderSMSPhoneNumber, api) if err != nil { - t.Logf("error deleting phone number %s: %v", smsConfigSenderSMSPhoneNumber, err) + t.Errorf("error creating sms phone number %s: %v", smsConfigSenderSMSPhoneNumber, err) } - }() + //Do not delete the smsPhoneNumber + } resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) }, diff --git a/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_test.go b/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_test.go index 55a7c5004..a420ba332 100644 --- a/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_test.go +++ b/genesyscloud/outbound_campaign/resource_genesyscloud_outbound_campaign_test.go @@ -605,11 +605,10 @@ func TestAccResourceOutboundCampaignCampaignStatus(t *testing.T) { } func TestAccResourceOutboundCampaignStatusOn(t *testing.T) { - t.Skip("Outbound Campaign is not switched off, destroy fails as campaign keeps running") t.Parallel() var ( resourceId = "campaign3" - name = "Test Campaign " + uuid.NewString() + name = "Test Campaign - " + uuid.NewString() contactListResourceId = "contact_list" carResourceId = "car" siteId = "site" @@ -679,9 +678,12 @@ func TestAccResourceOutboundCampaignStatusOn(t *testing.T) { resource.TestCheckResourceAttrPair("genesyscloud_outbound_campaign."+resourceId, "call_analysis_response_set_id", "genesyscloud_outbound_callanalysisresponseset."+carResourceId, "id"), util.VerifyAttributeInArrayOfPotentialValues("genesyscloud_outbound_campaign."+resourceId, "campaign_status", []string{"on", "complete"}), + func(s *terraform.State) error { + time.Sleep(300 * time.Second) // Takes approx. 300 seconds for campaign to be completed / stopped + return nil + }, ), }, - // Don't turn campaign back off to ensure campaign can be destroyed properly by turning it off within the destroy handler { // Import/Read ResourceName: "genesyscloud_outbound_campaign." + resourceId, diff --git a/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_test.go b/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_test.go index 5b24ce8af..f3c5eee6f 100644 --- a/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_test.go +++ b/genesyscloud/outbound_dnclist/resource_genesyscloud_outbound_dnclist_test.go @@ -231,7 +231,16 @@ func TestAccResourceOutboundDncListDncListType(t *testing.T) { func TestAccResourceOutboundDncListGryphonListType(t *testing.T) { t.Parallel() - gryphonLicense, present := os.LookupEnv("TEST_DNC_GRYPHON_LICENSE_KEY") + var gryphonLicense string + var present bool + + present = false + + if v := os.Getenv("GENESYSCLOUD_REGION"); v == "tca" { + gryphonLicense, present = os.LookupEnv("TEST_DNC_GRYPHON_LICENSE_KEY") + } else { + gryphonLicense, present = os.LookupEnv("TEST_DNC_GRYPHON_PROD_LICENSE_KEY") + } if !present { t.Skip("Skipping because TEST_DNC_GRYPHON_LICENSE_KEY env variable is not set.") } diff --git a/genesyscloud/resource_genesyscloud_auth_division_test.go b/genesyscloud/resource_genesyscloud_auth_division_test.go index fab7c0fb0..473092ef5 100644 --- a/genesyscloud/resource_genesyscloud_auth_division_test.go +++ b/genesyscloud/resource_genesyscloud_auth_division_test.go @@ -22,6 +22,7 @@ func TestAccResourceAuthDivisionBasic(t *testing.T) { divName1 = "Terraform Div-" + uuid.NewString() divName2 = "Terraform Div-" + uuid.NewString() divDesc1 = "Terraform test division" + divisionID string ) cleanupAuthDivision("Terraform") @@ -30,9 +31,6 @@ func TestAccResourceAuthDivisionBasic(t *testing.T) { ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), Steps: []resource.TestStep{ { - PreConfig: func() { - time.Sleep(30 * time.Second) - }, // Create Config: GenerateAuthDivisionResource( divResource1, @@ -43,6 +41,19 @@ func TestAccResourceAuthDivisionBasic(t *testing.T) { Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("genesyscloud_auth_division."+divResource1, "name", divName1), resource.TestCheckResourceAttr("genesyscloud_auth_division."+divResource1, "description", ""), + func(s *terraform.State) error { + time.Sleep(30 * time.Second) // Wait for 30 seconds for proper updation + return nil + }, + func(s *terraform.State) error { + rs, ok := s.RootModule().Resources["genesyscloud_auth_division."+divResource1] + if !ok { + return fmt.Errorf("not found: %s", "genesyscloud_auth_division."+divResource1) + } + divisionID = rs.Primary.ID + log.Printf("Division ID: %s\n", divisionID) // Print ID + return nil + }, ), }, { @@ -78,15 +89,13 @@ func TestAccResourceAuthDivisionBasic(t *testing.T) { ResourceName: "genesyscloud_auth_division." + divResource1, ImportState: true, ImportStateVerify: true, - Check: resource.ComposeTestCheckFunc( - func(s *terraform.State) error { - time.Sleep(30 * time.Second) // Wait for 30 seconds for proper deletion - return nil - }, - ), + Destroy: true, }, }, - CheckDestroy: testVerifyDivisionsDestroyed, + CheckDestroy: func(state *terraform.State) error { + time.Sleep(45 * time.Second) + return testVerifyDivisionsDestroyed(state) + }, }) } @@ -181,6 +190,11 @@ func testVerifyDivisionsDestroyed(state *terraform.State) error { // We do not delete home divisions continue } + err := checkDivisionDeleted(rs.Primary.ID)(state) + if err != nil { + return err + } + fmt.Printf("Check complete for division ID: %s\n", rs.Primary.ID) division, resp, err := authAPI.GetAuthorizationDivision(rs.Primary.ID, false) if division != nil { @@ -243,3 +257,44 @@ func cleanupAuthDivision(idPrefix string) { } } } + +func checkDivisionDeleted(id string) resource.TestCheckFunc { + return func(s *terraform.State) error { + log.Printf("Fetching division with ID: %s\n", id) + maxAttempts := 24 + for i := 0; i < maxAttempts; i++ { + deleted, err := isDivisionDeleted(id) + if err != nil { + return err + } + if deleted { + return nil + } + time.Sleep(10 * time.Second) + } + return fmt.Errorf("division %s was not deleted properly", id) + } +} + +func isDivisionDeleted(id string) (bool, error) { + mu.Lock() + defer mu.Unlock() + + authAPI := platformclientv2.NewAuthorizationApi() + // Attempt to get the division + _, response, err := authAPI.GetAuthorizationDivision(id, false) + + // Check if the division is not found (deleted) + if response != nil && response.StatusCode == 404 { + return true, nil // division is deleted + } + + // Handle other errors + if err != nil { + log.Printf("Error fetching user: %v", err) + return false, err + } + + // If division is found, it means the division is not deleted + return false, nil +} diff --git a/genesyscloud/resource_genesyscloud_routing_skill_group_test.go b/genesyscloud/resource_genesyscloud_routing_skill_group_test.go index 3fdf5e580..95b1bd51d 100644 --- a/genesyscloud/resource_genesyscloud_routing_skill_group_test.go +++ b/genesyscloud/resource_genesyscloud_routing_skill_group_test.go @@ -421,9 +421,6 @@ func TestAccResourceRoutingSkillGroupMemberDivisionsUsersAssigned(t *testing.T) "genesyscloud_auth_division." + division2ResourceId + ".id", "genesyscloud_auth_division." + division3ResourceId + ".id", } - userID1 string - userID2 string - userID3 string ) routingSkillResource := GenerateRoutingSkillResource(routingSkillResourceId, routingSkillName) @@ -504,7 +501,7 @@ resource "genesyscloud_routing_skill_group" "%s" { Steps: []resource.TestStep{ { PreConfig: func() { - time.Sleep(30 * time.Second) + time.Sleep(45 * time.Second) }, Config: skillGroupResource + routingSkillResource + @@ -516,25 +513,6 @@ resource "genesyscloud_routing_skill_group" "%s" { user3Resource, Check: resource.ComposeTestCheckFunc( testVerifySkillGroupMemberCount("genesyscloud_routing_skill_group."+skillGroupResourceId, "3"), - func(s *terraform.State) error { - rs, ok := s.RootModule().Resources["genesyscloud_user."+user1ResourceId] - if !ok { - return fmt.Errorf("not found: %s", "genesyscloud_user."+user1ResourceId) - } - userID1 = rs.Primary.ID - log.Printf("User ID: %s\n", userID1) // Print user ID - rs, ok = s.RootModule().Resources["genesyscloud_user."+user2ResourceId] - if !ok { - return fmt.Errorf("not found: %s", "genesyscloud_user."+user2ResourceId) - } - userID2 = rs.Primary.ID - rs, ok = s.RootModule().Resources["genesyscloud_user."+user3ResourceId] - if !ok { - return fmt.Errorf("not found: %s", "genesyscloud_user."+user3ResourceId) - } - userID3 = rs.Primary.ID - return nil - }, ), }, { @@ -542,11 +520,7 @@ resource "genesyscloud_routing_skill_group" "%s" { ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{"member_division_ids"}, - Check: resource.ComposeTestCheckFunc( - checkUserDeleted(userID1), - checkUserDeleted(userID2), - checkUserDeleted(userID3), - ), + Destroy: true, }, }, CheckDestroy: testVerifySkillGroupDestroyed, @@ -726,11 +700,8 @@ func testVerifyAllDivisionsAssigned(resourceName string, attrName string) resour func testVerifySkillGroupDestroyed(state *terraform.State) error { // Get default config to set config options - config, err := provider.AuthorizeSdk() - if err != nil { - return fmt.Errorf("unexpected error while trying to authorize client in testVerifySkillGroupDestroyed : %s", err) - } - routingAPI := platformclientv2.NewRoutingApiWithConfig(config) + + routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) apiClient := &routingAPI.Configuration.APIClient // TODO Once this code has been released into the public API we should fix this and use the SDK @@ -764,7 +735,55 @@ func testVerifySkillGroupDestroyed(state *terraform.State) error { // Success. All skills destroyed return nil } +func testVerifySkillGroupAndUsersDestroyed(state *terraform.State) error { + + routingAPI := platformclientv2.NewRoutingApiWithConfig(sdkConfig) + apiClient := &routingAPI.Configuration.APIClient + usersAPI := platformclientv2.NewUsersApiWithConfig(sdkConfig) + // TODO Once this code has been released into the public API we should fix this and use the SDK + + headerParams := BuildHeaderParams(routingAPI) + for _, rs := range state.RootModule().Resources { + if rs.Type == "genesyscloud_routing_skill_group" { + path := routingAPI.Configuration.BasePath + "/api/v2/routing/skillgroups/" + rs.Primary.ID + response, err := apiClient.CallAPI(path, "GET", nil, headerParams, nil, nil, "", nil) + + skillGroupPayload := make(map[string]interface{}) + + if err != nil { + if util.IsStatus404(response) { + break + } + return fmt.Errorf("Unexpected error while trying to read skillgroup: %s", err) + } + + json.Unmarshal(response.RawBody, &skillGroupPayload) + + if skillGroupPayload["id"] != nil && skillGroupPayload["id"] != "" { + return fmt.Errorf("Skill Group (%s) still exists", rs.Primary.ID) + } + } + if rs.Type == "genesyscloud_user" { + err := checkUserDeleted(rs.Primary.ID)(state) + if err != nil { + continue + } + user, resp, err := usersAPI.GetUser(rs.Primary.ID, nil, "", "") + if user != nil { + return fmt.Errorf("User Resource (%s) still exists", rs.Primary.ID) + } else if util.IsStatus404(resp) { + // User not found as expected + continue + } else { + // Unexpected error + return fmt.Errorf("Unexpected error: %s", err) + } + } + } + // Success. All skills destroyed + return nil +} func getAllSkillGroupMemberDivisionIds(routingAPI *platformclientv2.RoutingApi, resourceId string) ([]string, diag.Diagnostics) { headers := BuildHeaderParams(routingAPI) apiClient := &routingAPI.Configuration.APIClient @@ -794,7 +813,7 @@ func getAllSkillGroupMemberDivisionIds(routingAPI *platformclientv2.RoutingApi, func checkUserDeleted(id string) resource.TestCheckFunc { log.Printf("Fetching user with ID: %s\n", id) return func(s *terraform.State) error { - maxAttempts := 18 + maxAttempts := 30 for i := 0; i < maxAttempts; i++ { deleted, err := isUserDeleted(id) @@ -814,7 +833,7 @@ func isUserDeleted(id string) (bool, error) { mu.Lock() defer mu.Unlock() - usersAPI := platformclientv2.NewUsersApiWithConfig(sdkConfig) + usersAPI := platformclientv2.NewUsersApi() // Attempt to get the user _, response, err := usersAPI.GetUser(id, nil, "", "") diff --git a/genesyscloud/resource_genesyscloud_user_test.go b/genesyscloud/resource_genesyscloud_user_test.go index 825230c02..5c0377afb 100644 --- a/genesyscloud/resource_genesyscloud_user_test.go +++ b/genesyscloud/resource_genesyscloud_user_test.go @@ -455,6 +455,10 @@ func TestAccResourceUserSkills(t *testing.T) { ), Check: resource.ComposeTestCheckFunc( resource.TestCheckNoResourceAttr("genesyscloud_user."+userResource1, "skills.%"), + func(s *terraform.State) error { + time.Sleep(30 * time.Second) // Wait for 30 seconds for proper updation + return nil + }, ), }, }, @@ -1124,6 +1128,10 @@ func testVerifyUsersDestroyed(state *terraform.State) error { if rs.Type != "genesyscloud_user" { continue } + err := checkUserDeleted(rs.Primary.ID)(state) + if err != nil { + continue + } _, resp, err := usersAPI.GetUser(rs.Primary.ID, nil, "", "") if err != nil { @@ -1132,7 +1140,6 @@ func testVerifyUsersDestroyed(state *terraform.State) error { } return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_user", fmt.Sprintf("Unexpected error: %s", err), resp)) } - return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError("genesyscloud_user", fmt.Sprintf("User (%s) still exists", rs.Primary.ID), resp)) } return nil diff --git a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go index 075eb78e3..e8ebb5b46 100644 --- a/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go +++ b/genesyscloud/routing_email_route/resource_genesyscloud_routing_email_route_test.go @@ -157,8 +157,8 @@ func TestAccResourceRoutingEmailRoute(t *testing.T) { }, CheckDestroy: testVerifyRoutingEmailRouteDestroyed, }) - - domainId = fmt.Sprintf("terraformroute.%s.com", strings.Replace(uuid.NewString(), "-", "", -1)) + CleanupRoutingEmailDomains() + domainId = fmt.Sprintf("terraformroutes.%s.com", strings.Replace(uuid.NewString(), "-", "", -1)) // Standard acceptance tests resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) }, diff --git a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go index c1a359274..0d86f40fd 100644 --- a/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go +++ b/genesyscloud/routing_queue/resource_genesyscloud_routing_queue_test.go @@ -24,8 +24,7 @@ import ( ) var ( - sdkConfig *platformclientv2.Configuration - mu sync.Mutex + mu sync.Mutex ) func TestAccResourceRoutingQueueBasic(t *testing.T) { @@ -60,6 +59,7 @@ func TestAccResourceRoutingQueueBasic(t *testing.T) { testUserEmail = uuid.NewString() + "@examplestest.com" callbackHours = "7" callbackHours2 = "7" + userID string ) resource.Test(t, resource.TestCase{ @@ -119,6 +119,15 @@ func TestAccResourceRoutingQueueBasic(t *testing.T) { validateBullseyeSettings(queueResource1, 1, alertTimeout1, "genesyscloud_routing_skill."+queueSkillResource), validateRoutingRules(queueResource1, 0, routingRuleOpAny, "50", "5"), validateAgentOwnedRouting(queueResource1, "agent_owned_routing", util.TrueValue, callbackHours, callbackHours), + func(s *terraform.State) error { + rs, ok := s.RootModule().Resources["genesyscloud_user."+testUserResource] + if !ok { + return fmt.Errorf("not found: %s", "genesyscloud_user."+testUserResource) + } + userID = rs.Primary.ID + log.Printf("User ID: %s\n", userID) // Print user ID + return nil + }, ), }, { @@ -182,9 +191,12 @@ func TestAccResourceRoutingQueueBasic(t *testing.T) { ResourceName: "genesyscloud_routing_queue." + queueResource1, ImportState: true, ImportStateVerify: true, + Check: resource.ComposeTestCheckFunc( + checkUserDeleted(userID), + ), }, }, - CheckDestroy: testVerifyQueuesDestroyed, + CheckDestroy: testVerifyQueuesAndUsersDestroyed, }) } @@ -225,6 +237,7 @@ func TestAccResourceRoutingQueueConditionalRouting(t *testing.T) { testUserResource = "user_resource1" testUserName = "nameUser1" + uuid.NewString() testUserEmail = uuid.NewString() + "@example.com" + userID string ) resource.Test(t, resource.TestCase{ @@ -413,19 +426,74 @@ func TestAccResourceRoutingQueueConditionalRouting(t *testing.T) { validateMediaSettings(queueResource1, "media_settings_email", alertTimeout1, util.FalseValue, slPercent1, slDuration1), validateMediaSettings(queueResource1, "media_settings_message", alertTimeout1, util.FalseValue, slPercent1, slDuration1), func(s *terraform.State) error { - time.Sleep(60 * time.Second) // Wait for 60 seconds for resource to get deleted properly + rs, ok := s.RootModule().Resources["genesyscloud_user."+testUserResource] + if !ok { + return fmt.Errorf("not found: %s", "genesyscloud_user."+testUserResource) + } + userID = rs.Primary.ID + log.Printf("User ID: %s\n", userID) // Print user ID return nil }, ), + + PreventPostDestroyRefresh: true, }, { + Config: GenerateRoutingQueueResource( + queueResource1, + queueName1, + queueDesc1, + util.NullValue, // MANDATORY_TIMEOUT + "200000", // acw_timeout + util.NullValue, // ALL + util.NullValue, // auto_answer_only true + util.NullValue, // No calling party name + util.NullValue, // No calling party number + util.NullValue, // enable_transcription false + util.FalseValue, // suppress_in_queue_call_recording false + util.NullValue, // enable_manual_assignment false + strconv.Quote("TimestampAndPriority"), + GenerateMediaSettings("media_settings_call", alertTimeout1, util.FalseValue, slPercent1, slDuration1), + GenerateMediaSettings("media_settings_callback", alertTimeout1, util.FalseValue, slPercent1, slDuration1), + GenerateMediaSettings("media_settings_chat", alertTimeout1, util.FalseValue, slPercent1, slDuration1), + GenerateMediaSettings("media_settings_email", alertTimeout1, util.FalseValue, slPercent1, slDuration1), + GenerateMediaSettings("media_settings_message", alertTimeout1, util.FalseValue, slPercent1, slDuration1), + GenerateConditionalGroupRoutingRules( + util.NullValue, // queue_id (queue_id in the first rule should be omitted) + conditionalGroupRouting1Operator, // operator + conditionalGroupRouting1Metric, // metric + conditionalGroupRouting1ConditionValue, // condition_value + conditionalGroupRouting1WaitSeconds, // wait_seconds + GenerateConditionalGroupRoutingRuleGroup( + "genesyscloud_routing_skill_group."+skillGroupResourceId+".id", // group_id + conditionalGroupRouting1GroupType, // group_type + ), + ), + GenerateConditionalGroupRoutingRules( + "genesyscloud_routing_queue."+queueResource2+".id", // queue_id + conditionalGroupRouting2Operator, // operator + conditionalGroupRouting2Metric, // metric + conditionalGroupRouting2ConditionValue, // condition_value + conditionalGroupRouting2WaitSeconds, // wait_seconds + GenerateConditionalGroupRoutingRuleGroup( + "genesyscloud_group."+groupResourceId+".id", // group_id + conditionalGroupRouting2GroupType, // group_type + ), + ), + "skill_groups = [genesyscloud_routing_skill_group."+skillGroupResourceId+".id]", + "groups = [genesyscloud_group."+groupResourceId+".id]", + ), // Import/Read ResourceName: "genesyscloud_routing_queue." + queueResource1, ImportState: true, ImportStateVerify: true, + Destroy: true, }, }, - CheckDestroy: testVerifyQueuesDestroyed, + CheckDestroy: func(state *terraform.State) error { + time.Sleep(45 * time.Second) + return testVerifyQueuesAndUsersDestroyed(state) + }, }) } @@ -692,117 +760,6 @@ func TestAccResourceRoutingQueueFlows(t *testing.T) { }) } -func TestAccResourceRoutingQueueMembers(t *testing.T) { - var ( - queueResource = "test-queue-members" - queueName = "Terraform Test Queue3-" + uuid.NewString() - queueMemberResource1 = "test-queue-user1" - queueMemberResource2 = "test-queue-user2" - queueMemberEmail1 = "terraform1-" + uuid.NewString() + "@queue.com" - queueMemberEmail2 = "terraform2-" + uuid.NewString() + "@queue.com" - queueMemberName1 = "Henry Terraform Test" - queueMemberName2 = "Amanda Terraform Test" - defaultQueueRingNum = "1" - queueRingNum = "3" - ) - resource.Test(t, resource.TestCase{ - PreCheck: func() { util.TestAccPreCheck(t) }, - ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), - Steps: []resource.TestStep{ - { - PreConfig: func() { - // Wait for a specified duration to avoid runtime error - time.Sleep(30 * time.Second) - }, - // Create - Config: genesyscloud.GenerateBasicUserResource( - queueMemberResource1, - queueMemberEmail1, - queueMemberName1, - ) + GenerateRoutingQueueResourceBasic( - queueResource, - queueName, - GenerateMemberBlock("genesyscloud_user."+queueMemberResource1+".id", util.NullValue), - ), - Check: resource.ComposeTestCheckFunc( - validateMember("genesyscloud_routing_queue."+queueResource, "genesyscloud_user."+queueMemberResource1, defaultQueueRingNum), - ), - }, - { - PreConfig: func() { - // Wait for a specified duration to avoid runtime error - time.Sleep(30 * time.Second) - }, - // Update with another queue member and modify rings - Config: genesyscloud.GenerateBasicUserResource( - queueMemberResource1, - queueMemberEmail1, - queueMemberName1, - ) + genesyscloud.GenerateBasicUserResource( - queueMemberResource2, - queueMemberEmail2, - queueMemberName2, - ) + GenerateRoutingQueueResourceBasic( - queueResource, - queueName, - GenerateMemberBlock("genesyscloud_user."+queueMemberResource1+".id", queueRingNum), - GenerateMemberBlock("genesyscloud_user."+queueMemberResource2+".id", queueRingNum), - GenerateBullseyeSettings("10"), - GenerateBullseyeSettings("10"), - GenerateBullseyeSettings("10"), - ), - Check: resource.ComposeTestCheckFunc( - validateMember("genesyscloud_routing_queue."+queueResource, "genesyscloud_user."+queueMemberResource1, queueRingNum), - validateMember("genesyscloud_routing_queue."+queueResource, "genesyscloud_user."+queueMemberResource2, queueRingNum), - ), - }, - { - // Remove a queue member - Config: GenerateRoutingQueueResourceBasic( - queueResource, - queueName, - GenerateMemberBlock("genesyscloud_user."+queueMemberResource2+".id", queueRingNum), - GenerateBullseyeSettings("10"), - GenerateBullseyeSettings("10"), - GenerateBullseyeSettings("10"), - ) + genesyscloud.GenerateBasicUserResource( - queueMemberResource1, - queueMemberEmail1, - queueMemberName1, - ) + genesyscloud.GenerateBasicUserResource( - queueMemberResource2, - queueMemberEmail2, - queueMemberName2, - ), - Check: resource.ComposeTestCheckFunc( - validateMember("genesyscloud_routing_queue."+queueResource, "genesyscloud_user."+queueMemberResource2, queueRingNum), - ), - }, - { - // Remove all queue members - Config: GenerateRoutingQueueResourceBasic( - queueResource, - queueName, - "members = []", - GenerateBullseyeSettings("10"), - GenerateBullseyeSettings("10"), - GenerateBullseyeSettings("10"), - ), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckNoResourceAttr("genesyscloud_routing_queue."+queueResource, "members.%"), - ), - }, - { - // Import/Read - ResourceName: "genesyscloud_routing_queue." + queueResource, - ImportState: true, - ImportStateVerify: true, - }, - }, - CheckDestroy: testVerifyQueuesDestroyed, - }) -} - func TestAccResourceRoutingQueueSkillgroupMembers(t *testing.T) { var ( queueResourceId = "test-queue" @@ -901,6 +858,114 @@ func TestAccResourceRoutingQueueSkillgroupMembers(t *testing.T) { }) } +func TestAccResourceRoutingQueueMembers(t *testing.T) { + var ( + queueResource = "test-queue-members" + queueName = "Terraform Test Queue3-" + uuid.NewString() + queueMemberResource1 = "test-queue-user1" + queueMemberResource2 = "test-queue-user2" + queueMemberEmail1 = "terraform1-" + uuid.NewString() + "@queue1.com" + queueMemberEmail2 = "terraform2-" + uuid.NewString() + "@queue2.com" + queueMemberName1 = "Henry Terraform Test" + queueMemberName2 = "Amanda Terraform Test" + defaultQueueRingNum = "1" + queueRingNum = "3" + ) + resource.Test(t, resource.TestCase{ + PreCheck: func() { util.TestAccPreCheck(t) }, + ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), + Steps: []resource.TestStep{ + { + // Create + Config: genesyscloud.GenerateBasicUserResource( + queueMemberResource1, + queueMemberEmail1, + queueMemberName1, + ) + genesyscloud.GenerateBasicUserResource( + queueMemberResource2, + queueMemberEmail2, + queueMemberName2, + ) + GenerateRoutingQueueResourceBasic( + queueResource, + queueName, + GenerateMemberBlock("genesyscloud_user."+queueMemberResource1+".id", util.NullValue), + ), + Check: resource.ComposeTestCheckFunc( + validateMember("genesyscloud_routing_queue."+queueResource, "genesyscloud_user."+queueMemberResource1, defaultQueueRingNum), + ), + }, + { + PreConfig: func() { + // Wait for a specified duration to avoid runtime error + time.Sleep(30 * time.Second) + }, + // Update with another queue member and modify rings + Config: genesyscloud.GenerateBasicUserResource( + queueMemberResource1, + queueMemberEmail1, + queueMemberName1, + ) + genesyscloud.GenerateBasicUserResource( + queueMemberResource2, + queueMemberEmail2, + queueMemberName2, + ) + GenerateRoutingQueueResourceBasic( + queueResource, + queueName, + GenerateMemberBlock("genesyscloud_user."+queueMemberResource1+".id", queueRingNum), + GenerateMemberBlock("genesyscloud_user."+queueMemberResource2+".id", queueRingNum), + GenerateBullseyeSettings("10"), + GenerateBullseyeSettings("10"), + GenerateBullseyeSettings("10"), + ), + Check: resource.ComposeTestCheckFunc( + validateMember("genesyscloud_routing_queue."+queueResource, "genesyscloud_user."+queueMemberResource1, queueRingNum), + validateMember("genesyscloud_routing_queue."+queueResource, "genesyscloud_user."+queueMemberResource2, queueRingNum), + ), + }, + { + // Remove a queue member + Config: genesyscloud.GenerateBasicUserResource( + queueMemberResource2, + queueMemberEmail2, + queueMemberName2, + ) + GenerateRoutingQueueResourceBasic( + queueResource, + queueName, + GenerateMemberBlock("genesyscloud_user."+queueMemberResource2+".id", queueRingNum), + GenerateBullseyeSettings("10"), + GenerateBullseyeSettings("10"), + GenerateBullseyeSettings("10"), + ), + Check: resource.ComposeTestCheckFunc( + validateMember("genesyscloud_routing_queue."+queueResource, "genesyscloud_user."+queueMemberResource2, queueRingNum), + ), + Destroy: true, + }, + { + // Remove all queue members + Config: GenerateRoutingQueueResourceBasic( + queueResource, + queueName, + "members = []", + GenerateBullseyeSettings("10"), + GenerateBullseyeSettings("10"), + GenerateBullseyeSettings("10"), + ), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckNoResourceAttr("genesyscloud_routing_queue."+queueResource, "members.%"), + ), + }, + { + // Import/Read + ResourceName: "genesyscloud_routing_queue." + queueResource, + ImportState: true, + ImportStateVerify: true, + Destroy: true, + }, + }, + CheckDestroy: testVerifyQueuesAndUsersDestroyed, + }) +} func TestAccResourceRoutingQueueWrapupCodes(t *testing.T) { var ( queueResource = "test-queue-wrapup" @@ -1258,6 +1323,43 @@ func testVerifyQueuesDestroyed(state *terraform.State) error { return nil } +func testVerifyQueuesAndUsersDestroyed(state *terraform.State) error { + routingAPI := platformclientv2.NewRoutingApi() + usersAPI := platformclientv2.NewUsersApi() + for _, rs := range state.RootModule().Resources { + if rs.Type == "genesyscloud_routing_queue" { + queue, resp, err := routingAPI.GetRoutingQueue(rs.Primary.ID) + if queue != nil { + return fmt.Errorf("Queue (%s) still exists", rs.Primary.ID) + } else if util.IsStatus404(resp) { + // Queue not found as expected + continue + } else { + // Unexpected error + return fmt.Errorf("Unexpected error: %s", err) + } + } + if rs.Type == "genesyscloud_user" { + err := checkUserDeleted(rs.Primary.ID)(state) + if err != nil { + continue + } + user, resp, err := usersAPI.GetUser(rs.Primary.ID, nil, "", "") + if user != nil { + return fmt.Errorf("User Resource (%s) still exists", rs.Primary.ID) + } else if util.IsStatus404(resp) { + // User not found as expected + continue + } else { + // Unexpected error + return fmt.Errorf("Unexpected error: %s", err) + } + } + } + // Success. All queues destroyed + return nil +} + func validateMediaSettings(resourceName, settingsAttr, alertingTimeout, enableAutoAnswer, slPercent, slDurationMs string) resource.TestCheckFunc { return resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr("genesyscloud_routing_queue."+resourceName, settingsAttr+".0.alerting_timeout_sec", alertingTimeout), @@ -1515,6 +1617,8 @@ func TestAccResourceRoutingQueueSkillGroups(t *testing.T) { Check: resource.ComposeTestCheckFunc( validateGroups("genesyscloud_routing_queue."+queueResource, "genesyscloud_routing_skill_group."+skillGroupResource, "genesyscloud_group."+groupResource), ), + + PreventPostDestroyRefresh: true, }, { // Import/Read @@ -1524,15 +1628,13 @@ func TestAccResourceRoutingQueueSkillGroups(t *testing.T) { ImportStateVerifyIgnore: []string{ "suppress_in_queue_call_recording", }, - Check: resource.ComposeTestCheckFunc( - func(s *terraform.State) error { - time.Sleep(45 * time.Second) // Wait for 45 seconds for resource to get deleted properly - return nil - }, - ), + Destroy: true, }, }, - CheckDestroy: testVerifyQueuesDestroyed, + CheckDestroy: func(state *terraform.State) error { + time.Sleep(45 * time.Second) + return testVerifyQueuesAndUsersDestroyed(state) + }, }) } @@ -1548,9 +1650,8 @@ func generateUserWithCustomAttrs(resourceID string, email string, name string, a func checkUserDeleted(id string) resource.TestCheckFunc { log.Printf("Fetching user with ID: %s\n", id) return func(s *terraform.State) error { - maxAttempts := 18 + maxAttempts := 30 for i := 0; i < maxAttempts; i++ { - deleted, err := isUserDeleted(id) if err != nil { return err @@ -1568,7 +1669,7 @@ func isUserDeleted(id string) (bool, error) { mu.Lock() defer mu.Unlock() - usersAPI := platformclientv2.NewUsersApiWithConfig(sdkConfig) + usersAPI := platformclientv2.NewUsersApi() // Attempt to get the user _, response, err := usersAPI.GetUser(id, nil, "", "") diff --git a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_test.go b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_test.go index e910fb72c..259314613 100644 --- a/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_test.go +++ b/genesyscloud/routing_queue_conditional_group_routing/resource_genesyscloud_routing_queue_conditional_group_routing_test.go @@ -22,8 +22,7 @@ import ( ) var ( - sdkConfig *platformclientv2.Configuration - mu sync.Mutex + mu sync.Mutex ) func TestAccResourceRoutingQueueConditionalGroupRouting(t *testing.T) { @@ -260,17 +259,21 @@ func TestAccResourceRoutingQueueConditionalGroupRouting(t *testing.T) { return nil }, ), + + PreventPostDestroyRefresh: true, }, { // Import/Read ResourceName: "genesyscloud_routing_queue_conditional_group_routing." + conditionalGroupRoutingResource, ImportState: true, ImportStateVerify: true, - Check: resource.ComposeTestCheckFunc( - checkUserDeleted(userID), - ), + Destroy: true, }, }, + CheckDestroy: func(state *terraform.State) error { + time.Sleep(40 * time.Second) + return testVerifyGroupsAndUsersDestroyed(state) + }, }) } @@ -334,7 +337,7 @@ func generateUserWithCustomAttrs(resourceID string, email string, name string, a func checkUserDeleted(id string) resource.TestCheckFunc { log.Printf("Fetching user with ID: %s\n", id) return func(s *terraform.State) error { - maxAttempts := 18 + maxAttempts := 30 for i := 0; i < maxAttempts; i++ { deleted, err := isUserDeleted(id) @@ -354,7 +357,7 @@ func isUserDeleted(id string) (bool, error) { mu.Lock() defer mu.Unlock() - usersAPI := platformclientv2.NewUsersApiWithConfig(sdkConfig) + usersAPI := platformclientv2.NewUsersApi() // Attempt to get the user _, response, err := usersAPI.GetUser(id, nil, "", "") @@ -372,3 +375,40 @@ func isUserDeleted(id string) (bool, error) { // If user is found, it means the user is not deleted return false, nil } + +func testVerifyGroupsAndUsersDestroyed(state *terraform.State) error { + groupsAPI := platformclientv2.NewGroupsApi() + usersAPI := platformclientv2.NewUsersApi() + for _, rs := range state.RootModule().Resources { + if rs.Type == "genesyscloud_group" { + group, resp, err := groupsAPI.GetGroup(rs.Primary.ID) + if group != nil { + return fmt.Errorf("Group (%s) still exists", rs.Primary.ID) + } else if util.IsStatus404(resp) { + // Group not found as expected + continue + } else { + // Unexpected error + return fmt.Errorf("Unexpected error: %s", err) + } + } + if rs.Type == "genesyscloud_user" { + err := checkUserDeleted(rs.Primary.ID)(state) + if err != nil { + continue + } + user, resp, err := usersAPI.GetUser(rs.Primary.ID, nil, "", "") + if user != nil { + return fmt.Errorf("User Resource (%s) still exists", rs.Primary.ID) + } else if util.IsStatus404(resp) { + // User not found as expected + continue + } else { + // Unexpected error + return fmt.Errorf("Unexpected error: %s", err) + } + } + + } + return nil +} diff --git a/genesyscloud/routing_sms_addresses/data_source_genesyscloud_routing_sms_addresses_test.go b/genesyscloud/routing_sms_addresses/data_source_genesyscloud_routing_sms_addresses_test.go index a17585c89..0a7a376e2 100644 --- a/genesyscloud/routing_sms_addresses/data_source_genesyscloud_routing_sms_addresses_test.go +++ b/genesyscloud/routing_sms_addresses/data_source_genesyscloud_routing_sms_addresses_test.go @@ -2,21 +2,24 @@ package genesyscloud import ( "fmt" + "os" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "testing" - "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) func TestAccDataSourceSmsAddressProdOrg(t *testing.T) { - t.Skip("Skip this test as it will only pass in a prod org") + //this test as it will only pass in a prod org + if v := os.Getenv("GENESYSCLOUD_REGION"); v == "tca" { + t.Skip("This test as it will only pass in a prod org") + } var ( addressRes = "addressRes" addressData = "addressData" - name = "Address" + uuid.NewString() + name = "name-1" ) resource.Test(t, resource.TestCase{ @@ -27,11 +30,11 @@ func TestAccDataSourceSmsAddressProdOrg(t *testing.T) { Config: generateRoutingSmsAddressesResource( addressRes, name, - "Main street", - "New York", - "New York", - "AA34HH", - "US", + "street-1", + "city-1", + "region-1", + "postal-code-1", + "country-code-1", util.FalseValue, ) + generateSmsAddressDataSource( addressData, @@ -51,6 +54,9 @@ func TestAccDataSourceSmsAddressProdOrg(t *testing.T) { // If running in a prod org this test can be removed/skipped, it's only intended as a backup test for test orgs func TestAccDataSourceSmsAddressTestOrg(t *testing.T) { + if v := os.Getenv("GENESYSCLOUD_REGION"); v == "us-east-1" { + t.Skip("Test intended only for test org") + } var ( addressRes = "addressRes" addressData = "addressData" @@ -69,8 +75,8 @@ func TestAccDataSourceSmsAddressTestOrg(t *testing.T) { "street-1", "city-1", "region-1", - "postal-code-1", - "country-code-1", + "90080", + "US", util.TrueValue, ) + generateSmsAddressDataSource( addressData, diff --git a/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses_test.go b/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses_test.go index 5ea01bb2c..629a2c316 100644 --- a/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses_test.go +++ b/genesyscloud/routing_sms_addresses/resource_genesyscloud_routing_sms_addresses_test.go @@ -2,27 +2,29 @@ package genesyscloud import ( "fmt" + "os" "terraform-provider-genesyscloud/genesyscloud/provider" "terraform-provider-genesyscloud/genesyscloud/util" "testing" - "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/mypurecloud/platform-client-sdk-go/v133/platformclientv2" ) func TestAccResourceRoutingSmsAddressesProdOrg(t *testing.T) { - // If running in a prod org remove the below line - t.Skip("This test will only pass in a prod org") + // This test is valid only for prod + if v := os.Getenv("GENESYSCLOUD_REGION"); v == "tca" { + t.Skip("This test is valid only for prod") + } var ( - resourceName = "sms-address1" - name = "address name-" + uuid.NewString() - street = "Main street" - city = "Galway" - region = "Galway" - postalCode = "H91DZ48" - countryCode = "US" + resourceName = "AD-123" + name = "name-1" + street = "street-1" + city = "city-1" + region = "region-1" + postalCode = "postal-code-1" + countryCode = "country-code-1" ) resource.Test(t, resource.TestCase{ @@ -50,6 +52,8 @@ func TestAccResourceRoutingSmsAddressesProdOrg(t *testing.T) { resource.TestCheckResourceAttr("genesyscloud_routing_sms_address."+resourceName, "country_code", countryCode), resource.TestCheckResourceAttr("genesyscloud_routing_sms_address."+resourceName, "auto_correct_address", util.FalseValue), ), + + PreventPostDestroyRefresh: true, }, { // Import/Read @@ -57,15 +61,19 @@ func TestAccResourceRoutingSmsAddressesProdOrg(t *testing.T) { ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{"auto_correct_address"}, + Destroy: false, + //This type of org does not go out to SMS vendors. When you try and create an address in this case its trying to save it with the vendor, getting a mocked response and not storing any value. Hence cannot be deleted. }, }, - CheckDestroy: testVerifySmsAddressDestroyed, + CheckDestroy: nil, }) } // If running in a prod org this test can be removed/skipped, it's only intended as a backup test for test orgs func TestAccResourceRoutingSmsAddressesTestOrg(t *testing.T) { - t.Skip("returns empty in tca | test not needed in prod") + if v := os.Getenv("GENESYSCLOUD_REGION"); v == "us-east-1" { + t.Skip("This test will only pass in Test org") + } var ( // Due to running in a test org, a default address will be returned from the API and not the address we set. // This is because sms addresses are stored in twilio. Test orgs do not have twilio accounts so a default @@ -75,8 +83,8 @@ func TestAccResourceRoutingSmsAddressesTestOrg(t *testing.T) { street = "street-1" city = "city-1" region = "region-1" - postalCode = "postal-code-1" - countryCode = "country-code-1" + postalCode = "70090" + countryCode = "US" ) resource.Test(t, resource.TestCase{ diff --git a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_test.go b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_test.go index ca7b09718..fa0af605f 100644 --- a/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_test.go +++ b/genesyscloud/routing_utilization_label/resource_genesyscloud_routing_utilization_label_test.go @@ -51,6 +51,7 @@ func TestAccResourceRoutingUtilizationLabelBasic(t *testing.T) { ResourceName: "genesyscloud_routing_utilization_label." + resourceName, ImportState: true, ImportStateVerify: true, + Destroy: true, }, }, CheckDestroy: validateTestLabelDestroyed, diff --git a/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings_test.go b/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings_test.go index e2210b361..28bcfc7a2 100644 --- a/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings_test.go +++ b/genesyscloud/telephony/resource_genesyscloud_telephony_providers_edges_trunkbasesettings_test.go @@ -102,7 +102,7 @@ func TestAccResourceTrunkBaseSettings(t *testing.T) { } func TestAccResourceExternralTrunkBaseSettingsInboundSite(t *testing.T) { - t.Skip("Skipping because BYOC Does not exist in Org used for acceptance tests") + var ( trunkBaseSettingsRes = "trunkBaseSettings1234" name1 = "test trunk base settings " + uuid.NewString() @@ -122,7 +122,7 @@ func TestAccResourceExternralTrunkBaseSettingsInboundSite(t *testing.T) { "HQ", []string{}, gcloud.GenerateLocationEmergencyNum( - "+13100000001", + "+13100000003", util.NullValue, ), gcloud.GenerateLocationAddress( @@ -165,15 +165,13 @@ func TestAccResourceExternralTrunkBaseSettingsInboundSite(t *testing.T) { resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_trunkbasesettings."+trunkBaseSettingsRes, "trunk_type", trunkType), resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_trunkbasesettings."+trunkBaseSettingsRes, "managed", util.FalseValue), util.ValidateValueInJsonPropertiesAttr("genesyscloud_telephony_providers_edges_trunkbasesettings."+trunkBaseSettingsRes, "properties", "trunk_label", name1), - util.ValidateValueInJsonPropertiesAttr("genesyscloud_telephony_providers_edges_trunkbasesettings."+trunkBaseSettingsRes, "properties", "trunk_max_dial_timeout", "1m"), - util.ValidateValueInJsonPropertiesAttr("genesyscloud_telephony_providers_edges_trunkbasesettings."+trunkBaseSettingsRes, "properties", "trunk_transport_sip_dscp_value", "25"), - util.ValidateValueInJsonPropertiesAttr("genesyscloud_telephony_providers_edges_trunkbasesettings."+trunkBaseSettingsRes, "properties", "trunk_media_disconnect_on_idle_rtp", util.FalseValue), - util.ValidateValueInJsonPropertiesAttr("genesyscloud_telephony_providers_edges_trunkbasesettings."+trunkBaseSettingsRes, "properties", "trunk_media_codec", strings.Join([]string{"audio/pcmu"}, ",")), - ), + util.ValidateValueInJsonPropertiesAttr("genesyscloud_telephony_providers_edges_trunkbasesettings."+trunkBaseSettingsRes, "properties", "trunk_maxDialTimeout", "2m"), + util.ValidateValueInJsonPropertiesAttr("genesyscloud_telephony_providers_edges_trunkbasesettings."+trunkBaseSettingsRes, "properties", "trunk_media_disconnectOnIdleRTP", util.TrueValue), + util.ValidateValueInJsonPropertiesAttr("genesyscloud_telephony_providers_edges_trunkbasesettings."+trunkBaseSettingsRes, "properties", "trunk_media_codec", "audio/opus,audio/pcmu,audio/pcma")), }, // Update with new name, description and properties { - Config: GenerateTrunkBaseSettingsResourceWithCustomAttrs( + Config: referencedResources + GenerateTrunkBaseSettingsResourceWithCustomAttrs( trunkBaseSettingsRes, name2, description2, @@ -189,11 +187,9 @@ func TestAccResourceExternralTrunkBaseSettingsInboundSite(t *testing.T) { resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_trunkbasesettings."+trunkBaseSettingsRes, "trunk_type", trunkType), resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_trunkbasesettings."+trunkBaseSettingsRes, "managed", util.FalseValue), util.ValidateValueInJsonPropertiesAttr("genesyscloud_telephony_providers_edges_trunkbasesettings."+trunkBaseSettingsRes, "properties", "trunk_label", name2), - util.ValidateValueInJsonPropertiesAttr("genesyscloud_telephony_providers_edges_trunkbasesettings."+trunkBaseSettingsRes, "properties", "trunk_max_dial_timeout", "2m"), - util.ValidateValueInJsonPropertiesAttr("genesyscloud_telephony_providers_edges_trunkbasesettings."+trunkBaseSettingsRes, "properties", "trunk_transport_sip_dscp_value", "50"), - util.ValidateValueInJsonPropertiesAttr("genesyscloud_telephony_providers_edges_trunkbasesettings."+trunkBaseSettingsRes, "properties", "trunk_media_disconnect_on_idle_rtp", util.TrueValue), - util.ValidateValueInJsonPropertiesAttr("genesyscloud_telephony_providers_edges_trunkbasesettings."+trunkBaseSettingsRes, "properties", "trunk_media_codec", strings.Join([]string{"audio/opus"}, ",")), - ), + util.ValidateValueInJsonPropertiesAttr("genesyscloud_telephony_providers_edges_trunkbasesettings."+trunkBaseSettingsRes, "properties", "trunk_maxDialTimeout", "2m"), + util.ValidateValueInJsonPropertiesAttr("genesyscloud_telephony_providers_edges_trunkbasesettings."+trunkBaseSettingsRes, "properties", "trunk_media_disconnectOnIdleRTP", util.TrueValue), + util.ValidateValueInJsonPropertiesAttr("genesyscloud_telephony_providers_edges_trunkbasesettings."+trunkBaseSettingsRes, "properties", "trunk_media_codec", "audio/opus,audio/pcmu,audio/pcma")), }, { // Import/Read @@ -201,6 +197,35 @@ func TestAccResourceExternralTrunkBaseSettingsInboundSite(t *testing.T) { ImportState: true, ImportStateVerify: true, }, + { + Config: gcloud.GenerateLocationResource( + locationResourceId, + "tf location "+uuid.NewString(), + "HQ", + []string{}, + gcloud.GenerateLocationEmergencyNum( + "+13100000003", + util.NullValue, + ), + gcloud.GenerateLocationAddress( + "7601 Interactive Way", + "Orlando", + "FL", + "US", + "32826", + ), + ) + edgeSite.GenerateSiteResourceWithCustomAttrs( + siteId, + "tf site "+uuid.NewString(), + "test description", + "genesyscloud_location."+locationResourceId+".id", + "Cloud", + false, + "[\"us-east-1\"]", + util.NullValue, + util.NullValue, + ), + }, }, CheckDestroy: testVerifyTrunkBaseSettingsDestroyed, }) diff --git a/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_test.go b/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_test.go index c0d722626..d05b9a5f1 100644 --- a/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_test.go +++ b/genesyscloud/telephony_providers_edges_edge_group/resource_genesyscloud_telephony_providers_edges_edge_group_test.go @@ -14,7 +14,6 @@ import ( ) func TestAccResourceEdgeGroup(t *testing.T) { - t.Skip("Skipping this test for now because hybrid customers will not use edge groups and will only be able to modify the existing hybrid edge group. EdgeGroup will need to be refactored.") t.Parallel() var ( edgeGroupRes = "edgeGroup1234" diff --git a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go index f9955feea..4e8421b64 100644 --- a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go +++ b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_test.go @@ -184,26 +184,38 @@ func TestAccResourcePhoneBasic(t *testing.T) { }) } -func TestAccResourcePhoneStandalone(t *testing.T) { - lineAddresses := "+12005538112" - deleteDidPoolWithNumber(lineAddresses) - didPoolResource1 := "test-didpool1" - phoneRes := "phone_standalone1234" - name1 := "test-phone-standalone_" + uuid.NewString() +func TestAccResourceHardPhoneStandalone(t *testing.T) { + number := "+13172128941" + phoneMac := "AB12CD34" + phoneMacUpdated := "BANANAS" + // TODO: Use did pool resource inside config once cyclic dependency issue is resolved between genesyscloud and did_pools package + didPoolId, err := createDidPoolForEdgesPhoneTest(sdkConfig, number) + if err != nil { + t.Fatal(err) + } + defer func() { + if err := deleteDidPool(sdkConfig, didPoolId); err != nil { + t.Logf("failed to delete did pool '%s': %v", didPoolId, err) + } + }() + + phoneRes := "phone_standalone987" + name := "test-phone-standalone_" + uuid.NewString() + stateActive := "active" - phoneBaseSettingsRes := "phoneBaseSettings1234" + phoneBaseSettingsRes := "phoneBaseSettings987" phoneBaseSettingsName := "phoneBaseSettings " + uuid.NewString() - locationRes := "test-location" + locationRes := "test-location-test111" - emergencyNumber := "+13173114121" - if err := edgeSite.DeleteLocationWithNumber(emergencyNumber, sdkConfig); err != nil { + emergencyNumber := "+13293100121" + if err = edgeSite.DeleteLocationWithNumber(emergencyNumber, sdkConfig); err != nil { t.Skipf("failed to delete location with number %s: %v", emergencyNumber, err) } locationConfig := gcloud.GenerateLocationResource( locationRes, - "Terraform location"+uuid.NewString(), + "Terraform-location"+uuid.NewString(), "HQ1", []string{}, gcloud.GenerateLocationEmergencyNum( @@ -214,7 +226,7 @@ func TestAccResourcePhoneStandalone(t *testing.T) { "Indianapolis", "IN", "US", - "46279", + "41119", )) siteRes := "test-site" @@ -233,61 +245,71 @@ func TestAccResourcePhoneStandalone(t *testing.T) { ) capabilities := generatePhoneCapabilities( - false, true, true, true, true, false, true, + false, "mac", - []string{}, + []string{strconv.Quote("audio/opus"), strconv.Quote("audio/pcmu"), strconv.Quote("audio/pcma")}, + ) + config := locationConfig + siteConfig + phoneBaseSettings.GeneratePhoneBaseSettingsResourceWithCustomAttrs( + phoneBaseSettingsRes, + phoneBaseSettingsName, + "phoneBaseSettings description", + "audiocodes_400hd.json", ) + phone1 := GeneratePhoneResourceWithCustomAttrs(&PhoneConfig{ + phoneRes, + name, + stateActive, + "genesyscloud_telephony_providers_edges_site." + siteRes + ".id", + "genesyscloud_telephony_providers_edges_phonebasesettings." + phoneBaseSettingsRes + ".id", + "", // no web rtc user + "", // no Depends On + }, capabilities, generatePhoneProperties(phoneMac)) + + //only mac is updated here, same resource as phone 1 + phone2 := GeneratePhoneResourceWithCustomAttrs(&PhoneConfig{ + phoneRes, + name, + stateActive, + "genesyscloud_telephony_providers_edges_site." + siteRes + ".id", + "genesyscloud_telephony_providers_edges_phonebasesettings." + phoneBaseSettingsRes + ".id", + "", // no web rtc user + "", // no Depends On + }, capabilities, generatePhoneProperties(phoneMacUpdated)) resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) }, ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), Steps: []resource.TestStep{ { - PreConfig: func() { - time.Sleep(30 * time.Second) - }, - Config: didPool.GenerateDidPoolResource(&didPool.DidPoolStruct{ - ResourceID: didPoolResource1, - StartPhoneNumber: lineAddresses, - EndPhoneNumber: lineAddresses, - Description: util.NullValue, // No description - Comments: util.NullValue, // No comments - PoolProvider: util.NullValue, // No provider - }) + locationConfig + siteConfig + phoneBaseSettings.GeneratePhoneBaseSettingsResourceWithCustomAttrs( - phoneBaseSettingsRes, - phoneBaseSettingsName, - "phoneBaseSettings description", - "generic_sip.json", - ) + GeneratePhoneResourceWithCustomAttrs(&PhoneConfig{ - phoneRes, - name1, - stateActive, - "genesyscloud_telephony_providers_edges_site." + siteRes + ".id", - "genesyscloud_telephony_providers_edges_phonebasesettings." + phoneBaseSettingsRes + ".id", - "", // no web rtc user - "genesyscloud_telephony_providers_edges_did_pool." + didPoolResource1, - }, capabilities, generateLineProperties(strconv.Quote(lineAddresses), ""), generatePhoneProperties(uuid.NewString())), + + Config: config + phone1, Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "name", name1), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "name", name), resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "state", stateActive), resource.TestCheckResourceAttrPair("genesyscloud_telephony_providers_edges_phone."+phoneRes, "site_id", "genesyscloud_telephony_providers_edges_site."+siteRes, "id"), resource.TestCheckResourceAttrPair("genesyscloud_telephony_providers_edges_phone."+phoneRes, "line_base_settings_id", "genesyscloud_telephony_providers_edges_phonebasesettings."+phoneBaseSettingsRes, "line_base_settings_id"), resource.TestCheckResourceAttrPair("genesyscloud_telephony_providers_edges_phone."+phoneRes, "phone_base_settings_id", "genesyscloud_telephony_providers_edges_phonebasesettings."+phoneBaseSettingsRes, "id"), - resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "line_properties.0.line_address.0", lineAddresses), - resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.provisions", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.provisions", util.TrueValue), resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.registers", util.TrueValue), resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.dual_registers", util.TrueValue), resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.allow_reboot", util.TrueValue), - resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.no_rebalance", util.TrueValue), - resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.no_cloud_provisioning", util.FalseValue), - resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.cdm", util.TrueValue), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.no_rebalance", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.no_cloud_provisioning", util.TrueValue), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.cdm", util.FalseValue), resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.hardware_id_type", "mac"), + util.ValidateValueInJsonPropertiesAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "properties", "phone_hardwareId", phoneMac), + ), + }, + { + Config: config + phone2, + Check: resource.ComposeTestCheckFunc( + util.ValidateValueInJsonPropertiesAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "properties", "phone_hardwareId", phoneMacUpdated), ), }, { @@ -301,38 +323,26 @@ func TestAccResourcePhoneStandalone(t *testing.T) { }) } -func TestAccResourceHardPhoneStandalone(t *testing.T) { - number := "+13172128941" - phoneMac := "AB12CD34" - phoneMacUpdated := "BANANAS" - // TODO: Use did pool resource inside config once cyclic dependency issue is resolved between genesyscloud and did_pools package - didPoolId, err := createDidPoolForEdgesPhoneTest(sdkConfig, number) - if err != nil { - t.Fatal(err) - } - defer func() { - if err := deleteDidPool(sdkConfig, didPoolId); err != nil { - t.Logf("failed to delete did pool '%s': %v", didPoolId, err) - } - }() - - phoneRes := "phone_standalone987" - name := "test-phone-standalone_" + uuid.NewString() - +func TestAccResourcePhoneStandalone(t *testing.T) { + lineAddresses := "+12005537112" + deleteDidPoolWithNumber(lineAddresses) + didPoolResource1 := "test-didpool1" + phoneRes := "phone_standalone1234" + name1 := "test-phone-standalone_" + uuid.NewString() stateActive := "active" - phoneBaseSettingsRes := "phoneBaseSettings987" + phoneBaseSettingsRes := "phoneBaseSettings1234" phoneBaseSettingsName := "phoneBaseSettings " + uuid.NewString() + fullResourceId := "genesyscloud_telephony_providers_edges_did_pool" + "." + didPoolResource1 + locationRes := "test-location" - locationRes := "test-location-test111" - - emergencyNumber := "+13293100121" - if err = edgeSite.DeleteLocationWithNumber(emergencyNumber, sdkConfig); err != nil { + emergencyNumber := "+13173114121" + if err := edgeSite.DeleteLocationWithNumber(emergencyNumber, sdkConfig); err != nil { t.Skipf("failed to delete location with number %s: %v", emergencyNumber, err) } locationConfig := gcloud.GenerateLocationResource( locationRes, - "Terraform-location"+uuid.NewString(), + "Terraform location"+uuid.NewString(), "HQ1", []string{}, gcloud.GenerateLocationEmergencyNum( @@ -343,7 +353,7 @@ func TestAccResourceHardPhoneStandalone(t *testing.T) { "Indianapolis", "IN", "US", - "41119", + "46279", )) siteRes := "test-site" @@ -354,7 +364,7 @@ func TestAccResourceHardPhoneStandalone(t *testing.T) { "genesyscloud_location."+locationRes+".id", "Premises", false, - `["us-east-1"]`, + util.AssignRegion(), util.NullValue, util.NullValue, "primary_sites = []", @@ -362,70 +372,74 @@ func TestAccResourceHardPhoneStandalone(t *testing.T) { ) capabilities := generatePhoneCapabilities( + false, true, true, true, true, false, true, - false, "mac", - []string{strconv.Quote("audio/opus"), strconv.Quote("audio/pcmu"), strconv.Quote("audio/pcma")}, - ) - config := locationConfig + siteConfig + phoneBaseSettings.GeneratePhoneBaseSettingsResourceWithCustomAttrs( - phoneBaseSettingsRes, - phoneBaseSettingsName, - "phoneBaseSettings description", - "audiocodes_400hd.json", + []string{}, ) - phone1 := GeneratePhoneResourceWithCustomAttrs(&PhoneConfig{ - phoneRes, - name, - stateActive, - "genesyscloud_telephony_providers_edges_site." + siteRes + ".id", - "genesyscloud_telephony_providers_edges_phonebasesettings." + phoneBaseSettingsRes + ".id", - "", // no web rtc user - "", // no Depends On - }, capabilities, generatePhoneProperties(phoneMac)) - - //only mac is updated here, same resource as phone 1 - phone2 := GeneratePhoneResourceWithCustomAttrs(&PhoneConfig{ - phoneRes, - name, - stateActive, - "genesyscloud_telephony_providers_edges_site." + siteRes + ".id", - "genesyscloud_telephony_providers_edges_phonebasesettings." + phoneBaseSettingsRes + ".id", - "", // no web rtc user - "", // no Depends On - }, capabilities, generatePhoneProperties(phoneMacUpdated)) resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) }, ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), Steps: []resource.TestStep{ { - Config: config + phone1, + Config: didPool.GenerateDidPoolResource(&didPool.DidPoolStruct{ + ResourceID: didPoolResource1, + StartPhoneNumber: lineAddresses, + EndPhoneNumber: lineAddresses, + Description: util.NullValue, // No description + Comments: util.NullValue, // No comments + PoolProvider: util.NullValue, // No provider + }), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "name", name), + func(s *terraform.State) error { + time.Sleep(30 * time.Second) // Wait for 30 seconds for proper updation + return nil + }, + resource.TestCheckResourceAttr(fullResourceId, "start_phone_number", lineAddresses)), + }, + { + Config: didPool.GenerateDidPoolResource(&didPool.DidPoolStruct{ + ResourceID: didPoolResource1, + StartPhoneNumber: lineAddresses, + EndPhoneNumber: lineAddresses, + Description: util.NullValue, // No description + Comments: util.NullValue, // No comments + PoolProvider: util.NullValue, // No provider + }) + locationConfig + siteConfig + phoneBaseSettings.GeneratePhoneBaseSettingsResourceWithCustomAttrs( + phoneBaseSettingsRes, + phoneBaseSettingsName, + "phoneBaseSettings description", + "generic_sip.json", + ) + GeneratePhoneResourceWithCustomAttrs(&PhoneConfig{ + phoneRes, + name1, + stateActive, + "genesyscloud_telephony_providers_edges_site." + siteRes + ".id", + "genesyscloud_telephony_providers_edges_phonebasesettings." + phoneBaseSettingsRes + ".id", + "", // no web rtc user + "genesyscloud_telephony_providers_edges_did_pool." + didPoolResource1, + }, capabilities, generateLineProperties(strconv.Quote(lineAddresses), ""), generatePhoneProperties(uuid.NewString())), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "name", name1), resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "state", stateActive), resource.TestCheckResourceAttrPair("genesyscloud_telephony_providers_edges_phone."+phoneRes, "site_id", "genesyscloud_telephony_providers_edges_site."+siteRes, "id"), resource.TestCheckResourceAttrPair("genesyscloud_telephony_providers_edges_phone."+phoneRes, "line_base_settings_id", "genesyscloud_telephony_providers_edges_phonebasesettings."+phoneBaseSettingsRes, "line_base_settings_id"), resource.TestCheckResourceAttrPair("genesyscloud_telephony_providers_edges_phone."+phoneRes, "phone_base_settings_id", "genesyscloud_telephony_providers_edges_phonebasesettings."+phoneBaseSettingsRes, "id"), - resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.provisions", util.TrueValue), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "line_properties.0.line_address.0", lineAddresses), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.provisions", util.FalseValue), resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.registers", util.TrueValue), resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.dual_registers", util.TrueValue), resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.allow_reboot", util.TrueValue), - resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.no_rebalance", util.FalseValue), - resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.no_cloud_provisioning", util.TrueValue), - resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.cdm", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.no_rebalance", util.TrueValue), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.no_cloud_provisioning", util.FalseValue), + resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.cdm", util.TrueValue), resource.TestCheckResourceAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "capabilities.0.hardware_id_type", "mac"), - util.ValidateValueInJsonPropertiesAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "properties", "phone_hardwareId", phoneMac), - ), - }, - { - Config: config + phone2, - Check: resource.ComposeTestCheckFunc( - util.ValidateValueInJsonPropertiesAttr("genesyscloud_telephony_providers_edges_phone."+phoneRes, "properties", "phone_hardwareId", phoneMacUpdated), ), }, { diff --git a/genesyscloud/telephony_providers_edges_trunk/genesyscloud_telephony_providers_edges_trunk_init_test.go b/genesyscloud/telephony_providers_edges_trunk/genesyscloud_telephony_providers_edges_trunk_init_test.go index bdff55d86..b7dd1260b 100644 --- a/genesyscloud/telephony_providers_edges_trunk/genesyscloud_telephony_providers_edges_trunk_init_test.go +++ b/genesyscloud/telephony_providers_edges_trunk/genesyscloud_telephony_providers_edges_trunk_init_test.go @@ -3,8 +3,8 @@ package telephony_providers_edges_trunk import ( "sync" gcloud "terraform-provider-genesyscloud/genesyscloud" - telephony "terraform-provider-genesyscloud/genesyscloud/telephony" + edgeGroup "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_edge_group" edgeSite "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_site" "testing" @@ -31,6 +31,7 @@ func (r *registerTestInstance) registerTestResources() { providerResources["genesyscloud_telephony_providers_edges_site"] = edgeSite.ResourceSite() providerResources["genesyscloud_location"] = gcloud.ResourceLocation() + providerResources["genesyscloud_telephony_providers_edges_edge_group"] = edgeGroup.ResourceEdgeGroup() } @@ -43,6 +44,7 @@ func (r *registerTestInstance) registerTestDataSources() { providerDataSources[resourceName] = DataSourceTrunk() // external package dependencies providerDataSources["genesyscloud_telephony_providers_edges_site"] = edgeSite.DataSourceSite() + providerDataSources["genesyscloud_telephony_providers_edges_edge_group"] = edgeGroup.DataSourceEdgeGroup() } diff --git a/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go b/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go index ed8973113..5d189152c 100644 --- a/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go +++ b/genesyscloud/tfexporter/resource_genesyscloud_tf_export_test.go @@ -319,71 +319,73 @@ func TestAccResourceTfExportExcludeFilterResourcesByRegExExclusiveToResource(t * }) } -// TestAccResourceTfExportExcludeFilterResourcesByRegExExclusiveToResourceAndSanitizedNames will exclude any test resources that match a -// regular expression provided for the resource. In this test we check against both sanitized and unsanitized names. -func TestAccResourceTfExportExcludeFilterResourcesByRegExExclusiveToResourceAndSanitizedNames(t *testing.T) { +// TestAccResourceTfExportSplitFilesAsJSON will create 2 queues, 2 wrap up codes, and 2 users. +// The exporter will be run in split mode so 3 resource tf.jsons should be created as well as a provider.tf.json +func TestAccResourceTfExportSplitFilesAsJSON(t *testing.T) { var ( - exportTestDir = "../.terraformExclude" + uuid.NewString() - exportResource = "test-export6_1" + exportTestDir = "../.terraform" + uuid.NewString() + exportResource = "test-export-split" + uniquePostfix = randString(7) + expectedFilesPath = []string{ + filepath.Join(exportTestDir, "genesyscloud_routing_queue.tf.json"), + filepath.Join(exportTestDir, "genesyscloud_user.tf.json"), + filepath.Join(exportTestDir, "genesyscloud_routing_wrapupcode.tf.json"), + filepath.Join(exportTestDir, "provider.tf.json"), + } queueResources = []QueueExport{ - {ResourceName: "test-queue-test-1", Name: "exclude filter - exclude me", Description: "This is an excluded bar test resource", AcwTimeoutMs: 200000}, - {ResourceName: "test-queue-test-2", Name: "exclude filter - foo - bar me", Description: "This is a foo bar test resource", AcwTimeoutMs: 200000}, - {ResourceName: "test-queue-test-3", Name: "exclude filter - fu - barre you", Description: "This is a foo bar test resource", AcwTimeoutMs: 200000}, + {ResourceName: "test-queue-1", Name: "test-queue-1-" + uuid.NewString() + uniquePostfix, Description: "This is a test queue", AcwTimeoutMs: 200000}, + {ResourceName: "test-queue-2", Name: "test-queue-1-" + uuid.NewString() + uniquePostfix, Description: "This is a test queue too", AcwTimeoutMs: 200000}, + } + + userResources = []UserExport{ + {ResourceName: "test-user-1", Name: "test-user-1", Email: "test-user-1" + uuid.NewString() + "@test.com" + uniquePostfix, State: "active"}, + {ResourceName: "test-user-2", Name: "test-user-2", Email: "test-user-2" + uuid.NewString() + "@test.com" + uniquePostfix, State: "active"}, } wrapupCodeResources = []WrapupcodeExport{ - {ResourceName: "test-wrapupcode-prod", Name: "exclude me"}, - {ResourceName: "test-wrapupcode-test", Name: "foo + bar me"}, - {ResourceName: "test-wrapupcode-dev", Name: "fu - barre you"}, + {ResourceName: "test-wrapupcode-1", Name: "test-wrapupcode-1-" + uuid.NewString() + uniquePostfix}, + {ResourceName: "test-wrapupcode-2", Name: "test-wrapupcode-2-" + uuid.NewString() + uniquePostfix}, } ) defer os.RemoveAll(exportTestDir) queueResourceDef := buildQueueResources(queueResources) + userResourcesDef := buildUserResources(userResources) wrapupcodeResourceDef := buildWrapupcodeResources(wrapupCodeResources) - config := queueResourceDef + wrapupcodeResourceDef + - generateTfExportByExcludeFilterResources( + config := queueResourceDef + wrapupcodeResourceDef + userResourcesDef + + generateTfExportByIncludeFilterResources( exportResource, exportTestDir, util.TrueValue, []string{ - strconv.Quote("genesyscloud_routing_queue::exclude filter - foo - bar me"), - strconv.Quote("genesyscloud_routing_queue::exclude_filter_-_fu_-_barre_you"), - strconv.Quote("genesyscloud_outbound_ruleset"), - strconv.Quote("genesyscloud_user"), - strconv.Quote("genesyscloud_user_roles"), - strconv.Quote("genesyscloud_flow"), + strconv.Quote("genesyscloud_routing_queue::" + uniquePostfix + "$"), + strconv.Quote("genesyscloud_user::" + uniquePostfix + "$"), + strconv.Quote("genesyscloud_routing_wrapupcode::" + uniquePostfix + "$"), }, util.FalseValue, - util.FalseValue, + util.TrueValue, []string{ strconv.Quote("genesyscloud_routing_queue." + queueResources[0].ResourceName), strconv.Quote("genesyscloud_routing_queue." + queueResources[1].ResourceName), - strconv.Quote("genesyscloud_routing_queue." + queueResources[2].ResourceName), + strconv.Quote("genesyscloud_user." + userResources[0].ResourceName), + strconv.Quote("genesyscloud_user." + userResources[1].ResourceName), strconv.Quote("genesyscloud_routing_wrapupcode." + wrapupCodeResources[0].ResourceName), strconv.Quote("genesyscloud_routing_wrapupcode." + wrapupCodeResources[1].ResourceName), - strconv.Quote("genesyscloud_routing_wrapupcode." + wrapupCodeResources[2].ResourceName), }, ) - sanitizer := resourceExporter.NewSanitizerProvider() resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) }, ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), Steps: []resource.TestStep{ { - PreConfig: func() { - time.Sleep(30 * time.Second) - }, - // Generate a queue as well and export it Config: config, Check: resource.ComposeTestCheckFunc( - testQueueExportEqual(exportTestDir+"/"+defaultTfJSONFile, "genesyscloud_routing_queue", sanitizer.S.SanitizeResourceName(queueResources[0].Name), queueResources[0]), - testWrapupcodeExportEqual(exportTestDir+"/"+defaultTfJSONFile, "genesyscloud_routing_wrapupcode", sanitizer.S.SanitizeResourceName(wrapupCodeResources[0].Name), wrapupCodeResources[0]), - testWrapupcodeExportEqual(exportTestDir+"/"+defaultTfJSONFile, "genesyscloud_routing_wrapupcode", sanitizer.S.SanitizeResourceName(wrapupCodeResources[1].Name), wrapupCodeResources[1]), - testWrapupcodeExportEqual(exportTestDir+"/"+defaultTfJSONFile, "genesyscloud_routing_wrapupcode", sanitizer.S.SanitizeResourceName(wrapupCodeResources[2].Name), wrapupCodeResources[2]), - testQueueExportExcludesRegEx(exportTestDir+"/"+defaultTfJSONFile, "genesyscloud_routing_queue", "(foo|fu)"), + validateFileCreated(expectedFilesPath[0]), + validateFileCreated(expectedFilesPath[1]), + validateFileCreated(expectedFilesPath[2]), + validateFileCreated(expectedFilesPath[3]), ), }, }, @@ -391,73 +393,71 @@ func TestAccResourceTfExportExcludeFilterResourcesByRegExExclusiveToResourceAndS }) } -// TestAccResourceTfExportSplitFilesAsJSON will create 2 queues, 2 wrap up codes, and 2 users. -// The exporter will be run in split mode so 3 resource tf.jsons should be created as well as a provider.tf.json -func TestAccResourceTfExportSplitFilesAsJSON(t *testing.T) { +// TestAccResourceTfExportExcludeFilterResourcesByRegExExclusiveToResourceAndSanitizedNames will exclude any test resources that match a +// regular expression provided for the resource. In this test we check against both sanitized and unsanitized names. +func TestAccResourceTfExportExcludeFilterResourcesByRegExExclusiveToResourceAndSanitizedNames(t *testing.T) { var ( - exportTestDir = "../.terraform" + uuid.NewString() - exportResource = "test-export-split" - uniquePostfix = randString(7) - expectedFilesPath = []string{ - filepath.Join(exportTestDir, "genesyscloud_routing_queue.tf.json"), - filepath.Join(exportTestDir, "genesyscloud_user.tf.json"), - filepath.Join(exportTestDir, "genesyscloud_routing_wrapupcode.tf.json"), - filepath.Join(exportTestDir, "provider.tf.json"), - } + exportTestDir = "../.terraformExclude" + uuid.NewString() + exportResource = "test-export6_1" queueResources = []QueueExport{ - {ResourceName: "test-queue-1", Name: "test-queue-1-" + uuid.NewString() + uniquePostfix, Description: "This is a test queue", AcwTimeoutMs: 200000}, - {ResourceName: "test-queue-2", Name: "test-queue-1-" + uuid.NewString() + uniquePostfix, Description: "This is a test queue too", AcwTimeoutMs: 200000}, - } - - userResources = []UserExport{ - {ResourceName: "test-user-1", Name: "test-user-1", Email: "test-user-1" + uuid.NewString() + "@test.com" + uniquePostfix, State: "active"}, - {ResourceName: "test-user-2", Name: "test-user-2", Email: "test-user-2" + uuid.NewString() + "@test.com" + uniquePostfix, State: "active"}, + {ResourceName: "test-queue-test-1", Name: "exclude filter - exclude me", Description: "This is an excluded bar test resource", AcwTimeoutMs: 200000}, + {ResourceName: "test-queue-test-2", Name: "exclude filter - foo - bar me", Description: "This is a foo bar test resource", AcwTimeoutMs: 200000}, + {ResourceName: "test-queue-test-3", Name: "exclude filter - fu - barre you", Description: "This is a foo bar test resource", AcwTimeoutMs: 200000}, } wrapupCodeResources = []WrapupcodeExport{ - {ResourceName: "test-wrapupcode-1", Name: "test-wrapupcode-1-" + uuid.NewString() + uniquePostfix}, - {ResourceName: "test-wrapupcode-2", Name: "test-wrapupcode-2-" + uuid.NewString() + uniquePostfix}, + {ResourceName: "test-wrapupcode-prod", Name: "exclude me"}, + {ResourceName: "test-wrapupcode-test", Name: "foo + bar me"}, + {ResourceName: "test-wrapupcode-dev", Name: "fu - barre you"}, } ) defer os.RemoveAll(exportTestDir) queueResourceDef := buildQueueResources(queueResources) - userResourcesDef := buildUserResources(userResources) wrapupcodeResourceDef := buildWrapupcodeResources(wrapupCodeResources) - config := queueResourceDef + wrapupcodeResourceDef + userResourcesDef + - generateTfExportByIncludeFilterResources( + config := queueResourceDef + wrapupcodeResourceDef + + generateTfExportByExcludeFilterResources( exportResource, exportTestDir, util.TrueValue, []string{ - strconv.Quote("genesyscloud_routing_queue::" + uniquePostfix + "$"), - strconv.Quote("genesyscloud_user::" + uniquePostfix + "$"), - strconv.Quote("genesyscloud_routing_wrapupcode::" + uniquePostfix + "$"), + strconv.Quote("genesyscloud_routing_queue::exclude filter - foo - bar me"), + strconv.Quote("genesyscloud_routing_queue::exclude_filter_-_fu_-_barre_you"), + strconv.Quote("genesyscloud_outbound_ruleset"), + strconv.Quote("genesyscloud_user"), + strconv.Quote("genesyscloud_user_roles"), + strconv.Quote("genesyscloud_flow"), }, util.FalseValue, - util.TrueValue, + util.FalseValue, []string{ strconv.Quote("genesyscloud_routing_queue." + queueResources[0].ResourceName), strconv.Quote("genesyscloud_routing_queue." + queueResources[1].ResourceName), - strconv.Quote("genesyscloud_user." + userResources[0].ResourceName), - strconv.Quote("genesyscloud_user." + userResources[1].ResourceName), + strconv.Quote("genesyscloud_routing_queue." + queueResources[2].ResourceName), strconv.Quote("genesyscloud_routing_wrapupcode." + wrapupCodeResources[0].ResourceName), strconv.Quote("genesyscloud_routing_wrapupcode." + wrapupCodeResources[1].ResourceName), + strconv.Quote("genesyscloud_routing_wrapupcode." + wrapupCodeResources[2].ResourceName), }, ) + sanitizer := resourceExporter.NewSanitizerProvider() resource.Test(t, resource.TestCase{ PreCheck: func() { util.TestAccPreCheck(t) }, ProviderFactories: provider.GetProviderFactories(providerResources, providerDataSources), Steps: []resource.TestStep{ { + PreConfig: func() { + time.Sleep(30 * time.Second) + }, + // Generate a queue as well and export it Config: config, Check: resource.ComposeTestCheckFunc( - validateFileCreated(expectedFilesPath[0]), - validateFileCreated(expectedFilesPath[1]), - validateFileCreated(expectedFilesPath[2]), - validateFileCreated(expectedFilesPath[3]), + testQueueExportEqual(exportTestDir+"/"+defaultTfJSONFile, "genesyscloud_routing_queue", sanitizer.S.SanitizeResourceName(queueResources[0].Name), queueResources[0]), + testWrapupcodeExportEqual(exportTestDir+"/"+defaultTfJSONFile, "genesyscloud_routing_wrapupcode", sanitizer.S.SanitizeResourceName(wrapupCodeResources[0].Name), wrapupCodeResources[0]), + testWrapupcodeExportEqual(exportTestDir+"/"+defaultTfJSONFile, "genesyscloud_routing_wrapupcode", sanitizer.S.SanitizeResourceName(wrapupCodeResources[1].Name), wrapupCodeResources[1]), + testWrapupcodeExportEqual(exportTestDir+"/"+defaultTfJSONFile, "genesyscloud_routing_wrapupcode", sanitizer.S.SanitizeResourceName(wrapupCodeResources[2].Name), wrapupCodeResources[2]), + testQueueExportExcludesRegEx(exportTestDir+"/"+defaultTfJSONFile, "genesyscloud_routing_queue", "(foo|fu)"), ), }, }, diff --git a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_test.go b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_test.go index 8e4abe831..90d56d53e 100644 --- a/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_test.go +++ b/genesyscloud/webdeployments_configuration/resource_genesyscloud_webdeployments_configuration_test.go @@ -1048,7 +1048,7 @@ func complexConfigurationResource(name, description, kbId string, nestedBlocks . `, name, description, kbId, strings.Join(nestedBlocks, "\n")) } -func generateWebDeploymentConfigCobrowseSettings(cbEnabled, cbAllowAgentControl string, cbAllowAgentNavigation string, cbChannels []string, cbMaskSelectors []string, cbReadonlySelectors []string, pauseCriteriaBlocks ...string,) string { +func generateWebDeploymentConfigCobrowseSettings(cbEnabled, cbAllowAgentControl string, cbAllowAgentNavigation string, cbChannels []string, cbMaskSelectors []string, cbReadonlySelectors []string, pauseCriteriaBlocks ...string) string { return fmt.Sprintf(` cobrowse { diff --git a/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_test.go b/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_test.go index 6582e2602..1379c8137 100644 --- a/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_test.go +++ b/genesyscloud/webdeployments_deployment/resource_genesyscloud_webdeployments_deployment_test.go @@ -70,7 +70,7 @@ func TestAccResourceWebDeploymentsDeployment_AllowedDomains(t *testing.T) { Config: deploymentResourceWithAllowedDomains(t, deploymentName, firstDomain), Check: resource.ComposeTestCheckFunc( func(s *terraform.State) error { - time.Sleep(30 * time.Second) // Wait for 30 seconds for status to become active + time.Sleep(45 * time.Second) // Wait for 30 seconds for status to become active return nil }, resource.TestCheckResourceAttr(fullResourceName, "name", deploymentName), diff --git a/jenkins/tests/Jenkinsfile b/jenkins/tests/Jenkinsfile index 3884e0d17..3c47db540 100644 --- a/jenkins/tests/Jenkinsfile +++ b/jenkins/tests/Jenkinsfile @@ -76,9 +76,9 @@ pipeline { sh "gotestsum --junitfile unit.xml --format standard-verbose ./genesyscloud/... -run 'Test|TestUnit' -skip 'TestAcc' -v -timeout 30m -count=1 -cover -coverprofile=coverageUnit.out" } - } } - } + } + } stage('Architect Tests') { environment { @@ -94,7 +94,7 @@ pipeline { } } } - } + } stage('Idp Tests') { environment { @@ -198,6 +198,9 @@ pipeline { environment { TF_ACC=1 TF_LOG="DEBUG" + TEST_DNC_GRYPHON_LICENSE_KEY="D7CE-E914-E4D4-4121-9428-36BD-07D8-9A41" + TEST_DNC_GRYPHON_PROD_LICENSE_KEY="4ADA-9A3B-5DAD-4FAD-95A7-4C31-425B-8594" + TEST_DNCCOM_LICENSE_KEY="96CAAC02650543056DF1ADA796A0082ED152561EDEE1" } steps { catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { @@ -517,201 +520,194 @@ pipeline { writeFile file: 'coverageReport.html', text: updatedHtmlFile - // Generate manual report - def xmlContent = readFile 'test-results.xml' - - // Extract test case information using regular expressions - def testCases = [] - def testCasePattern = /]*>([\s\S]*?)<\/failure>/ - def skippedPattern = /]*>([\s\S]*?)<\/skipped>/ - - def matcher = xmlContent =~ testCasePattern - while (matcher.find()) { - def classname = matcher.group(1) - def name = matcher.group(2) - def time = matcher.group(3) - def remainingText = xmlContent.substring(matcher.end()) - - def endIndex = remainingText.indexOf('') - def details = endIndex != -1 ? remainingText.substring(0, endIndex) : "" - - def result = [ - name: name, - classname: classname, - time: time, - status: 'Passed', // Default to Passed - reason: '', - log: details - ] - - // Check for failure or skipped - def failureMatcher = details =~ failurePattern - def skippedMatcher = details =~ skippedPattern - if (failureMatcher.find()) { - result.status = 'Failed' - result.log = failureMatcher.group(1).trim() - } else if (skippedMatcher.find()) { - result.status = 'Skipped' - result.log = skippedMatcher.group(1).trim() - } - - // Extract reason - if (result.status == 'Failed') { - result.reason = extractReason(result.log) - } else if (result.status == 'Skipped') { - result.reason = extractReason(result.log) - } - - testCases << result - } +def xmlContent = readFile 'test-results.xml' + +// Extract test case information using regular expressions +def testCases = [] +def testCasePattern = /]*>([\s\S]*?)<\/failure>/ +def skippedPattern = /') + def details = endIndex != -1 ? remainingText.substring(0, endIndex) : "" + + def result = [ + name: name, + classname: classname, + time: time, + status: 'Passed', // Default to Passed + reason: '', + log: details + ] + + // Check for failure or skipped + def failureMatcher = details =~ failurePattern + def skippedMatcher = details =~ skippedPattern + if (failureMatcher.find()) { + result.status = 'Failed' + result.log = failureMatcher.group(1).trim() + result.reason = extractReason(result.log) + } else if (skippedMatcher.find()) { + result.status = 'Skipped' + result.reason = skippedMatcher.group(1).trim() // Get the skipped reason directly + } - // Generate HTML report - def html = new StringBuilder() - html.append(""" - - - - - -

Test Results

-
-
Total Tests: ${testCases.size()}
-
Total Passed: ${testCases.count { it.status == 'Passed' }}
-
Total Failed: ${testCases.count { it.status == 'Failed' }}
-
Total Skipped: ${testCases.count { it.status == 'Skipped' }}
-
- -

Failed Tests

- - - - - - - - """) - - testCases.findAll { it.status == 'Failed' }.each { result -> - html.append(""" - - - - - - - """) - } + testCases << result +} - html.append(""" -
StatusClass NameTest NameDuration (s)
${result.status}${result.classname} - ${result.name} - ${result.time}
- -

Skipped Tests

- - - - - - - """) - - testCases.findAll { it.status == 'Skipped' }.each { result -> - html.append(""" - - - - - - """) - } +// Generate HTML report +def html = new StringBuilder() +html.append(""" + + + + + +

Test Results

+
+
Total Tests: ${testCases.size()}
+
Total Passed: ${testCases.count { it.status == 'Passed' }}
+
Total Failed: ${testCases.count { it.status == 'Failed' }}
+
Total Skipped: ${testCases.count { it.status == 'Skipped' }}
+
+ +

Failed Tests

+
StatusClass NameTest Name
${result.status}${result.classname}${result.name}
+ + + + + + +""") + +testCases.findAll { it.status == 'Failed' }.each { result -> + html.append(""" + + + + + + + """) +} - html.append(""" -
StatusClass NameTest NameDuration (s)
${result.status}${result.classname} + ${result.name} + ${result.time}
- -

Passed Tests

- - - - - - - - """) - - testCases.findAll { it.status == 'Passed' }.each { result -> - html.append(""" - - - - - - - """) - } +html.append(""" +
StatusClass NameTest NameDuration (s)
${result.status}${result.classname}${result.name}${result.time}
+ +

Skipped Tests

+ + + + + + + +""") + +testCases.findAll { it.status == 'Skipped' }.each { result -> + html.append(""" + + + + + + + """) +} - html.append(""" -
StatusClass NameTest NameReason
${result.status}${result.classname}${result.name}${result.reason}
- -

Test Details

- """) - - testCases.findAll { it.status == 'Failed' }.each { result -> - html.append(""" -
-
-

${result.classname}.${result.name}

-

Status: ${result.status}

-

Duration: ${result.time}s

-
- ${result.log} -
-
-
- """) - } +html.append(""" + + +

Passed Tests

+ + + + + + +""") + +testCases.findAll { it.status == 'Passed' }.each { result -> + html.append(""" + + + + + + + """) +} + +html.append(""" +
StatusClass NameTest NameDuration (s)
${result.status}${result.classname}${result.name}${result.time}
+ +

Test Details

+""") + +testCases.findAll { it.status == 'Failed' }.each { result -> + html.append(""" +
+
+

${result.classname}.${result.name}

+

Status: ${result.status}

+

Duration: ${result.time}s

+
+ ${result.log} +
+
+
+ """) +} - html.append(""" - - - """) +html.append(""" + + +""") - // Save the HTML report to a file - writeFile file: 'test-report.html', text: html.toString() +// Save the HTML report to a file +writeFile file: 'test-report.html', text: html.toString() - // Optionally, print the location of the HTML report + + // Optionally, print the location of the HTML report echo "HTML report generated: \${env.WORKSPACE}/test-report.html" - } +} archiveArtifacts artifacts: 'coverageReport.html,test-report.html,test-results.xml', allowEmptyArchive: true } } } } - def extractReason(String log) { - // Extract reason from the log +// Function to extract reason from the log for failed tests +def extractReason(String log) { def reason = "" - def reasonPattern = /message="([^"]*)">/ + // Extract the relevant part of the failed message + def reasonPattern = /_genesyscloud_.*?\.go:\d+: (.*?) ---/ def matcher = log =~ reasonPattern if (matcher.find()) { reason = matcher.group(1).trim() } return reason -} - - - +} \ No newline at end of file