@@ -59,6 +59,7 @@ def all(
5959 per_page : int | None = None ,
6060 include_totals : bool = False ,
6161 client_id : str | None = None ,
62+ allow_any_organization : bool | None = None ,
6263 ):
6364 """Retrieves all client grants.
6465
@@ -77,6 +78,8 @@ def all(
7778
7879 client_id (string, optional): The id of a client to filter.
7980
81+ allow_any_organization (bool, optional): Optional filter on allow_any_organization.
82+
8083 See: https://auth0.com/docs/api/management/v2#!/Client_Grants/get_client_grants
8184 """
8285
@@ -86,6 +89,7 @@ def all(
8689 "per_page" : per_page ,
8790 "include_totals" : str (include_totals ).lower (),
8891 "client_id" : client_id ,
92+ "allow_any_organization" : allow_any_organization ,
8993 }
9094
9195 return self .client .get (self ._url (), params = params )
@@ -124,3 +128,43 @@ def update(self, id: str, body: dict[str, Any]) -> dict[str, Any]:
124128 """
125129
126130 return self .client .patch (self ._url (id ), data = body )
131+
132+ def get_organizations (
133+ self ,
134+ id : str ,
135+ page : int | None = None ,
136+ per_page : int | None = None ,
137+ include_totals : bool = False ,
138+ from_param : str | None = None ,
139+ take : int | None = None ,
140+ ):
141+ """Get the organizations associated to a client grant.
142+
143+ Args:
144+ id (str): Id of client grant.
145+
146+ page (int, optional): The result's page number (zero based). When not set,
147+ the default value is up to the server.
148+
149+ per_page (int, optional): The amount of entries per page. When not set,
150+ the default value is up to the server.
151+
152+ include_totals (bool, optional): True if the query summary is
153+ to be included in the result, False otherwise. Defaults to False.
154+
155+ from_param (str, optional): Id to start retrieving entries. You can
156+ limit the amount of entries using the take parameter.
157+
158+ take (int, optional): The total amount of entries to retrieve when
159+ using the from parameter. When not set, the default value is up to the server.
160+ """
161+
162+ params = {
163+ "per_page" : per_page ,
164+ "page" : page ,
165+ "include_totals" : str (include_totals ).lower (),
166+ "from" : from_param ,
167+ "take" : take ,
168+ }
169+
170+ return self .client .get (self ._url (f"{ id } /organizations" ), params = params )
0 commit comments