#NEWLINE# def webapi_deprecated( deprecated_in , force_error_http_status = None , default_api_format = None , encoders = [ ] ) : #NEWLINE# #INDENT# "Marks an API handler as deprecated.\n\n    ``deprecated_in`` specifies the version that first deprecates this call.\n\n    ``force_error_http_status`` forces errors to use the specified HTTP\n    status code.\n\n    ``default_api_format`` specifies the default api format (json or xml)\n    if one isn't provided.\n    " #NEWLINE# def _dec( view_func ) : #NEWLINE# #INDENT# def _view( * args , **kwargs ) : #NEWLINE# #INDENT# if default_api_format : #NEWLINE# #INDENT# request = args [ 0 ] #NEWLINE# assert isinstance ( request , HttpRequest ) #NEWLINE# method_args = getattr ( request , request . method , None ) #NEWLINE# if ( method_args and ( 'api_format' not in method_args ) ) : #NEWLINE# #INDENT# method_args = method_args . copy ( ) #NEWLINE# method_args [ 'api_format' ] = default_api_format #NEWLINE# setattr ( request , request . method , method_args ) #NEWLINE# #UNINDENT# #UNINDENT# response = view_func ( * args , ** kwargs ) #NEWLINE# if isinstance ( response , WebAPIResponse ) : #NEWLINE# #INDENT# response . encoders = encoders #NEWLINE# #UNINDENT# if isinstance ( response , WebAPIResponseError ) : #NEWLINE# #INDENT# response . api_data [ 'deprecated' ] = { #NEWLINE# #INDENT# 'in_version' : deprecated_in , #NEWLINE# #UNINDENT# } #NEWLINE# if ( force_error_http_status and isinstance ( response , WebAPIResponseError ) ) : #NEWLINE# #INDENT# response . status_code = force_error_http_status #NEWLINE# #UNINDENT# #UNINDENT# return response #NEWLINE# #UNINDENT# return _view #NEWLINE# #UNINDENT# return force_error_http_status