kmip/core/objects.py
def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
        """
        Write the data encoding the DeviceCredential struct 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.
        """
        local_stream = BytearrayStream()

        if self._device_serial_number is not None:
            self._device_serial_number.write(
                local_stream,
                kmip_version=kmip_version
            )
        if self._password is not None:
            self._password.write(
                local_stream,
                kmip_version=kmip_version
            )
        if self._device_identifier is not None:
            self._device_identifier.write(
                local_stream,
                kmip_version=kmip_version
            )
        if self._network_identifier is not None:
            self._network_identifier.write(
                local_stream,
                kmip_version=kmip_version)
        if self._machine_identifier is not None:
            self._machine_identifier.write(
                local_stream,
                kmip_version=kmip_version
            )
        if self._media_identifier is not None:
            self._media_identifier.write(
                local_stream,
                kmip_version=kmip_version
            )

        self.length = local_stream.length()
        super(DeviceCredential, 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 = BytearrayStream()

        if self._device_serial_number is not None:
            self._device_serial_number.write(
                local_stream,
                kmip_version=kmip_version
            )
        if self._password is not None:
            self._password.write(
                local_stream,
                kmip_version=kmip_version
            )
        if self._device_identifier is not None:
            self._device_identifier.write(
                local_stream,
                kmip_version=kmip_version
            )
        if self._network_identifier is not None:
            self._network_identifier.write(
                local_stream,
                kmip_version=kmip_version)
        if self._machine_identifier is not None:
            self._machine_identifier.write(
                local_stream,
                kmip_version=kmip_version
            )
        if self._media_identifier is not None:
            self._media_identifier.write(
                local_stream,
                kmip_version=kmip_version
            )

        self.length = local_stream.length()
        super(DeviceCredential, 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 = BytearrayStream ( ) if self . _device_serial_number is not None : self . _device_serial_number . write ( local_stream , kmip_version = kmip_version ) if self . _password is not None : self . _password . write ( local_stream , kmip_version = kmip_version ) if self . _device_identifier is not None : self . _device_identifier . write ( local_stream , kmip_version = kmip_version ) if self . _network_identifier is not None : self . _network_identifier . write ( local_stream , kmip_version = kmip_version ) if self . _machine_identifier is not None : self . _machine_identifier . write ( local_stream , kmip_version = kmip_version ) if self . _media_identifier is not None : self . _media_identifier . write ( local_stream , kmip_version = kmip_version ) self . length = local_stream . length ( ) super ( DeviceCredential , self ) . write ( output_stream , kmip_version = kmip_version ) output_stream . write ( local_stream . buffer )
Write the data encoding the DeviceCredential struct 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.
Write the data encoding the DeviceCredential struct to a stream .