2
0
mirror of https://github.com/openkmip/pykmip synced 2025-12-22 03:03:16 +00:00

Add payload base classes to prepare for simplifying the client

This change adds payload request and response base classes to
prepare for future simplification updates to the current client
architecture. No new tests are required for this change.
This commit is contained in:
Peter Hamilton
2019-11-12 17:03:13 -05:00
committed by Peter Hamilton
parent 676aaf5e72
commit 77d5b32ea4
30 changed files with 180 additions and 216 deletions

View File

@@ -17,9 +17,10 @@ from kmip.core import exceptions
from kmip.core import objects
from kmip.core import primitives
from kmip.core import utils
from kmip.core.messages.payloads import base
class GetAttributesRequestPayload(primitives.Struct):
class GetAttributesRequestPayload(base.RequestPayload):
"""
A request payload for the GetAttributes operation.
@@ -48,8 +49,7 @@ class GetAttributesRequestPayload(primitives.Struct):
attributes associated with the managed object. Optional,
defaults to None.
"""
super(GetAttributesRequestPayload, self).__init__(
enums.Tags.REQUEST_PAYLOAD)
super(GetAttributesRequestPayload, self).__init__()
self._unique_identifier = None
self._attribute_names = list()
@@ -272,7 +272,7 @@ class GetAttributesRequestPayload(primitives.Struct):
return NotImplemented
class GetAttributesResponsePayload(primitives.Struct):
class GetAttributesResponsePayload(base.ResponsePayload):
"""
A response payload for the GetAttributes operation.
@@ -297,8 +297,7 @@ class GetAttributesResponsePayload(primitives.Struct):
attributes (list): A list of attribute structures associated with
the managed object. Optional, defaults to None.
"""
super(GetAttributesResponsePayload, self).__init__(
enums.Tags.RESPONSE_PAYLOAD)
super(GetAttributesResponsePayload, self).__init__()
self._unique_identifier = None
self._attributes = list()