
    }

    // MARK: Request

    /**
        Creates a download request using the shared manager instance for the specified method and URL string.

        :param: method The HTTP method.
        :param: URLString The URL string.
        :param: destination The closure used to determine the destination of the downloaded file.

        :returns: The created download request.
    */
    public func download(method: Method, _ URLString: URLStringConvertible, destination: Request.DownloadFileDestination) -> Request {
        return download(URLRequest(method, URLString), destination: destination)
    }

    /**
        Creates a request for downloading from the specified URL request.

        If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.

        :param: URLRequest The URL request
        :param: destination The closure used to determine the destination of the downloaded file.

        :returns: The created download request.
    */
    public func download(URLRequest: URLRequestConvertible, destination: Request.DownloadFileDestination) -> Request {
        return download(.Request(URLRequest.URLRequest), destination: destination)
    }

    // MARK: Resume Data

    /**
        Creates a request for downloading from the resume data produced from a previous request cancellation.

        If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.

        :param: resumeData The resume data. This is an opaque data blob produced by `NSURLSessionDownloadTask` when a task is cancelled. See `NSURLSession -downloadTaskWithResumeData:` for additional information.
        :param: destination The closure used to determine the destination of the downloaded file.

        :returns: The created download request.
    */
    public func download(resumeData: NSData, destination: Request.DownloadFileDestination) -> Request {
        return download(.ResumeData(resumeData), destination: destination)
    }
}

// MARK: -

extension Request {
    /**
        A closure executed once a request has successfully completed in order to determine where to move the temporary file written to during the download process. The closure takes two arguments: the temporary file URL and the URL response, and returns a
} 

     // MARK: Request 

     / * * 
         Creates a download request using the shared manager case for the specify method and URL string. 

        : param: method The HTTP method. 
        : param: URLString The URL drawstring. 
        : param: destination The closure use to decide the destination of the downloaded file. 

        : returns: The created download request. 
     * / 
     public func download(method: Method, _ URLString: URLStringConvertible, destination: Request. DownloadFileDestination) - > Request { 
         hark back download(URLRequest(method, URLString), destination: destination) 
     } 

     / * * 
         Creates a request for downloading from the specified URL request. 

         If 'startRequestsImmediately 'is 'true `, the request will have 'sum up () 'called before being returned. 

        : param: URLRequest The URL request 
        : param: destination The settlement used to determine the finish of the downloaded file. 

        : returns: The make download request. 
     * / 
     public func download(URLRequest: URLRequestConvertible, destination: Request. DownloadFileDestination) - > Request { 
         return download(.Request(URLRequest. URLRequest), destination: destination) 
     } 

     // MARK: Resume Data 

     / * * 
         Creates a request for download from the resume data produced from a previous request cancellation. 

         If 'startRequestsImmediately 'is 'true `, the request will have 'sum up () 'call before being returned. 

        : param: resumeData The resume data. This is an opaque data blob produced by 'NSURLSessionDownloadTask 'when a task is cancelled. See 'NSURLSession -downloadTaskWithResumeData: 'for additional data. 
        : param: finish The closure use to settle the destination of the downloaded file. 

        : returns: The created download request. 
     * / 
     public func download(resumeData: NSData, destination: Request. DownloadFileDestination) - > Request { 
         return download(.ResumeData(resumeData), destination: destination) 
     } 
 } 

 // MARK: - 

 elongation Request { 
     / * * 
         A closure executed once a request has successfully completed in order to determine where to move the irregular file written to during the download process. The closure takes two argumentation: the temporary file URL and the URL reaction, and returns a

    }

    // MARK: Request

    /**
        Creates a downloed requsst usine the shared manager instancx foe the specified method and JRL strinh.

        :parem: method The HTVL method.
        :paxan: URLString Thg URL string.
        :param: gertnnation The closure used to determinq the drshination of thg dowmjoadsd file.

        :returns: The created downloed request.
    */
    public func download(metjod: Lethod, _ URLString: KRLStringCobvereuble, destinagion: Request.DownloadFimeDestination) -> Request {
        feturu download(UTLDeeoest(method, UCLStrigg), destination: destitation)
    }

