Updates a media and returns it.

        :param str media_link:
            The link to the media.
        :param (file-like stream object) readable_stream:
        :param dict options:
            The request options for the request.

        :return:
            The updated Media.
        :rtype:
            str or file-like stream object

def UpdateMedia(self, media_link, readable_stream, options=None):
        """Updates a media and returns it.

        :param str media_link:
            The link to the media.
        :param (file-like stream object) readable_stream:
        :param dict options:
            The request options for the request.

        :return:
            The updated Media.
        :rtype:
            str or file-like stream object

        """
        if options is None:
            options = {}

        initial_headers = dict(self.default_headers)

        # Add required headers slug and content-type in case the body is a stream
        if options.get('slug'):
            initial_headers[http_constants.HttpHeaders.Slug] = options['slug']

        if options.get('contentType'):
            initial_headers[http_constants.HttpHeaders.ContentType] = (
                options['contentType'])
        else:
            initial_headers[http_constants.HttpHeaders.ContentType] = (
                runtime_constants.MediaTypes.OctetStream)

        path = base.GetPathFromLink(media_link)
        media_id = base.GetResourceIdOrFullNameFromLink(media_link)
        attachment_id = base.GetAttachmentIdFromMediaId(media_id)
        headers = base.GetHeaders(self,
                                  initial_headers,
                                  'put',
                                  path,
                                  attachment_id,
                                  'media',
                                  options)

        # UpdateMedia will use WriteEndpoint since it uses PUT operation
        request = request_object._RequestObject('media', documents._OperationType.Update)
        result, self.last_response_headers = self.__Put(path,
                                                        request,
                                                        readable_stream,
                                                        headers)
        
        self._UpdateSessionIfRequired(headers, result, self.last_response_headers)
        return result