Add UpdateOrganizationalUnit endpoint to Organizations API
This commit is contained in:
parent
152ad8b82e
commit
14ebf29a61
3 changed files with 27 additions and 0 deletions
|
|
@ -222,6 +222,11 @@ class OrganizationsBackend(BaseBackend):
|
|||
self.attach_policy(PolicyId=utils.DEFAULT_POLICY_ID, TargetId=new_ou.id)
|
||||
return new_ou.describe()
|
||||
|
||||
def update_organizational_unit(self, **kwargs):
|
||||
ou = self.get_organizational_unit_by_id(kwargs["OrganizationalUnitId"])
|
||||
ou.name = kwargs["Name"]
|
||||
return ou.describe()
|
||||
|
||||
def get_organizational_unit_by_id(self, ou_id):
|
||||
ou = next((ou for ou in self.ou if ou.id == ou_id), None)
|
||||
if ou is None:
|
||||
|
|
|
|||
|
|
@ -36,6 +36,11 @@ class OrganizationsResponse(BaseResponse):
|
|||
self.organizations_backend.create_organizational_unit(**self.request_params)
|
||||
)
|
||||
|
||||
def update_organizational_unit(self):
|
||||
return json.dumps(
|
||||
self.organizations_backend.update_organizational_unit(**self.request_params)
|
||||
)
|
||||
|
||||
def describe_organizational_unit(self):
|
||||
return json.dumps(
|
||||
self.organizations_backend.describe_organizational_unit(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue