kmip/core/messages/payloads/query.py
def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
        """
        Read the data encoding the QueryRequestPayload object and decode it
        into its constituent parts.

        Args:
            input_buffer (Stream): A data stream containing encoded object
                data, supporting a read method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            InvalidKmipEncoding: Raised if the query functions are missing
                from the encoded payload.
        """
        super(QueryRequestPayload, self).read(
            input_buffer,
            kmip_version=kmip_version
        )
        local_buffer = utils.BytearrayStream(input_buffer.read(self.length))

        query_functions = []
        while(self.is_tag_next(enums.Tags.QUERY_FUNCTION, local_buffer)):
            query_function = primitives.Enumeration(
                enums.QueryFunction,
                tag=enums.Tags.QUERY_FUNCTION
            )
            query_function.read(local_buffer, kmip_version=kmip_version)
            query_functions.append(query_function)

        if query_functions:
            self._query_functions = query_functions
        else:
            raise exceptions.InvalidKmipEncoding(
                "The Query request payload encoding is missing the query "
                "functions."
            )

        self.is_oversized(local_buffer)
def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
        """
        Read the data encoding the QueryRequestPayload object and decode it
        into its constituent parts.

        Args:
            input_buffer (Stream): A data stream containing encoded object
                data, supporting a read method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            InvalidKmipEncoding: Raised if the query functions are missing
                from the encoded payload.
        """
        super(QueryRequestPayload, self).read(
            input_buffer,
            kmip_version=kmip_version
        )
        local_buffer = utils.BytearrayStream(input_buffer.read(self.length))

        query_functions = []
        while(self.is_tag_next(enums.Tags.QUERY_FUNCTION, local_buffer)):
            query_function = primitives.Enumeration(
                enums.QueryFunction,
                tag=enums.Tags.QUERY_FUNCTION
            )
            query_function.read(local_buffer, kmip_version=kmip_version)
            query_functions.append(query_function)

        if query_functions:
            self._query_functions = query_functions
        else:
            raise exceptions.InvalidKmipEncoding(
                "The Query request payload encoding is missing the query "
                "functions."
            )

        self.is_oversized(local_buffer)
Read the data encoding the QueryRequestPayload object and decode it
        into its constituent parts.

        Args:
            input_buffer (Stream): A data stream containing encoded object
                data, supporting a read method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            InvalidKmipEncoding: Raised if the query functions are missing
                from the encoded payload.