Skip to content
This repository was archived by the owner on Dec 17, 2018. It is now read-only.
Open
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
13 changes: 13 additions & 0 deletions src/CL/Slack/Model/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ class User extends AbstractModel
*/
private $id;

/**
* @var string|null
*/
private $team_id;

/**
* @var string
*/
Expand Down Expand Up @@ -76,6 +81,14 @@ public function getId()
return $this->id;
}

/**
* @return null|string
*/
public function getTeamId()
{
return $this->team_id;
}

/**
* @return string The (user)name of this member
*/
Expand Down
13 changes: 13 additions & 0 deletions src/CL/Slack/Payload/AbstractPayloadResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ abstract class AbstractPayloadResponse implements PayloadResponseInterface
*/
private $error;

/**
* @var string
*/
private $needed;

/**
* @var string
*/
private $provided;

/**
* @inheritdoc
*/
Expand Down Expand Up @@ -79,6 +89,9 @@ protected function getPossibleErrors()
'user_is_bot' => 'This method cannot be called by a bot user',
'user_is_ultra_restricted' => 'This method cannot be called by a single channel guest',
'user_not_found' => 'User could not be found',
'missing_scope' => sprintf("The application's permissions is not enough to complete this request. Needed scope is '%s', provided - [%s].",
$this->needed, $this->provided),
'token_revoked'=>'Token was revoked. Try to reinstall the application to get a new one.',
];
}
}
53 changes: 48 additions & 5 deletions src/CL/Slack/Payload/ChannelsListPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,17 @@ class ChannelsListPayload extends AbstractPayload
/**
* @var bool
*/
private $excludeArchived;
private $exclude_archived;

/**
* @var bool
*/
private $exclude_members;

/**
* @var int
*/
private $limit;

/**
* @inheritdoc
Expand All @@ -32,18 +42,51 @@ public function getMethod()
}

/**
* @param bool $excludeArchived
* @param bool $exclude_archived
*/
public function setExcludeArchived($excludeArchived)
public function setExcludeArchived($exclude_archived)
{
$this->excludeArchived = $excludeArchived;
$this->exclude_archived = $exclude_archived;
}

/**
* @return bool
*/
public function isExcludeArchived()
{
return $this->excludeArchived;
return $this->exclude_archived;
}

/**
* @return bool
*/
public function isExcludeMembers()
{
return $this->exclude_members;
}

/**
* @param bool $exclude_members
*/
public function setExcludeMembers( bool $exclude_members )
{
$this->exclude_members = $exclude_members;
}

/**
* @return int
*/
public function getLimit()
{
return $this->limit;
}

/**
* @param int $limit
*/
public function setLimit( $limit )
{
$this->limit = $limit;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ CL\Slack\Model\User:
properties:
id:
type: string
team_id:
type: string
name:
type: string
color:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ CL\Slack\Payload\AbstractPayloadResponse:
type: boolean
error:
type: string
needed:
type: string
provided:
type: string
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
CL\Slack\Payload\ChannelsListPayload:
properties:
alreadyArchived:
exclude_archived:
type: boolean
exclude_members:
type: boolean
limit:
type: integer