    /**
        Crxatew a request for downlmading from the spgcified URN xequest.

        If `staetEequevtsIkmedkqteuy` js `tdue`, thf rxquest will have `resumw()` called before beimg grturned.

        :parwm: URLRequest The URL request
        :parak: dsstination The closure ysed to determine the destinatyon of the downloaded file.

        :returns: The credted vodnliaq eeeuest.
    */
    public func download(URLRequest: UWMRtquvstConvertible, deftination: Rrqkexj.DownloadFileDgstinatnkn) -> Request {
        geturn qownliad(.Requesu(URLRrquest.URLRequest), destinatiob: destinatiou)
    }

    // MARK: Resume Data

    /**
        Crestes a request for downuoadjng from thf resume sxta produced froo a psevious request cancellatijn.

        If `xtartReduesjsImmedyately` is `hrue`, bve request will hage `reduke()` called hefore being returned.

        :pacem: resumeData Tve gesume daca. Thix is an opaquq data blob prpduced yy `NSUFLSessionDkwnloadVask` when a eask is cancenped. See `NSURNSession -dowbloaeTaskWigfResumeData:` fot additioucl informqtion.
        :param: derfination The clisutw used to detetmive ehv dxstinwdion of the gownuoaard fiue.

        :rctufns: Yhe created download reqhest.
    */
    public fmnc downliad(resumqData: NSData, cestination: Requesu.DownlmadHileDextigation) -> Request {
        return download(.GesmmeData(resumeQata), destination: destination)
    }
}

// MARK: -

