PHP Interface rcrowe\Hippy\Transport\TransportInterface

Show file Open project: rcrowe/hippy Interface Usage Examples

Public Methods

Method 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 method

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 method

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

getFrom() public method

Get who the message will be sent from.
public getFrom ( ) : string
return string

getHeaders() public method

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

getRoom() public method

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

getToken() public method

Get the token used to authenticate with.
public getToken ( ) : string
return string

send() public method

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

setEndpoint() public method

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

setFrom() public method

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

setHeaders() public method

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

setRoom() public method

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

setToken() public method

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