Created
October 29, 2020 21:13
-
-
Save lmazuel/8e1e1e812204e9698a3d3a434cb68061 to your computer and use it in GitHub Desktop.
Paging brainstorm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I want to use headers and not JSON to get next Link, and the Swagger didn't help | |
class MyPagingMethod(PagingProtocol): | |
def extract_continuation_token(self, pipeline_response, deserialized): | |
return pipeline_response.http_response.headers["x-ms-continuation-token"] | |
client.list(paging_method=MyPagingMethod()) | |
# I want to use headers and not JSON to get next Link | |
client.list() | |
because | |
``json | |
x-ms-pageable: | |
nextLinkHeader: x-ms-continuation-token | |
def extract_continuation_token(pipeline_response, deserialized): # cuztomisable | |
return pipeline_response.http_response.headers["x-ms-continuation-token"] | |
# I want to use body to get next Link, but Swagger says it's headers | |
class MyPagingMethod(PagingProtocol): | |
def extract_continuation_token(self, pipeline_response, deserialized): | |
return deserialized.next_link or None | |
client.list(paging_method=MyPagingMethod()) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment