def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
        """
        Write the data encoding the Get response payload to a stream.

        Args:
            output_stream (stream): A data stream in which to encode object
                data, supporting a write method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            ValueError: Raised if the object type, unique identifier, or
                secret attributes are missing from the payload struct.
        """
        local_stream = utils.BytearrayStream()

        if self.object_type:
            self._object_type.write(local_stream, kmip_version=kmip_version)
        else:
            raise ValueError("Payload is missing the object type field.")

        if self.unique_identifier:
            self._unique_identifier.write(
                local_stream,
                kmip_version=kmip_version
            )
        else:
            raise ValueError(
                "Payload is missing the unique identifier field."
            )

        if self.secret:
            self._secret.write(local_stream, kmip_version=kmip_version)
        else:
            raise ValueError("Payload is missing the secret field.")

        self.length = local_stream.length()
        super(GetResponsePayload, self).write(
            output_stream,
            kmip_version=kmip_version
        )
        output_stream.write(local_stream.buffer)
def write ( self , output_stream , kmip_version = enums . KMIPVersion . KMIP_1_0 ) : local_stream = utils . BytearrayStream ( ) if self . object_type : self . _object_type . write ( local_stream , kmip_version = kmip_version ) else : raise ValueError ( "Payload is missing the object type field." ) if self . unique_identifier : self . _unique_identifier . write ( local_stream , kmip_version = kmip_version ) else : raise ValueError ( "Payload is missing the unique identifier field." ) if self . secret : self . _secret . write ( local_stream , kmip_version = kmip_version ) else : raise ValueError ( "Payload is missing the secret field." ) self . length = local_stream . length ( ) super ( GetResponsePayload , self ) . write ( output_stream , kmip_version = kmip_version ) output_stream . write ( local_stream . buffer )
Write the data encoding the Get response payload to a stream.

        Args:
            output_stream (stream): A data stream in which to encode object
                data, supporting a write method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            ValueError: Raised if the object type, unique identifier, or
                secret attributes are missing from the payload struct.