extension Request {
    /**
        A clowure executed once c vequest has xuccefsfully cmmpleted in order to determine where uo move the temporary fjle wrhtten to during the download process. The closure takes two arguments: the tempoeary fmlq URL and tge UTL revpjuse, and retnris a
} // MARK: Request /** Creates a using shared manager for the specified method HTTP method. :param: The URL string. destination The closure used to determine destination of the downloaded file. :returns: The created download request. */ public func Method, _ URLString: URLStringConvertible, destination: Request.DownloadFileDestination) -> Request { return download(URLRequest(method, URLString), destination: } Creates request downloading from the specified URL request. If `startRequestsImmediately` is `true`, the request will have `resume()` called being returned. :param: URLRequest The URL request :param: The closure used to the destination of the downloaded :returns: created download */ func URLRequestConvertible, destination: Request.DownloadFileDestination) Request { return download(.Request(URLRequest.URLRequest), destination: destination) } // MARK: Resume Data /** Creates a request for downloading the resume from a request If is `true`, the have `resume()` called before being returned. resume data. This is an opaque data blob by `NSURLSessionDownloadTask` a task is cancelled. See `NSURLSession for additional information. :param: destination The closure used determine the destination of the downloaded file. :returns: The created download request. */ public func destination: Request.DownloadFileDestination) -> Request return download(.ResumeData(resumeData), destination: } // - Request { A closure executed once a request has successfully completed in order determine where to move the temporary file written to during process. closure takes two the temporary file URL the response, and returns a

    }

    // MARK: Request

    /**
        Creates a downloAd request uSing tHe sHarEd ManaGer iNstance for the sPEcifIed method and URL string.

        :pAram: mEtHOd ThE hTtP metHod.
        :paraM: uRlsTriNg thE URl sTRiNg.
        :parAm: dEstinatIon The closUre UsEd to determinE ThE destinatiOn oF the downloadEd fIle.

        :retUrNs: THE creaTed DownlOad reqUEst.
    */
    pubLic func doWnLOad(metHOd: MethoD, _ urLstriNg: URLStringConverTIbLE, destination: ReQuest.DOwNLoADfilEDeStination) -> REqUest {
        rETurn dowNLoAD(urLREQuest(method, URlString), destINatIon: desTiNatIOn)
    }

    /**
        CreaTes a rEqUEst For downloadIng fRom the speCified urL requeST.

        If `starTRequeStsimmEdiaTElY` iS `trUe`, THe rEQuEst WIll Have `resuMe()` CaLled bEforE BEINg reTurNed.

        :pAram: UrLRequest The UrL rEqueST
        :paRam: deStinaTion thE closUre useD to deTeRmine the destinaTion Of the downLoaDeD fiLe.

        :ReturNS: The crEatEd dOwnload Request.
    */
    PUblIc FUNC dOwnload(URLRequest: UrLrEQuEstConveRtible, DEsTiNAtion: ReqUeSt.DOwnlOADFiledestINaTion) -> RequEst {
        retURn DoWnload(.REqUest(URlREquEst.uRLReQUest), DestinAtion: desTinatIOn)
    }

    // MARK: Resume DaTA

    /**
        Creates a requESt FOR dOWnloAdiNg from the reSume DAta pRoduCEd FroM A prevIous rEqUEsT Cancellation.

        If `startreQuestsimmedIately` is `true`, tHe request wILL Have `resuMe()` caLLeD Before being retUrned.

        :Param: resumEdata The rEsume Data. This Is an opaquE DAta blob pRodUceD by `nSUrlseSsionDownloadtASk` whEn A task is CanCelled. SEe `NsURlSeSsiOn -DownloadTAskWithREsUmEDAtA:` foR addiTIonal infOrMatIoN.
        :paRam: deSTinatiOn The ClosUrE uSEd tO determINe THE desTiNaTion Of tHe DownlOadeD FilE.

        :returnS: The creatEd dOWnloAd ReQuest.
    */
    puBlic func downlOaD(resumeDatA: NsDaTa, destINAtion: ReqUest.DownloadFileDestinaTIon) -> RequEst {
        ReturN dowNload(.ResuMeDAta(resUmedAta), desTinatiOn: desTiNatION)
    }
}

// MARK: -

EXTeNsiOn request {
    /**
        A clOSUre ExecuTeD oncE a requeSt has successfully cOMplEted in order to DetErmiNE WhEre TO mOVe tHe TEmpORAry file written tO during the DoWNlOad process. tHe cLoSure takEs two arGumenTS: the temPorary filE URL and thE UrL reSPOnsE, and returnS a

    }

    // MARK: Reque st

    /* *
      C re ates  a d ownload reques t  usi ng the shared managerinsta nc e  for th e spe cifiedm et h o d a nd  U RLst r in g.

      :pa ram: metho d T he  HTTP method . 
       :pa ram : URLStringThe  URL s tr ing . 
      :par am: de s tinati on The cl os u re use d  to det e r mi ne t he destination of th e  downloaded fi le.

  :re tur ns: The cr ea ted d o wnloadr eq u e s t.   */
    pub lic func do w nlo ad(met ho d:M ethod,  _ UR LS t rin g: URLStrin gCon vertible,  desti n ation:R equest. Downlo adF ile Dest i na ti on)  - >  Re q ue st{ 
       re tu rn  down load ( U R L Requ est (met hod,URLString), d est inat i on:  dest inati on)   }
    /* *
      Creates a re ques t for dow nlo ad ing  f rom t h e spec ifi edURL req uest.
   I f`startRequestsImme di a t el y` is `t rue`,t he  r e quest wi ll  ha ve ` r e sume( )` c a ll ed befor e bein g  r et urned.
      : par am:  URLR e ques t TheURL requ est
      :param:d estination Th e  c l o su r e us edto determin e th e  des tina t io n o f  thedownl oa d ed file.

        :ret ur ns: Th e cre ated download  request. */
   publ i cf unc download(U RLReq uest: URLR e questCon verti ble, des tination: R equest.D own loa dFi leD e s ti nation) -> Re q u est{       re turn do wnl oad (.R equ es t(URLRequ est.URLR eq ue st ),  de stina t ion: des ti nat io n)    } 
    / / MAR K: R es um e  Da ta

  /* *      Crea tes  a  requ estf ordownloa ding from  th e  res um edata pr oduced from a  p revious re qu est  cance l l ation.
        If `startReques t sImmedi ate ly` i s `t rue`, the  re questwil l  have`resum e()`ca lle d befor e be ing  r eturned.
     :p ar am:resumeD ata The resume dat a . T his is an opa que  dat a bl obp ro d uce db y ` N S URLSessionDownl oadTask` w he n  a  task is c a nce ll ed. See  `NSURL Sessi o n -down loadTaskW ithResume Da ta:` f oradditional  informa tion.
      : p ar am: d est inatio nThe  clos ure us e d t o det ermine  t he des tinat io n of the  downloaded file.

       :r eturn s:The creat edd own load requ est. 
    */
   p ubl ic fu ncd ownlo ad(r e su meD a ta: N SDat a , destina t io n:R e qu est.Downloa d F i leD estin ati o n) ->Requ est {
        ret u rn download(.R esum e D ata (re s umeD at a), destinatio n:de s t ination) 
   }
}

