Coder Social home page Coder Social logo

Comments (7)

duopeter avatar duopeter commented on July 29, 2024

Hi Dustin!

The documented max may not currently be enforced, but it will be in the near future. Consider the "limit" parameter a request, but the server may decide to return whatever number of results it wants.
The returned JSON result includes a "next_offset" value that tells you what is the next offset you should use to continue paging through the results.

The current python client library doesn't help much with this, but we'll be updating it to do that soon. It is probably easiest to wait for that update.

from duo_client_python.

dustindoucette avatar dustindoucette commented on July 29, 2024

Hi again,

Just had a quick question that is probably stupidly obvious. I noticed you just updated the 'admin.py' to include the offset and limit parameters. I was wondering if those changes will be reflected soon when I install the module in Python using the "python -m pip install duo_client" command. Right now I can get it working by manually installing the python file and creating the pyc for it.

Thank you,
Dustin

from duo_client_python.

xdesai avatar xdesai commented on July 29, 2024

Hi Dustin,
I may have a misunderstanding, but I believe that
python -m pip install duo_client is pulling from https://pypi.org/project/duo_client/
We haven't updated duo_client hosted there just yet because we're waiting to get a couple more pagination pull requests in. We'll tag a release and update pypi hopefully sometime next week.

from duo_client_python.

keithhir avatar keithhir commented on July 29, 2024

Forgive me to adding to this topic, but when pagination is required, will the client automatically send another get_users call with the next_offset parameter, or will we need to manually call get_users each time until we no longer see next_offset in the JSON result?

from duo_client_python.

xdesai avatar xdesai commented on July 29, 2024

Hi!
So the way we've designed this feature is to allow you to have it both ways. If you want us to handle the pagination for you then we will. If you want to handle pagination yourself then we let you do that too.

If you want us to handle pagination on, let's say, the get_users() call then what you'll want to do is call get_users() with no arguments. This will automatically do all the pagination and give you the result.
If you want more fine grain control then you can pass in a limit and an offset as arguments to get_users. get_users(limit=100, offset=200) This will only return the 100 users starting at offset 200.
Does that make sense?

from duo_client_python.

keithhir avatar keithhir commented on July 29, 2024

Yes, that answers my question perfectly. I would appreciate the option to make one call and have the pagination automatically taken care of, in addition to having manual control. Thank you!

from duo_client_python.

xdesai avatar xdesai commented on July 29, 2024

Duo Client Python 4.1.0 is released and can be imported via pip! Also the Duo API will now properly respect pagination args.
Closing out this issue now. Thanks for using Duo!

https://pypi.org/project/duo-client/4.1.0/

from duo_client_python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.