Server

<back to all web services

ListFileDevicePdf

Requires Authentication
The following routes are available for this service:
POST/files/{UserId}/ListDevicePdf/{DeviceId}
<?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};


enum Eras2FileType : string
{
    case DSatz = 'DSatz';
    case Hka = 'Hka';
    case E835Satz = 'E835Satz';
    case E898Satz = 'E898Satz';
    case Abrechnung = 'Abrechnung';
    case ArgeSatz = 'ArgeSatz';
    case NutzerFile = 'NutzerFile';
    case DevicePdf = 'DevicePdf';
}

// @DataContract
class MultipleEras2FileUpload implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="UserId")
        /** @var string|null */
        public ?string $UserId=null,

        // @DataMember(Name="NutzerId")
        /** @var string|null */
        public ?string $NutzerId=null,

        // @DataMember(Name="DeviceId")
        /** @var string|null */
        public ?string $DeviceId=null,

        // @DataMember(Name="FileTyp")
        /** @var Eras2FileType|null */
        public ?Eras2FileType $FileTyp=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['UserId'])) $this->UserId = $o['UserId'];
        if (isset($o['NutzerId'])) $this->NutzerId = $o['NutzerId'];
        if (isset($o['DeviceId'])) $this->DeviceId = $o['DeviceId'];
        if (isset($o['FileTyp'])) $this->FileTyp = JsonConverters::from('Eras2FileType', $o['FileTyp']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->UserId)) $o['UserId'] = $this->UserId;
        if (isset($this->NutzerId)) $o['NutzerId'] = $this->NutzerId;
        if (isset($this->DeviceId)) $o['DeviceId'] = $this->DeviceId;
        if (isset($this->FileTyp)) $o['FileTyp'] = JsonConverters::to('Eras2FileType', $this->FileTyp);
        return empty($o) ? new class(){} : $o;
    }
}

class MultipleEras2FileUploadResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $responseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract
class ListFileDevicePdf extends MultipleEras2FileUpload implements JsonSerializable
{
    /**
     * @param string|null $UserId
     * @param string|null $NutzerId
     * @param string|null $DeviceId
     * @param Eras2FileType|null $FileTyp
     */
    public function __construct(
        ?string $UserId=null,
        ?string $NutzerId=null,
        ?string $DeviceId=null,
        ?Eras2FileType $FileTyp=null
    ) {
        parent::__construct($UserId,$NutzerId,$DeviceId,$FileTyp);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['FileTyp'])) $this->FileTyp = JsonConverters::from('Eras2FileType', $o['FileTyp']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->FileTyp)) $o['FileTyp'] = JsonConverters::to('Eras2FileType', $this->FileTyp);
        return empty($o) ? new class(){} : $o;
    }
}

PHP ListFileDevicePdf DTOs

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

HTTP + CSV

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

POST /files/{UserId}/ListDevicePdf/{DeviceId} HTTP/1.1 
Host: emg-servdesk.eras-online.de 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"FileTyp":"DSatz","UserId":"String","NutzerId":"String","DeviceId":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}