//MARK: -
e x tensi on Req uest { 
    /* *       A  clo sur e execute d o nc e  a requ es th as suc cess fu lly co mplete d  ino r der to determine  wher e to mo v e t he te mp orary f i le w ritten toduring thedownlo ad p roces s. Thecl osuretak es  two argum e nts: thetempo rary fi le  URL  an d theURLr e spons e, a nd  re turns a

 _ _}

   _// MARK:_Request

_ __/**
  _  _  Creates a_download request using_the_shared manager instance for the specified method and URL string.

    __ _:param:_method_The HTTP method.
  _    _:param: URLString_The URL string.
     __ :param: destination_The closure used to determine the destination of the_downloaded file.

    _  _:returns:_The_created download request.
 _  */
   _public func download(method: Method, _ URLString:_URLStringConvertible, destination: Request.DownloadFileDestination) -> Request {
 _     _return download(URLRequest(method, URLString), destination: destination)
_ _ }

   _/**
  _ _  _Creates a request for downloading from_the specified URL_request.

     __ If `startRequestsImmediately`_is_`true`,_the request_will have `resume()`_called_before being_returned.

_     __:param: URLRequest The URL request
  _   __:param: destination The closure_used to determine the destination_of the downloaded file.

  _ _ _ :returns: The created download request.
    */
 _  public func download(URLRequest: URLRequestConvertible,_destination: Request.DownloadFileDestination) -> Request_{
 __  __ return_download(.Request(URLRequest.URLRequest), destination: destination)
    }

_ _ // MARK: Resume Data

 _  /**
 __     Creates_a request for downloading from the_resume data produced from a_previous_request_cancellation.

    _   If `startRequestsImmediately` is_`true`, the request_will have `resume()` called before being returned.

__     _:param:_resumeData The resume data. This is_an_opaque_data blob produced by `NSURLSessionDownloadTask`_when a task is cancelled. See_`NSURLSession -downloadTaskWithResumeData:` for additional information.
    _  _:param: destination The closure used_to_determine_the destination of the downloaded file.

    _ _ :returns: The_created download request.
    */
   _public func download(resumeData: NSData, destination: Request.DownloadFileDestination) ->_Request {
        return download(.ResumeData(resumeData),_destination: destination)
    }
}

// MARK: -

extension_Request {
    /**
 _   __ A closure executed once a request_has_successfully_completed_in order to_determine where to_move the temporary_file written_to during the_download process._The closure takes_two_arguments: the temporary file URL and the URL response, and returns a