11use crate :: clients:: PathClient ;
22use crate :: request_options:: * ;
3- use azure_core:: { prelude:: * , Request } ;
3+ use azure_core:: { prelude:: * , Pageable , Request } ;
44use azure_core:: { AppendToUrlQuery , Response as HttpResponse } ;
55use azure_storage:: headers:: CommonStorageResponseHeaders ;
66use std:: convert:: TryInto ;
@@ -15,27 +15,29 @@ operation! {
1515}
1616
1717impl < C : PathClient + ' static > DeletePathBuilder < C > {
18- pub fn into_future ( self ) -> DeletePath {
19- Box :: pin ( async move {
20- let mut url = self . client . url ( ) ?;
18+ pub fn into_stream ( self ) -> Pageable < DeletePathResponse , azure_core:: error:: Error > {
19+ let make_request = move |continuation : Option < NextMarker > | {
20+ let this = self . clone ( ) ;
21+ let mut ctx = self . context . clone ( ) ;
2122
22- if let Some ( continuation) = self . continuation {
23- continuation. append_to_url_query_as_continuation ( & mut url) ;
24- } ;
25- self . recursive . append_to_url_query ( & mut url) ;
23+ async move {
24+ let mut url = this. client . url ( ) ?;
2625
27- let mut request = Request :: new ( url, azure_core:: Method :: Delete ) ;
26+ let continuation = continuation. or_else ( || this. continuation . clone ( ) ) ;
27+ if let Some ( continuation) = continuation {
28+ continuation. append_to_url_query_as_continuation ( & mut url) ;
29+ } ;
30+ this. recursive . append_to_url_query ( & mut url) ;
2831
29- request. insert_headers ( & self . if_match_condition ) ;
30- request. insert_headers ( & self . if_modified_since ) ;
32+ let mut request = Request :: new ( url, azure_core:: Method :: Delete ) ;
3133
32- let response = self
33- . client
34- . send ( & mut self . context . clone ( ) , & mut request)
35- . await ? ;
36-
37- DeletePathResponse :: try_from ( response ) . await
38- } )
34+ request . insert_headers ( & this . if_match_condition ) ;
35+ request . insert_headers ( & this . if_modified_since ) ;
36+ let response = this . client . send ( & mut ctx , & mut request) . await ? ;
37+ DeletePathResponse :: try_from ( response ) . await
38+ }
39+ } ;
40+ Pageable :: new ( make_request )
3941 }
4042}
4143
@@ -55,3 +57,10 @@ impl DeletePathResponse {
5557 } )
5658 }
5759}
60+
61+ impl Continuable for DeletePathResponse {
62+ type Continuation = NextMarker ;
63+ fn continuation ( & self ) -> Option < Self :: Continuation > {
64+ self . continuation . clone ( )
65+ }
66+ }
0 commit comments