Skip to content
This repository was archived by the owner on Feb 27, 2023. It is now read-only.

Commit bdb3111

Browse files
committed
Update license
Signed-off-by: Uilian Ries <uilianries@gmail.com>
1 parent 9277b9f commit bdb3111

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

bintray/bintray.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,29 @@ def create_user_proprietary_license(self, user, license):
146146
url = "{}/users/{}/licenses".format(Bintray.BINTRAY_URL, user)
147147
return self._requester.post(url, json=license)
148148

149+
def update_org_proprietary_license(self, org, custom_license_name, license):
150+
""" Update a license associated with an organization.
151+
Caller must be an admin of the organization.
152+
153+
:param org: Organization name
154+
:param custom_license_name: License to be updated
155+
:param license: JSON data with license information
156+
:return: request answer
157+
"""
158+
url = "{}/orgs/{}/licenses/{}".format(Bintray.BINTRAY_URL, org, custom_license_name)
159+
return self._requester.patch(url, json=license)
160+
161+
def update_user_proprietary_license(self, user, custom_license_name, license):
162+
""" Update a license associated with an user.
163+
164+
:param user: User name
165+
:param custom_license_name: License to be updated
166+
:param license: JSON data with license information
167+
:return: request answer
168+
"""
169+
url = "{}/users/{}/licenses/{}".format(Bintray.BINTRAY_URL, user, custom_license_name)
170+
return self._requester.patch(url, json=license)
171+
149172
def get_oss_licenses(self):
150173
""" Returns a list of all the OSS licenses.
151174

0 commit comments

Comments
 (0)