2
0
mirror of https://github.com/openkmip/pykmip synced 2025-12-28 14:13:33 +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

@@ -18,9 +18,10 @@ import six
from kmip import enums
from kmip.core import primitives
from kmip.core import utils
from kmip.core.messages.payloads import base
class ArchiveRequestPayload(primitives.Struct):
class ArchiveRequestPayload(base.RequestPayload):
"""
A request payload for the Archive operation.
@@ -36,9 +37,7 @@ class ArchiveRequestPayload(primitives.Struct):
unique_identifier (string): The ID of the managed object (e.g.,
a public key) to archive. Optional, defaults to None.
"""
super(ArchiveRequestPayload, self).__init__(
enums.Tags.REQUEST_PAYLOAD
)
super(ArchiveRequestPayload, self).__init__()
self._unique_identifier = None
self.unique_identifier = unique_identifier
@@ -151,7 +150,7 @@ class ArchiveRequestPayload(primitives.Struct):
})
class ArchiveResponsePayload(primitives.Struct):
class ArchiveResponsePayload(base.ResponsePayload):
"""
A response payload for the Archive operation.
@@ -167,9 +166,7 @@ class ArchiveResponsePayload(primitives.Struct):
unique_identifier (string): The ID of the managed object (e.g.,
a public key) that was archived. Optional, defaults to None.
"""
super(ArchiveResponsePayload, self).__init__(
enums.Tags.RESPONSE_PAYLOAD
)
super(ArchiveResponsePayload, self).__init__()
self._unique_identifier = None
self.unique_identifier = unique_identifier