def _fix_up_media_upload(method_desc, root_desc, path_url, parameters):
 media_upload = method_desc.get('mediaUpload', {})
 accept = media_upload.get('accept', [])
 max_size = _media_size_to_long(media_upload.get('maxSize', ''))
 media_path_url = None
 if media_upload:
  media_path_url = _media_path_url_from_info(root_desc, path_url)
  parameters['media_body'] = MEDIA_BODY_PARAMETER_DEFAULT_VALUE.copy()
  parameters['media_mime_type'] = MEDIA_MIME_TYPE_PARAMETER_DEFAULT_VALUE.copy()
  if ('body' in parameters):
   parameters['body']['required'] = False
 return (accept, max_size, media_path_url)

def _fix_up_media_upload ( method_desc , root_desc , path_url , parameters ) : media_upload = method_desc . get ( 'mediaUpload' , { } ) accept = media_upload . get ( 'accept' , [ ] ) max_size = _media_size_to_long ( media_upload . get ( 'maxSize' , '' ) ) media_path_url = None if media_upload : media_path_url = _media_path_url_from_info ( root_desc , path_url ) parameters [ 'media_body' ] = MEDIA_BODY_PARAMETER_DEFAULT_VALUE . copy ( ) parameters [ 'media_mime_type' ] = MEDIA_MIME_TYPE_PARAMETER_DEFAULT_VALUE . copy ( ) if ( 'body' in parameters ) : parameters [ 'body' ] [ 'required' ] = False return ( accept , max_size , media_path_url )
adds media_body and media_mime_type parameters if supported by method .