This pull request introduces changes to the PowerPlatform provider for Terraform. The changes primarily focus on the addition of REST query data sources, updates to the REST resource, and improvements to error handling.
internal/powerplatform/api/api_client.go: Enhanced the Execute method to handle different types of body content and to return more detailed error information. Introduced a new ExecuteForGivenScope method to allow execution of requests with a specified scope. [1][2]
docs/resources/data_record.md, examples/resources/powerplatform_data_record/resource.tf: Updated the data records example to use the environment ID from the powerplatform_environment resource instead of a hardcoded value. [1][2][3][4]
This pull request introduces changes to the PowerPlatform provider for Terraform. The changes primarily focus on the addition of REST query data sources, updates to the REST resource, and improvements to error handling.
Addition of REST query data sources:
docs/data-sources/rest_query.md
: Added documentation for the REST query data source. This data source fetches API requests.examples/data-sources/powerplatform_rest_query/data-source.tf
: Added an example of how to use the REST query data source.examples/data-sources/powerplatform_rest_query/output.tf
: Added an example output for the REST query data source.internal/powerplatform/datasource_rest_query_test.go
: Added unit and acceptance tests for the REST query data source.Updates to the REST resource:
docs/resources/rest.md
: Updated the documentation for the REST resource, which executes web API requests.examples/resources/powerplatform_rest/resource.tf
: Added an example of how to use the REST resource.examples/resources/powerplatform_rest/output.tf
: Added an example output for the REST resource.Improvements to error handling:
internal/powerplatform/api/api_client.go
: Enhanced theExecute
method to handle different types of body content and to return more detailed error information. Introduced a newExecuteForGivenScope
method to allow execution of requests with a specified scope. [1] [2]internal/powerplatform/helpers/error.go
: Improved error handling by introducing new error codes and enhancing theWrapIntoProviderError
function. [1] [2]Minor changes:
docs/resources/data_record.md
,examples/resources/powerplatform_data_record/resource.tf
: Updated the data records example to use the environment ID from thepowerplatform_environment
resource instead of a hardcoded value. [1] [2] [3] [4]