def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
local_buffer = utils.BytearrayStream()<EOL>if self._maximum_items:<EOL><INDENT>self._maximum_items.write(local_buffer, kmip_version=kmip_version)<EOL><DEDENT>if self._offset_items:<EOL><INDENT>self._offset_items.write(local_buffer, kmip_version=kmip_version)<EOL><DEDENT>if self._storage_status_mask:<EOL><INDENT>self._storage_status_mask.write(<EOL>local_buffer,<EOL>kmip_version=kmip_version<EOL>)<EOL><DEDENT>if self._object_group_member:<EOL><INDENT>self._object_group_member.write(<EOL>local_buffer,<EOL>kmip_version=kmip_version<EOL>)<EOL><DEDENT>if kmip_version < enums.KMIPVersion.KMIP_2_0:<EOL><INDENT>if self._attributes:<EOL><INDENT>for attribute in self.attributes:<EOL><INDENT>attribute.write(<EOL>local_buffer,<EOL>kmip_version=kmip_version<EOL>)<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>if self._attributes:<EOL><INDENT>template_attribute = objects.TemplateAttribute(<EOL>attributes=self.attributes<EOL>)<EOL>attributes = objects.convert_template_attribute_to_attributes(<EOL>template_attribute<EOL>)<EOL>attributes.write(local_buffer, kmip_version=kmip_version)<EOL><DEDENT>else:<EOL><INDENT>raise exceptions.InvalidField(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT><DEDENT>self.length = local_buffer.length()<EOL>super(LocateRequestPayload, self).write(<EOL>output_buffer,<EOL>kmip_version=kmip_version<EOL>)<EOL>output_buffer.write(local_buffer.buffer)<EOL>
Write the data encoding the Locate request payload to a buffer.

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