[#97] object: Refactor Patch related structs

* Add getters and setters for related types;
* Fix unit-tests.

Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
Airat Arifullin 2024-07-30 17:49:45 +03:00
parent 8ce8cd6ec2
commit 8609f29a60
4 changed files with 111 additions and 39 deletions

View file

@ -706,10 +706,10 @@ func GeneratePatchRequestBody(empty bool) *object.PatchRequestBody {
m := new(object.PatchRequestBody)
if !empty {
m.Address = refstest.GenerateAddress(empty)
m.NewAttributes = GenerateAttributes(empty)
m.ReplaceAttributes = false
m.Patch = GeneratePatchRequestBodyPatch(empty)
m.SetAddress(refstest.GenerateAddress(empty))
m.SetNewAttributes(GenerateAttributes(empty))
m.SetReplaceAttributes(false)
m.SetPatch(GeneratePatchRequestBodyPatch(empty))
}
return m
@ -719,7 +719,7 @@ func GeneratePatchRequest(empty bool) *object.PatchRequest {
m := new(object.PatchRequest)
if !empty {
m.Body = GeneratePatchRequestBody(empty)
m.SetBody(GeneratePatchRequestBody(empty))
}
m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty))