ScannerVision Web Server

<back to all web services

GetConnections

The following routes are available for this service:
GET/connections
<?php namespace dtos;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


class GetConnections implements JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

enum PermissionType : string
{
    case Group = 'Group';
    case User = 'User';
}

/**
 * @property bool $Allow
 * @property IConnectorConnection|null $Connection
 * @property PermissionType $Type
 */
interface IConnectionPermission extends IInterface
{
}

enum PropertyType : int
{
    case Binary = 1;
    case Boolean = 2;
    case ConnectionString = 3;
    case Credential = 4;
    case Integer = 5;
    case Picklist = 6;
    case String = 7;
    case OAuth2 = 8;
    case Certificate = 9;
}

/**
 * @property string|null $Description
 * @property string|null $Name
 * @property string $PropertyId
 * @property PropertyType $PropertyType
 */
interface IConnectionPropertyDescription extends IInterface
{
}

/**
 * @property ReadOnlyCollection<IUser>|null $Users
 */
interface IUserGroup extends IIdTemplatesItem, IGroup
{
}

/**
 * @property ReadOnlyCollection<IUserGroup>|null $Groups
 * @property string|null $EmailAddress
 * @property bool $HasPassword
 * @property string|null $HomeFolder
 * @property string|null $Password
 * @property bool|null $SbcUser
 */
interface IUser extends IIdTemplatesItem
{
}

/**
 * @property string $ConnectorId
 * @property string|null $Description
 * @property string|null $Id
 * @property int $MaxConnections
 * @property string|null $Name
 * @property ReadOnlyCollection<IConnectionPermission>|null $Permissions
 * @property ReadOnlyCollection<IConnectionPropertyDescription>|null $PropertyDescriptions
 * @property IUser|null $SetupUser
 */
interface IConnectorConnection extends IStatus
{
}

class GetConnectionsResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<IConnectorConnection>|null */
        public ?array $Connections=null,
        /** @var bool|null */
        public ?bool $IsAuthenticated=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Connections'])) $this->Connections = JsonConverters::fromArray('IConnectorConnection', $o['Connections']);
        if (isset($o['IsAuthenticated'])) $this->IsAuthenticated = $o['IsAuthenticated'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Connections)) $o['Connections'] = JsonConverters::toArray('IConnectorConnection', $this->Connections);
        if (isset($this->IsAuthenticated)) $o['IsAuthenticated'] = $this->IsAuthenticated;
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetConnections DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /connections HTTP/1.1 
Host: buildmax.org 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"IsAuthenticated":false}