PHP Interface rcrowe\Hippy\Transport\TransportInterface

Afficher le fichier Open project: rcrowe/hippy Interface Usage Examples

Méthodes publiques

Méthode Description
__construct ( string $token, string | integer $room, string $from, string $endpoint ) Create a new instance.
getEndpoint ( ) : string Get the API host we will send the message to.
getFrom ( ) : string Get who the message will be sent from.
getHeaders ( ) : array Get the headers that will be sent with the message.
getRoom ( ) : string | integer Get the room the message will be sent to.
getToken ( ) : string Get the token used to authenticate with.
send ( rcrowe\Hippy\Message\MessageInterface $message ) : void Send the message.
setEndpoint ( string $endpoint ) : void Set the API host to send the message to.
setFrom ( string $from ) : void Set who the message will be sent from.
setHeaders ( array $headers ) : void Set the headers that will be sent with the message.
setRoom ( string $room ) : void Set the room that the message will be sent to.
setToken ( string $token ) : void Set the token used to authenticate with.

Method Details

__construct() public méthode

Create a new instance.
public __construct ( string $token, string | integer $room, string $from, string $endpoint )
$token string API token.
$room string | integer Room to send message to.
$from string Who the message is from.
$endpoint string API host.

getEndpoint() public méthode

Get the API host we will send the message to.
public getEndpoint ( ) : string
Résultat string

getFrom() public méthode

Get who the message will be sent from.
public getFrom ( ) : string
Résultat string

getHeaders() public méthode

Get the headers that will be sent with the message.
public getHeaders ( ) : array
Résultat array

getRoom() public méthode

Get the room the message will be sent to.
public getRoom ( ) : string | integer
Résultat string | integer

getToken() public méthode

Get the token used to authenticate with.
public getToken ( ) : string
Résultat string

send() public méthode

Send the message.
public send ( rcrowe\Hippy\Message\MessageInterface $message ) : void
$message rcrowe\Hippy\Message\MessageInterface
Résultat void

setEndpoint() public méthode

Set the API host to send the message to.
public setEndpoint ( string $endpoint ) : void
$endpoint string API host.
Résultat void

setFrom() public méthode

Set who the message will be sent from.
public setFrom ( string $from ) : void
$from string Message will be sent by this user.
Résultat void

setHeaders() public méthode

Set the headers that will be sent with the message.
public setHeaders ( array $headers ) : void
$headers array Key value array
Résultat void

setRoom() public méthode

Set the room that the message will be sent to.
public setRoom ( string $room ) : void
$room string Room name or id.
Résultat void

setToken() public méthode

Set the token used to authenticate with.
public setToken ( string $token ) : void
$token string API token. See https://{domain}.hipchat.com/admin/api.
Résultat void