This pull request includes several changes in the internal/powerplatform package, primarily focusing on refining the handling of operations and responses in the REST API. The most significant changes include the creation of a new forceStringValueUnknownModifier function, modifications to the SendOperation method to return types.Object instead of *types.Object, and several changes to the DataverseWebApiResource methods to enhance the handling of operations and responses.
Changes related to forceStringValueUnknownModifier:
internal/powerplatform/modifiers/force_string_value_unknown_modifier.go: Created a new ForceStringValueUnknownModifier function that returns an instance of forceStringValueUnknownModifier. This function is used to ensure that file attribute and file checksum attribute are kept synchronised.
Changes related to SendOperation:
internal/powerplatform/services/rest/api_rest.go: Modified the SendOperation method to return types.Object instead of *types.Object. In case of an unexpected HTTP return code, it now returns types.ObjectUnknown instead of nil. [1][2][3]
Changes related to DataverseWebApiResource:
internal/powerplatform/services/rest/resource_rest.go: Made several changes to DataverseWebApiResource methods. These include making the output attribute optional and adding ForceStringValueUnknownModifier to its plan modifiers, modifying the Create method to handle Read operation after Create, and updating the Read, Update, and Delete methods to better handle operations and responses. Also, the NullOutputValue function now returns an empty JSON object instead of a null string. [1][2][3][4][5][6][7]
This pull request includes several changes in the
internal/powerplatform
package, primarily focusing on refining the handling of operations and responses in the REST API. The most significant changes include the creation of a newforceStringValueUnknownModifier
function, modifications to theSendOperation
method to returntypes.Object
instead of*types.Object
, and several changes to theDataverseWebApiResource
methods to enhance the handling of operations and responses.Changes related to
forceStringValueUnknownModifier
:internal/powerplatform/modifiers/force_string_value_unknown_modifier.go
: Created a newForceStringValueUnknownModifier
function that returns an instance offorceStringValueUnknownModifier
. This function is used to ensure that file attribute and file checksum attribute are kept synchronised.Changes related to
SendOperation
:internal/powerplatform/services/rest/api_rest.go
: Modified theSendOperation
method to returntypes.Object
instead of*types.Object
. In case of an unexpected HTTP return code, it now returnstypes.ObjectUnknown
instead ofnil
. [1] [2] [3]Changes related to
DataverseWebApiResource
:internal/powerplatform/services/rest/resource_rest.go
: Made several changes toDataverseWebApiResource
methods. These include making theoutput
attribute optional and addingForceStringValueUnknownModifier
to its plan modifiers, modifying theCreate
method to handleRead
operation afterCreate
, and updating theRead
,Update
, andDelete
methods to better handle operations and responses. Also, theNullOutputValue
function now returns an empty JSON object instead of a null string. [1] [2] [3] [4] [5] [6] [7]Other changes:
internal/powerplatform/services/rest/api_rest.go
: Added a newgetEnvironmentUrlById
function to retrieve the environment URL by its ID.internal/powerplatform/services/rest/datasource_rest_query.go
: Removed the pointer dereference from the assignment ofstate.Output
tooutputObjectType
.