Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/Github/Api/Enterprise.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Github\Api\Enterprise\Stats;
use Github\Api\Enterprise\License;
use Github\Api\Enterprise\Users;

/**
* Getting information about a GitHub Enterprise instance.
Expand All @@ -29,4 +30,12 @@ public function license()
{
return new License($this->client);
}

/**
* @return Users
*/
public function users()
{
return new Users($this->client);
}
}
28 changes: 28 additions & 0 deletions lib/Github/Api/Enterprise/Users.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace Github\Api\Enterprise;

use Github\Api\AbstractApi;

class Users extends AbstractApi
{
/**
* Suspend a user
*
* @param string $username the username to suspend
*/
public function suspend($username)
{
$this->put('users/' . rawurlencode($username) . '/suspended');
}

/**
* Unsuspend a user
*
* @param string $username the username to unsuspend
*/
public function unsuspend($username)
{
$this->delete('users/' . rawurlencode($username) . '/suspended');
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Files must end in a single new line.