Properties

$uuid

$uuid : array

UUID holds the Folder UUID

Type

array

$timeout

$timeout : integer

Timeout represents the HTTP timeout when HTTP requests to the SinusBot API are performed

Type

integer

$token

$token : string

Token is the SinusBot auth token which will be there temporary stored.

Type

string

$url

$url : string

URL is the SinusBot URL with the port and the HTTP protocol

Type

string

$headers

$headers : array

headers are http headers which will be added on every request

Type

array

$folder

$folder : array

Folder stores the initial received folder data

Type

array

$children

$children : array

Children stores the folder childrens

Type

array

Methods

__construct()

__construct(\SinusBot\API  $api, array  $folder) 

__construct

Parameters

\SinusBot\API $api

SinusBot API

array $folder

SiusBot Folder array

addHeader()

addHeader(string  $key, string  $value) 

addHeader adds a header to every http request

Parameters

string $key

http header key

string $value

http header value

setAuthToken()

setAuthToken(string  $token) 

setAuthToken overrides the auth token

Parameters

string $token

Auth-Token, when you want to override

getTitle()

getTitle() : string

getTitle returns the title

Returns

string —

foldername

getType()

getType() : string

getType returns the file type

Returns

string —

type: url, folder

getUUID()

getUUID() : string

getUUID returns the uuid

Returns

string —

folder UUID

getParent()

getParent() : string

getUUID returns the uuid

Returns

string —

folder UUID

addChildrenIfOK()

addChildrenIfOK(  $file) : \SinusBot\File

addChildrenIfOK checks recursive if the given file should be added as a child element. Determined via the "parent" attribute

Parameters

$file

Returns

\SinusBot\File

file

getChildren()

getChildren() : \SinusBot\(\File|array<mixed,\Folder)>

getChildren returns the children of the folder

Returns

\SinusBot\(\File|array<mixed,\Folder)>

delete()

delete() : array

delete

Returns

array —

status

edit()

edit(Array  $options) : array

edit

Parameters

Array $options
  • keys: displayTitle, title, artist, album...

Returns

array —

status

move()

move(string  $parent = "") : array

move

Parameters

string $parent

subfolder UUID, empty value means root folder

Returns

array —

status

request()

request(string  $path, string  $method = "GET", string  $payload = null, boolean  $encoded = false) : array

request executes a request to the SinusBot API

Parameters

string $path

/api/v1/

string $method

http method

string $payload

http POST payload

boolean $encoded

when not encoded it will be JSON marshalled

Returns

array —

decoded JSON response

getError()

getError(integer  $code) : string

getError returns the string representive to the given http status code

Parameters

integer $code

http status code

Returns

string —

http status code string representive