Skip to content

Commit

Permalink
Merging dev to main for v1.38.0 (MyPureCloud#1036)
Browse files Browse the repository at this point in the history
* Bump golang.org/x/net from 0.22.0 to 0.23.0 (MyPureCloud#951)

Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0.
- [Commits](golang/net@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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add team to custom resolver (MyPureCloud#950)

* Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (MyPureCloud#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 (MyPureCloud#956)

* Fix User Resource Panics (MyPureCloud#949)

* moving changes (MyPureCloud#964)

* Reverting conditional group routing resoure (MyPureCloud#965)

* Remove use_supported_content_profile (MyPureCloud#962)

* bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (MyPureCloud#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 (MyPureCloud#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… (MyPureCloud#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 (MyPureCloud#966)

* feat/Devtooling-448 oauth cred cache (MyPureCloud#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 (MyPureCloud#967)

* feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (MyPureCloud#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 (MyPureCloud#961)

* feat/Devtooling-531: Add proxy and cache to routing queue (MyPureCloud#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 (MyPureCloud#968)

* Added refactor label to pr-labeler-config

* Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (MyPureCloud#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  (MyPureCloud#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 (MyPureCloud#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 (MyPureCloud#973)

* Feature/devtooling 63 (MyPureCloud#974)

* Introduce new Elements

* Update Attribs

* Introduce scoring Method

* Upgrade ssdk

* remove unwanted logs

* Feature/devtooling 63 (MyPureCloud#978)

* Fix exports

* Feat/add flow log level resource (MyPureCloud#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 <[email protected]>

* NO-JIRA: Small Change to flow log level (MyPureCloud#984)

* Small Change to flow log level

* Fixing typo

* Merge hotfix changes on main into dev (MyPureCloud#983)

* moving changes (MyPureCloud#960)

* Revert "moving changes (MyPureCloud#960)" (MyPureCloud#963)

This reverts commit 70d8a80.

* Release Merge to Main (MyPureCloud#977)

* Bump golang.org/x/net from 0.22.0 to 0.23.0 (MyPureCloud#951)

Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0.
- [Commits](golang/net@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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add team to custom resolver (MyPureCloud#950)

* Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (MyPureCloud#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 (MyPureCloud#956)

* Fix User Resource Panics (MyPureCloud#949)

* moving changes (MyPureCloud#964)

* Reverting conditional group routing resoure (MyPureCloud#965)

* Remove use_supported_content_profile (MyPureCloud#962)

* bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (MyPureCloud#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 (MyPureCloud#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… (MyPureCloud#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 (MyPureCloud#966)

* feat/Devtooling-448 oauth cred cache (MyPureCloud#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 (MyPureCloud#967)

* feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (MyPureCloud#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 (MyPureCloud#961)

* feat/Devtooling-531: Add proxy and cache to routing queue (MyPureCloud#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 (MyPureCloud#968)

* Added refactor label to pr-labeler-config

* Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (MyPureCloud#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  (MyPureCloud#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 (MyPureCloud#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 (MyPureCloud#973)

* Feature/devtooling 63 (MyPureCloud#974)

* Introduce new Elements

* Update Attribs

* Introduce scoring Method

* Upgrade ssdk

* remove unwanted logs

* Feature/devtooling 63 (MyPureCloud#978)

* Fix exports

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dginty4 <[email protected]>
Co-authored-by: Charlie Conneely <[email protected]>
Co-authored-by: kavinbalagen <[email protected]>
Co-authored-by: Brian Moyles <[email protected]>
Co-authored-by: carnellj-genesys <[email protected]>
Co-authored-by: BrianMoyles <[email protected]>

* Fix Exporter for non-flow resources (MyPureCloud#982)

* Fix Exporter for non-flow resources

* Added check (MyPureCloud#981)

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: kavinbalagen <[email protected]>
Co-authored-by: HemanthDogiparthi12 <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dginty4 <[email protected]>
Co-authored-by: Brian Moyles <[email protected]>
Co-authored-by: carnellj-genesys <[email protected]>
Co-authored-by: BrianMoyles <[email protected]>

* Bump github.com/hashicorp/terraform-plugin-docs from 0.18.0 to 0.19.1 (MyPureCloud#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](hashicorp/terraform-plugin-docs@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] <[email protected]>

* rerunning go generate after tf-docs package upgrade

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Charlie Conneely <[email protected]>

* Devtooling 432: Conditonal Group Routing (MyPureCloud#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 (MyPureCloud#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 (MyPureCloud#991)

* No jira: util function for getting cursor value from next uri  (MyPureCloud#990)

* moving changes (MyPureCloud#960)

* Revert "moving changes (MyPureCloud#960)" (MyPureCloud#963)

This reverts commit 70d8a80.

* Release Merge to Main (MyPureCloud#977)

* Bump golang.org/x/net from 0.22.0 to 0.23.0 (MyPureCloud#951)

Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0.
- [Commits](golang/net@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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add team to custom resolver (MyPureCloud#950)

* Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (MyPureCloud#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 (MyPureCloud#956)

* Fix User Resource Panics (MyPureCloud#949)

* moving changes (MyPureCloud#964)

* Reverting conditional group routing resoure (MyPureCloud#965)

* Remove use_supported_content_profile (MyPureCloud#962)

* bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (MyPureCloud#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 (MyPureCloud#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… (MyPureCloud#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 (MyPureCloud#966)

* feat/Devtooling-448 oauth cred cache (MyPureCloud#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 (MyPureCloud#967)

* feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (MyPureCloud#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 (MyPureCloud#961)

* feat/Devtooling-531: Add proxy and cache to routing queue (MyPureCloud#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 (MyPureCloud#968)

* Added refactor label to pr-labeler-config

* Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (MyPureCloud#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  (MyPureCloud#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 (MyPureCloud#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 (MyPureCloud#973)

* Feature/devtooling 63 (MyPureCloud#974)

* Introduce new Elements

* Update Attribs

* Introduce scoring Method

* Upgrade ssdk

* remove unwanted logs

* Feature/devtooling 63 (MyPureCloud#978)

* Fix exports

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dginty4 <[email protected]>
Co-authored-by: Charlie Conneely <[email protected]>
Co-authored-by: kavinbalagen <[email protected]>
Co-authored-by: Brian Moyles <[email protected]>
Co-authored-by: carnellj-genesys <[email protected]>
Co-authored-by: BrianMoyles <[email protected]>

* Fix Exporter for non-flow resources (MyPureCloud#982)

* Fix Exporter for non-flow resources

* Added check (MyPureCloud#981)

* Made function for parsing cursor from next uri

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: kavinbalagen <[email protected]>
Co-authored-by: HemanthDogiparthi12 <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dginty4 <[email protected]>
Co-authored-by: Brian Moyles <[email protected]>
Co-authored-by: carnellj-genesys <[email protected]>
Co-authored-by: BrianMoyles <[email protected]>

* Fix acceptance tests (MyPureCloud#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 <[email protected]>

* Bump hashicorp/setup-terraform from 3.0.0 to 3.1.0 (MyPureCloud#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](hashicorp/setup-terraform@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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Improvise exclude attributes to Regex (MyPureCloud#988)

* Fix Media call back Read Attributes (MyPureCloud#987)

* DEVTOOLING-445: User Roles not returning duplicate roles (MyPureCloud#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 (MyPureCloud#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 (MyPureCloud#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 <[email protected]>

* bug/devtooling-498: [CX as Code] genesyscloud_outbound_settings export contains only null data (MyPureCloud#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 (MyPureCloud#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 <[email protected]>

* NO-JIRA: Fixing dev (MyPureCloud#1000)

* Fixing dev

* Fixes some errors

* Fixing flow outcome description (MyPureCloud#998)

* Devtooling 561 - Members not being added correctly to teams (MyPureCloud#1001)

* Fixed bug

* Fixed problem deleting members

* Removed print

* Fix Version Problem in WebDeployments (MyPureCloud#997)

* Fix Version Problem in WebDeployments

* Add test cases

* Fix review comments

* no jira: Fixing merge conflicts on dev branch  (MyPureCloud#1009)

* moving changes (MyPureCloud#960)

* Revert "moving changes (MyPureCloud#960)" (MyPureCloud#963)

This reverts commit 70d8a80.

* Release Merge to Main (MyPureCloud#977)

* Bump golang.org/x/net from 0.22.0 to 0.23.0 (MyPureCloud#951)

Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0.
- [Commits](golang/net@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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add team to custom resolver (MyPureCloud#950)

* Devtooling 432: Refactor Conditional Group Routing Rules into its own resource (MyPureCloud#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 (MyPureCloud#956)

* Fix User Resource Panics (MyPureCloud#949)

* moving changes (MyPureCloud#964)

* Reverting conditional group routing resoure (MyPureCloud#965)

* Remove use_supported_content_profile (MyPureCloud#962)

* bug/ DEVTOOLING-516: Allow Multiple inputs for BYMONTHDAY and BYMONTH (MyPureCloud#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 (MyPureCloud#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… (MyPureCloud#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 (MyPureCloud#966)

* feat/Devtooling-448 oauth cred cache (MyPureCloud#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 (MyPureCloud#967)

* feat/Devtooling-459: Added BuildAPIDiagnosticError function calls (MyPureCloud#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 (MyPureCloud#961)

* feat/Devtooling-531: Add proxy and cache to routing queue (MyPureCloud#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 (MyPureCloud#968)

* Added refactor label to pr-labeler-config

* Feat/devtooling-499: Added getAll Functionality to ResponseManagement_ResponseAsset (MyPureCloud#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  (MyPureCloud#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 (MyPureCloud#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 (MyPureCloud#973)

* Feature/devtooling 63 (MyPureCloud#974)

* Introduce new Elements

* Update Attribs

* Introduce scoring Method

* Upgrade ssdk

* remove unwanted logs

* Feature/devtooling 63 (MyPureCloud#978)

* Fix exports

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dginty4 <[email protected]>
Co-authored-by: Charlie Conneely <[email protected]>
Co-authored-by: kavinbalagen <[email protected]>
Co-authored-by: Brian Moyles <[email protected]>
Co-authored-by: carnellj-genesys <[email protected]>
Co-authored-by: BrianMoyles <[email protected]>

* Fix Exporter for non-flow resources (MyPureCloud#982)

* Fix Exporter for non-flow resources

* Added check (MyPureCloud#981)

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: kavinbalagen <[email protected]>
Co-authored-by: HemanthDogiparthi12 <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dginty4 <[email protected]>
Co-authored-by: Brian Moyles <[email protected]>
Co-authored-by: carnellj-genesys <[email protected]>
Co-authored-by: BrianMoyles <[email protected]>

* Bump github.com/hashicorp/terraform-plugin-docs from 0.19.1 to 0.19.2 (MyPureCloud#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](hashicorp/terraform-plugin-docs@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] <[email protected]>

* ran go generate

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Charlie Conneely <[email protected]>

* DEVTOOLING-352 - provider oauth credential rate limit exceeded (MyPureCloud#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 (MyPureCloud#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 (MyPureCloud#1017)

Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.25.0.
- [Commits](golang/net@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] <[email protected]>
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 (MyPureCloud#1013)

* Changed message_column to optional and add verification logic

* applied safer nil value handling

* go generate (MyPureCloud#1018)

* bug/devtooling 560 - Nil error in telephony_providers_edges_phone (MyPureCloud#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…" (MyPureCloud#1019)

This reverts commit 3ff66d4.

* bug/devtooling 560 - CX as Code crash when creating phones (MyPureCloud#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 (MyPureCloud#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 (MyPureCloud#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](hashicorp/setup-terraform@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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* bug/devtooling 362 - Evaluation forms incorrectly assigning published attribute (MyPureCloud#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 (MyPureCloud#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 (MyPureCloud#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](nyaruka/phonenumbers@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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Devtooling-162: Refactored idp salesforce (MyPureCloud#999)

* Refactored idp salesforce

* Fixing docs

* Changed function name

* Removed original file

* Changed Build Function Call to fix type difference (MyPureCloud#1029)

* fixing test for published attribute (MyPureCloud#1030)

* No jira: fixing up a few acceptance tests (MyPureCloud#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 (MyPureCloud#1028)

* README update (MyPureCloud#1025)

* Pre-verify if the tfState is in sync with the exporter (MyPureCloud#1027)

* Add state comapartors

* Upddate review comments

* Devtooling-591: Consistency Checker Refactor (MyPureCloud#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 (MyPureCloud#1035)

* update doc

* fix reviews

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: HemanthDogiparthi12 <[email protected]>
Co-authored-by: dginty4 <[email protected]>
Co-authored-by: kavinbalagen <[email protected]>
Co-authored-by: Brian Moyles <[email protected]>
Co-authored-by: carnellj-genesys <[email protected]>
Co-authored-by: BrianMoyles <[email protected]>
Co-authored-by: ben-howarth-genesys <[email protected]>
Co-authored-by: monishapadmavathi <[email protected]>
Co-authored-by: Monisha Padmavathi Ragavan <[email protected]>
Co-authored-by: jenissabarrera <[email protected]>
Co-authored-by: Taisuk Choi <[email protected]>
  • Loading branch information
13 people authored May 14, 2024
1 parent 61ea737 commit d5a0620
Show file tree
Hide file tree
Showing 256 changed files with 3,003 additions and 1,581 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
id: go

- name: Setup Terraform CLI
uses: hashicorp/[email protected].0
uses: hashicorp/[email protected].1
with:
terraform_wrapper: false
terraform_version: ${{ matrix.terraform }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
id: go

- name: Setup Terraform CLI
uses: hashicorp/[email protected].0
uses: hashicorp/[email protected].1
with:
terraform_version: ${{ matrix.terraform }}

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ The example above will attempt to find a role named "employee" which can be refe

If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (see [Requirements](#requirements) above).

**Please branch off of the latest version of dev and be sure to set dev as the target branch of your pull request.**

To compile the provider, run `go install`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.

In order to run the full suite of Acceptance tests, run `make testacc`. You can also specify individual tests using the TESTARGS variable:
Expand Down
7 changes: 6 additions & 1 deletion docs/guides/export.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,9 @@ resource "genesyscloud_tf_export" "export" {

In its standard setup, this Terraform configuration exports only the dependencies explicitly defined in your configuration. However, by enabling `enable_dependency_resolution`, Terraform can automatically export additional dependencies, including static ones associated with an architecture flow. This feature enhances the comprehensiveness of your exports, ensuring that not just the primary resource, but also its related entities, are included.

On the other hand, Terraform also provides the `exclude_attributes` option for instances where certain fields need to be omitted from an export. This, along with the ability to automatically export additional dependencies, contributes to Terraform’s flexible framework for managing resource exports. It allows for granular control over the inclusion or exclusion of elements in the export, ensuring that your exported configuration aligns precisely with your requirements.
On the other hand, Terraform also provides the `exclude_attributes` option for instances where certain fields need to be omitted from an export. This, along with the ability to automatically export additional dependencies, contributes to Terraform’s flexible framework for managing resource exports. It allows for granular control over the inclusion or exclusion of elements in the export, ensuring that your exported configuration aligns precisely with your requirements.

## Export State File Comparison:

In its standard setup, during a full org download, the exporter doesnt verify if the exported state file is in sync with the exported configuration.
This is an experimental feature enabled just for troubleshooting. To enable this,set env value of ENABLE_EXPORTER_STATE_COMPARISON to true.
4 changes: 2 additions & 2 deletions docs/resources/outbound_messagingcampaign.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ resource "genesyscloud_outbound_messagingcampaign" "example_outbound_messagingca

Required:

- `message_column` (String) The Contact List column specifying the message to send to the contact.
- `phone_column` (String) The Contact List column specifying the phone number to send a message to.
- `sender_sms_phone_number` (String) A phone number provisioned for SMS communications in E.164 format. E.g. +13175555555 or +34234234234

Optional:

- `content_template_id` (String) The content template used to formulate the message to send to the contact.
- `content_template_id` (String) The content template used to formulate the message to send to the contact. Either message_column or content_template_id is required.
- `message_column` (String) The Contact List column specifying the message to send to the contact. Either message_column or content_template_id is required.


<a id="nestedblock--contact_sorts"></a>
Expand Down
8 changes: 4 additions & 4 deletions docs/resources/webdeployments_deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ resource "genesyscloud_webdeployments_deployment" "exampleDeployment" {
<a id="nestedblock--configuration"></a>
### Nested Schema for `configuration`

Optional:
Required:

- `version` (String)
- `id` (String)

Read-Only:
Optional:

- `id` (String) The ID of this resource.
- `version` (String)

Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ func DataSourceArchitectDatatableRead(ctx context.Context, d *schema.ResourceDat
const pageSize = 100
datatables, resp, getErr := archAPI.GetFlowsDatatables("", pageNum, pageSize, "", "", nil, name)
if getErr != nil {
return retry.NonRetryableError(fmt.Errorf("Error requesting architect architect_datatable %s: %s %v", name, getErr, resp))
return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Error requesting architect architect_datatable %s | error: %s", name, getErr), resp))
}

if datatables.Entities == nil || len(*datatables.Entities) == 0 {
return retry.RetryableError(fmt.Errorf("No architect architect_datatable found with name %s", name))
return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("No architect architect_datatable found with name %s", name), resp))
}

datatable := (*datatables.Entities)[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"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"
Expand Down Expand Up @@ -102,18 +103,19 @@ func createArchitectDatatable(ctx context.Context, d *schema.ResourceData, meta
func readArchitectDatatable(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
sdkConfig := meta.(*provider.ProviderMeta).ClientConfig
archProxy := getArchitectDatatableProxy(sdkConfig)
cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceArchitectDatatable(), constants.DefaultConsistencyChecks, resourceName)

log.Printf("Reading architect_datatable %s", d.Id())

return util.WithRetriesForRead(ctx, d, func() *retry.RetryError {
datatable, resp, getErr := archProxy.getArchitectDatatable(ctx, d.Id(), "schema")
if getErr != nil {
if util.IsStatus404(resp) {
return retry.RetryableError(fmt.Errorf("Failed to read architect_datatable %s: %s", d.Id(), getErr))
return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read architect_datatable %s | error: %s", d.Id(), getErr), resp))
}
return retry.NonRetryableError(fmt.Errorf("Failed to read architect_datatable %s: %s", d.Id(), getErr))
return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read architect_datatable %s | error: %s", d.Id(), getErr), resp))
}
cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceArchitectDatatable())

_ = d.Set("name", *datatable.Name)
_ = d.Set("division_id", *datatable.Division.Id)

Expand All @@ -131,7 +133,7 @@ func readArchitectDatatable(ctx context.Context, d *schema.ResourceData, meta in

log.Printf("Read architect_datatable %s %s", d.Id(), *datatable.Name)

return cc.CheckState()
return cc.CheckState(d)
})
}

Expand Down Expand Up @@ -195,8 +197,8 @@ func deleteArchitectDatatable(ctx context.Context, d *schema.ResourceData, meta
log.Printf("Deleted architect_datatable row %s", name)
return nil
}
return retry.NonRetryableError(fmt.Errorf("Error deleting architect_datatable row %s: %s", name, err))
return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Error deleting architect_datatable row %s | error: %s", name, err), resp))
}
return retry.RetryableError(fmt.Errorf("Datatable row %s still exists", name))
return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Datatable row %s still exists", name), resp))
})
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package architect_datatable

import (
"fmt"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"sort"
Expand Down Expand Up @@ -72,7 +73,7 @@ func buildSdkDatatableProperties(d *schema.ResourceData) (*map[string]Datatablep
case "number":
defaultVal, err = strconv.ParseFloat(def, 64)
default:
return nil, diag.Errorf("Invalid type %s for Datatable property %s", propType, propName)
return nil, util.BuildDiagnosticError(resourceName, fmt.Sprintf("Invalid type %s for Datatable property %s", propType, propName), fmt.Errorf("invalid type for Datatable property"))
}
if err != nil {
return nil, diag.FromErr(err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"strings"
"sync"
"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"
Expand All @@ -31,7 +32,7 @@ func buildSdkRowPropertyMap(propertiesJson string, keyStr string) (map[string]in
propMap := map[string]interface{}{}
if propertiesJson != "" {
if err := json.Unmarshal([]byte(propertiesJson), &propMap); err != nil {
return nil, diag.Errorf("Error parsing properties_json value %s: %v", propertiesJson, err)
return nil, util.BuildDiagnosticError(resourceName, fmt.Sprintf("Error parsing properties_json value %s", propertiesJson), err)
}
}
// Set the key value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"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"
Expand Down Expand Up @@ -102,24 +103,24 @@ func createArchitectDatatableRow(ctx context.Context, d *schema.ResourceData, me
func readArchitectDatatableRow(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
tableId, keyStr := splitDatatableRowId(d.Id())
if keyStr == "" {
return diag.Errorf("Invalid Row ID %s", d.Id())
return util.BuildDiagnosticError(resourceName, fmt.Sprintf("Invalid Row ID %s", d.Id()), fmt.Errorf("keyStr is nil"))
}

sdkConfig := meta.(*provider.ProviderMeta).ClientConfig
archProxy := getArchitectDatatableRowProxy(sdkConfig)
cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceArchitectDatatableRow(), constants.DefaultConsistencyChecks, resourceName)

log.Printf("Reading Datatable Row %s", d.Id())

return util.WithRetriesForRead(ctx, d, func() *retry.RetryError {
row, resp, getErr := archProxy.getArchitectDatatableRow(ctx, tableId, keyStr)
if getErr != nil {
if util.IsStatus404(resp) {
return retry.RetryableError(fmt.Errorf("Failed to read Datatable Row %s: %s", d.Id(), getErr))
return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read Datatable Row %s | error: %s", d.Id(), getErr), resp))
}
return retry.NonRetryableError(fmt.Errorf("Failed to read Datatable Row %s: %s", d.Id(), getErr))
return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read Datatable Row %s | error: %s", d.Id(), getErr), resp))
}

cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceArchitectDatatableRow())
d.Set("datatable_id", tableId)
d.Set("key_value", keyStr)

Expand All @@ -133,7 +134,7 @@ func readArchitectDatatableRow(ctx context.Context, d *schema.ResourceData, meta
d.Set("properties_json", string(valueBytes))

log.Printf("Read Datatable Row %s", d.Id())
return cc.CheckState()
return cc.CheckState(d)
})
}

Expand Down Expand Up @@ -164,7 +165,7 @@ func updateArchitectDatatableRow(ctx context.Context, d *schema.ResourceData, me
func deleteArchitectDatatableRow(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
tableId, keyStr := splitDatatableRowId(d.Id())
if keyStr == "" {
return diag.Errorf("Invalid Row ID %s", d.Id())
return util.BuildDiagnosticError(resourceName, fmt.Sprintf("Invalid Row ID %s", d.Id()), fmt.Errorf("keyStr is nil"))
}

sdkConfig := meta.(*provider.ProviderMeta).ClientConfig
Expand All @@ -189,8 +190,8 @@ func deleteArchitectDatatableRow(ctx context.Context, d *schema.ResourceData, me
log.Printf("Deleted architect_datatable row %s", d.Id())
return nil
}
return retry.NonRetryableError(fmt.Errorf("Error deleting architect_datatable row %s: %s", d.Id(), err))
return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Error deleting architect_datatable row %s | error: %s", d.Id(), err), resp))
}
return retry.RetryableError(fmt.Errorf("Datatable row %s still exists", d.Id()))
return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Datatable row %s still exists", d.Id()), resp))
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ func dataSourceEmergencyGroupRead(ctx context.Context, d *schema.ResourceData, m
return util.WithRetries(ctx, 15*time.Second, func() *retry.RetryError {
emergencyGroups, resp, getErr := ap.getArchitectEmergencyGroupIdByName(ctx, name)
if getErr != nil {
return retry.NonRetryableError(fmt.Errorf("Error requesting emergency group %s: %s %v", name, getErr, resp))
return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Error requesting emergency group %s | error: %s", name, getErr), resp))
}

if emergencyGroups.Entities == nil || len(*emergencyGroups.Entities) == 0 {
return retry.RetryableError(fmt.Errorf("No emergency groups found with name %s", name))
return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("No emergency groups found with name %s", name), resp))
}

emergencyGroup := (*emergencyGroups.Entities)[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"log"
"terraform-provider-genesyscloud/genesyscloud/provider"
"terraform-provider-genesyscloud/genesyscloud/util"
"terraform-provider-genesyscloud/genesyscloud/util/constants"
"terraform-provider-genesyscloud/genesyscloud/util/resourcedata"
"time"

Expand Down Expand Up @@ -77,19 +78,18 @@ func createEmergencyGroup(ctx context.Context, d *schema.ResourceData, meta inte
func readEmergencyGroup(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
sdkConfig := meta.(*provider.ProviderMeta).ClientConfig
ap := getArchitectEmergencyGroupProxy(sdkConfig)
cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceArchitectEmergencyGroup(), constants.DefaultConsistencyChecks, resourceName)

log.Printf("Reading emergency group %s", d.Id())
return util.WithRetriesForRead(ctx, d, func() *retry.RetryError {
emergencyGroup, resp, getErr := ap.getArchitectEmergencyGroup(ctx, d.Id())
if getErr != nil {
if util.IsStatus404(resp) {
return retry.RetryableError(fmt.Errorf("Failed to read emergency group %s: %s", d.Id(), getErr))
return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read emergency group %s | error: %s", d.Id(), getErr), resp))
}
return retry.NonRetryableError(fmt.Errorf("Failed to read emergency group %s: %s", d.Id(), getErr))
return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("Failed to read emergency group %s | error: %s", d.Id(), getErr), resp))
}

cc := consistency_checker.NewConsistencyCheck(ctx, d, meta, ResourceArchitectEmergencyGroup())

if emergencyGroup.State != nil && *emergencyGroup.State == "deleted" {
d.SetId("")
return nil
Expand All @@ -108,7 +108,7 @@ func readEmergencyGroup(ctx context.Context, d *schema.ResourceData, meta interf
}

log.Printf("Read emergency group %s %s", d.Id(), *emergencyGroup.Name)
return cc.CheckState()
return cc.CheckState(d)
})
}

Expand Down Expand Up @@ -171,7 +171,7 @@ func deleteEmergencyGroup(ctx context.Context, d *schema.ResourceData, meta inte
log.Printf("Deleted emergency group %s", d.Id())
return nil
}
return retry.NonRetryableError(fmt.Errorf("error deleting emergency group %s: %s", d.Id(), err))
return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("error deleting emergency group %s | error: %s", d.Id(), err), resp))
}

if emergencyGroup.State != nil && *emergencyGroup.State == "deleted" {
Expand All @@ -180,6 +180,6 @@ func deleteEmergencyGroup(ctx context.Context, d *schema.ResourceData, meta inte
return nil
}

return retry.RetryableError(fmt.Errorf("emergency group %s still exists", d.Id()))
return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("emergency group %s still exists", d.Id()), resp))
})
}
9 changes: 4 additions & 5 deletions genesyscloud/architect_flow/data_source_genesyscloud_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@ func dataSourceFlowRead(ctx context.Context, d *schema.ResourceData, m interface

// Query flow by name. Retry in case search has not yet indexed the flow.
return util.WithRetries(ctx, 5*time.Second, func() *retry.RetryError {
flows, _, getErr := p.GetAllFlows(ctx)
flows, resp, getErr := p.GetAllFlows(ctx)
if getErr != nil {
return retry.NonRetryableError(fmt.Errorf("error requesting flow %s: %s", name, getErr))
return retry.NonRetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("error requesting flow %s | error: %s", name, getErr), resp))
}


if flows == nil || len(*flows) == 0 {
return retry.RetryableError(fmt.Errorf("no flows found with name %s", name))
return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("no flows found with name %s", name), resp))
}

for _, entity := range *flows {
Expand All @@ -38,6 +37,6 @@ func dataSourceFlowRead(ctx context.Context, d *schema.ResourceData, m interface
}
}

return retry.RetryableError(fmt.Errorf("no flows found with name %s", name))
return retry.RetryableError(util.BuildWithRetriesApiDiagnosticError(resourceName, fmt.Sprintf("no flows found with name %s", name), resp))
})
}
Loading

0 comments on commit d5a0620

Please sign in to comment.