Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs or example code? #46

Open
nhoffman opened this issue Jul 15, 2017 · 1 comment
Open

docs or example code? #46

nhoffman opened this issue Jul 15, 2017 · 1 comment

Comments

@nhoffman
Copy link

UW user here - thanks a lot for making this public. I'm wondering if you might be willing to share some examples of basic usage, particularly for group creation. It's pretty easy to find the GWS.create_group() method, but not how to instantiate a Group object to provide as an argument.

@jeffFranklin
Copy link
Contributor

Hi - all of the utilities I know of use the gws client for membership checks, so you might be the first to use create_group(). As such, I couldn't point you to a good example of group creation. A lot of this inherits from https://github.com/uw-it-aca/uw-restclients-gws so there might be a better example there. As far as instantiating a Group object, the constructor we provide looks incorrect, but a lot of create_group's usefulness is in GWS._xml_from_group. I personally would instantiate a Group object and add attributes till you get the desired outcome, like the following...

from resttools.models.gws import Group

config = {}
group = Group()
group.name = 'uw_blah_blah'
group.description = 'Group description goes here'
group.admins = [{'user_type': 'uwnetid', 'name': my_uwnetid}]
group_xml = GWS(config)._xml_from_group(group)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants