This pull request involves changes to the internal/powerplatform/services/data_record/api_data_record.go file, which is part of the data record service in the Power Platform. The changes mainly include updates to the ApplyDataRecord and DeleteDataRecord functions, and the applyRelations function. Additionally, new test data has been added to multiple JSON files in the internal/powerplatform/services/data_record/tests/resource/Validate_Create directory.
Here are the most significant changes:
Updates to api_data_record.go:
func (client *DataRecordClient) ApplyDataRecord(ctx context.Context, recordId, e: Changed the regex match from FindStringSubmatch to FindAllStringSubmatch to capture all matches instead of just the first one. Also, updated the result.Id assignment to use the last match instead of the first one.
func (client *DataRecordClient) ApplyDataRecord(ctx context.Context, recordId, e: Removed the call to parseLocationHeader function and the function itself, which was used to parse the location header from the API response. [1][2]
func applyRelations(ctx context.Context, client *DataRecordClient, relations map: Added error handling for the API execution in the applyRelations function.
This pull request involves changes to the
internal/powerplatform/services/data_record/api_data_record.go
file, which is part of the data record service in the Power Platform. The changes mainly include updates to theApplyDataRecord
andDeleteDataRecord
functions, and theapplyRelations
function. Additionally, new test data has been added to multiple JSON files in theinternal/powerplatform/services/data_record/tests/resource/Validate_Create
directory.Here are the most significant changes:
Updates to
api_data_record.go
:func (client *DataRecordClient) ApplyDataRecord(ctx context.Context, recordId, e
: Changed the regex match fromFindStringSubmatch
toFindAllStringSubmatch
to capture all matches instead of just the first one. Also, updated theresult.Id
assignment to use the last match instead of the first one.func (client *DataRecordClient) ApplyDataRecord(ctx context.Context, recordId, e
: Removed the call toparseLocationHeader
function and the function itself, which was used to parse the location header from the API response. [1] [2]func applyRelations(ctx context.Context, client *DataRecordClient, relations map
: Added error handling for the API execution in theapplyRelations
function.Additions to test data:
internal/powerplatform/services/data_record/tests/resource/Validate_Create/get_account_00000000-0000-0000-0000-000000000020.json
: Added a new test data file for account validation.internal/powerplatform/services/data_record/tests/resource/Validate_Create/get_account_00000000-0000-0000-0000-000000000020_contact_customer_accounts.json
: Added a new test data file for account contact customer accounts validation.internal/powerplatform/services/data_record/tests/resource/Validate_Create/get_account_00000000-0000-0000-0000-000000000020_ref.json
: Added a new test data file for account reference validation.internal/powerplatform/services/data_record/tests/resource/Validate_Create/get_contact_00000000-0000-0000-0000-000000000010.json
: Added a new test data file for contact validation. [Copilot is generating a summary...]