def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_2_0):
if kmip_version < enums.KMIPVersion.KMIP_2_0:<EOL><INDENT>raise exceptions.VersionNotSupported(<EOL>"<STR_LIT>".format(<EOL>kmip_version.value<EOL>)<EOL>)<EOL><DEDENT>super(ObjectDefaults, self).read(<EOL>input_buffer,<EOL>kmip_version=kmip_version<EOL>)<EOL>local_buffer = utils.BytearrayStream(input_buffer.read(self.length))<EOL>if self.is_tag_next(enums.Tags.OBJECT_TYPE, local_buffer):<EOL><INDENT>self._object_type = primitives.Enumeration(<EOL>enums.ObjectType,<EOL>tag=enums.Tags.OBJECT_TYPE<EOL>)<EOL>self._object_type.read(local_buffer, kmip_version=kmip_version)<EOL><DEDENT>else:<EOL><INDENT>raise exceptions.InvalidKmipEncoding(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>if self.is_tag_next(enums.Tags.ATTRIBUTES, local_buffer):<EOL><INDENT>self._attributes = Attributes()<EOL>self._attributes.read(local_buffer, kmip_version=kmip_version)<EOL><DEDENT>else:<EOL><INDENT>raise exceptions.InvalidKmipEncoding(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>self.is_oversized(local_buffer)<EOL>
Read the data encoding the ObjectDefaults structure 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 2.0.

Raises:
    InvalidKmipEncoding: Raised if the object type or attributes are
        missing from the encoding.
    VersionNotSupported: Raised when a KMIP version is provided that
        does not support the ObjectDefaults structure.