[#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

@ -356,17 +356,17 @@ type PatchRequestBodyPatch struct {
}
type PatchRequestBody struct {
Address *refs.Address
address *refs.Address
NewAttributes []Attribute
newAttributes []Attribute
ReplaceAttributes bool
replaceAttributes bool
Patch *PatchRequestBodyPatch
patch *PatchRequestBodyPatch
}
type PatchRequest struct {
Body *PatchRequestBody
body *PatchRequestBody
session.RequestHeaders
}
@ -1543,6 +1543,78 @@ func (r *PutSingleResponse) SetBody(v *PutSingleResponseBody) {
r.body = v
}
func (r *PatchRequest) GetBody() *PatchRequestBody {
if r != nil {
return r.body
}
return nil
}
func (r *PatchRequest) SetBody(v *PatchRequestBody) {
r.body = v
}
func (r *PatchRequestBody) GetAddress() *refs.Address {
if r != nil {
return r.address
}
return nil
}
func (r *PatchRequestBody) SetAddress(addr *refs.Address) {
r.address = addr
}
func (r *PatchRequestBody) GetNewAttributes() []Attribute {
if r != nil {
return r.newAttributes
}
return nil
}
func (r *PatchRequestBody) SetNewAttributes(attrs []Attribute) {
r.newAttributes = attrs
}
func (r *PatchRequestBody) GetReplaceAttributes() bool {
if r != nil {
return r.replaceAttributes
}
return false
}
func (r *PatchRequestBody) SetReplaceAttributes(replace bool) {
r.replaceAttributes = replace
}
func (r *PatchRequestBody) GetPatch() *PatchRequestBodyPatch {
if r != nil {
return r.patch
}
return nil
}
func (r *PatchRequestBody) SetPatch(patch *PatchRequestBodyPatch) {
r.patch = patch
}
func (r *PatchResponse) GetBody() *PatchResponseBody {
if r != nil {
return r.Body
}
return nil
}
func (r *PatchResponse) SetBody(v *PatchResponseBody) {
r.Body = v
}
func (s *ECInfo) getObjectPart() {}
func (s *ECInfo) getHeaderPart() {}