Skip to content

update_permission_set async

update_permission_set(
    environment_arn: EnvironmentArn,
    permission_set_id: PermissionSetId,
    *,
    config_overrides: Optional[AsyncAssuranceClientConfig] = None,
    name: Optional[PermissionSetName] = None,
    description: Optional[PermissionSetDescription] = None,
    permissions: Optional[PermissionsList] = None,
) -> UpdatePermissionSetOutput

Updates an existing permission set. Omitted fields are left unchanged. Returns no content; retrieve the updated attributes with GetPermissionSet.

Parameters:

Raises:

Examples:

Update a permission set Upgrades the payments auditor permission set from reviewing assessments to running them.

>>> await client.update_permission_set(environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', permission_set_id='a1b2c3d4-5678-90ab-cdef-EXAMPLE88888', description='Access for the payments compliance team to run the PCI-DSS assessment and manage its projects.', permissions=['run_assessments', 'manage_projects'])
Source code in docs_src/capo_assurance/_services/async_assurance.py
async def update_permission_set(
    self,
    environment_arn: "capo_assurance.types.environment_arn.EnvironmentArn",
    permission_set_id: "capo_assurance.types.permission_set_id.PermissionSetId",
    *,
    config_overrides: Optional[AsyncAssuranceClientConfig] = None,
    name: Optional[
        "capo_assurance.types.permission_set_name.PermissionSetName"
    ] = None,
    description: Optional[
        "capo_assurance.types.permission_set_description.PermissionSetDescription"
    ] = None,
    permissions: Optional[
        "capo_assurance.types.permissions_list.PermissionsList"
    ] = None,
) -> "capo_assurance.types.update_permission_set_output.UpdatePermissionSetOutput":
    """<p>Updates an existing permission set. Omitted fields are left unchanged. Returns no content; retrieve the updated attributes with GetPermissionSet.</p>

    Args:
        environment_arn: <p>The ARN of this governance environment.</p>
        permission_set_id: <p>The identifier of the permission set.</p>
        name: <p>The name of the permission set.</p>
        description: <p>A description of the permission set.</p>
        permissions: <p>The permissions granted by the permission set.</p>

    Raises:
        capo_assurance.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action. This error occurs when the request is unauthenticated, or is authenticated but lacks permission to invoke the operation.</p>
        capo_assurance.errors.conflict_exception.ConflictException: <p>A conflict occurred (for example, resource already exists).</p>
        capo_assurance.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred.</p>
        capo_assurance.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource was not found.</p>
        capo_assurance.errors.throttling_exception.ThrottlingException: <p>The request was throttled.</p>
        capo_assurance.errors.validation_exception.ValidationException: <p>The request failed validation.</p>
        capo_assurance.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Update a permission set
        Upgrades the payments auditor permission set from reviewing assessments to running them.

        >>> await client.update_permission_set(environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', permission_set_id='a1b2c3d4-5678-90ab-cdef-EXAMPLE88888', description='Access for the payments compliance team to run the PCI-DSS assessment and manage its projects.', permissions=['run_assessments', 'manage_projects'])
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_assurance.types.update_permission_set_input.UpdatePermissionSetInput]",
    ) -> AsyncOperationResponse[
        "capo_assurance.types.update_permission_set_output.UpdatePermissionSetOutput"
    ]:
        import capo_assurance._operations.assurance.update_permission_set

        (
            output,
            http_response,
        ) = await capo_assurance._operations.assurance.update_permission_set.async_update_permission_set(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdatePermissionSet")
    )
    input_: capo_assurance.types.update_permission_set_input.UpdatePermissionSetInput = {
        "environment_arn": environment_arn,
        "permission_set_id": permission_set_id,
    }
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if permissions is not None:
        input_["permissions"] = permissions

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output