Server

<back to all web services

GetAppointment

Requires Authentication
The following routes are available for this service:
GET/Appointment/{Guid}
<?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};


// @DataContract
class Address implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="Guid")
        /** @var string */
        public string $Guid='',

        // @DataMember(Name="Straße")
        /** @var string|null */
        public ?string $Stra_e=null,

        // @DataMember(Name="Straße2")
        /** @var string|null */
        public ?string $Stra_e2=null,

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

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

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

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

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

        // @DataMember(Name="Breitengrad")
        /** @var float */
        public float $Breitengrad=0.0,

        // @DataMember(Name="Laengengrad")
        /** @var float */
        public float $Laengengrad=0.0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Guid'])) $this->Guid = $o['Guid'];
        if (isset($o['Stra_e'])) $this->Stra_e = $o['Stra_e'];
        if (isset($o['Stra_e2'])) $this->Stra_e2 = $o['Stra_e2'];
        if (isset($o['Hausnummer'])) $this->Hausnummer = $o['Hausnummer'];
        if (isset($o['Postleitzahl'])) $this->Postleitzahl = $o['Postleitzahl'];
        if (isset($o['Ort'])) $this->Ort = $o['Ort'];
        if (isset($o['Postfach'])) $this->Postfach = $o['Postfach'];
        if (isset($o['Adresszusatz'])) $this->Adresszusatz = $o['Adresszusatz'];
        if (isset($o['Breitengrad'])) $this->Breitengrad = $o['Breitengrad'];
        if (isset($o['Laengengrad'])) $this->Laengengrad = $o['Laengengrad'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Guid)) $o['Guid'] = $this->Guid;
        if (isset($this->Stra_e)) $o['Stra_e'] = $this->Stra_e;
        if (isset($this->Stra_e2)) $o['Stra_e2'] = $this->Stra_e2;
        if (isset($this->Hausnummer)) $o['Hausnummer'] = $this->Hausnummer;
        if (isset($this->Postleitzahl)) $o['Postleitzahl'] = $this->Postleitzahl;
        if (isset($this->Ort)) $o['Ort'] = $this->Ort;
        if (isset($this->Postfach)) $o['Postfach'] = $this->Postfach;
        if (isset($this->Adresszusatz)) $o['Adresszusatz'] = $this->Adresszusatz;
        if (isset($this->Breitengrad)) $o['Breitengrad'] = $this->Breitengrad;
        if (isset($this->Laengengrad)) $o['Laengengrad'] = $this->Laengengrad;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract
class Abrechnungseinheit implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="Guid")
        /** @var string */
        public string $Guid='',

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

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

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

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

// @DataContract
class AppointmentStoreUser implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="MonteurGuid")
        /** @var string */
        public string $MonteurGuid=''
    ) {
    }

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

// @DataContract
class AppointmentNutzeinheit implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="NutzeinheitGuid")
        /** @var string */
        public string $NutzeinheitGuid=''
    ) {
    }

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

// @DataContract
class Appointment implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="Guid")
        /** @var string */
        public string $Guid='',

        // @DataMember(Name="Von")
        /** @var DateTime */
        public DateTime $Von=new DateTime(),

        // @DataMember(Name="Bis")
        /** @var DateTime */
        public DateTime $Bis=new DateTime(),

        // @DataMember(Name="Monteure")
        /** @var array<AppointmentStoreUser>|null */
        public ?array $Monteure=null,

        // @DataMember(Name="Nutzeinheiten")
        /** @var array<AppointmentNutzeinheit>|null */
        public ?array $Nutzeinheiten=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Guid'])) $this->Guid = $o['Guid'];
        if (isset($o['Von'])) $this->Von = JsonConverters::from('DateTime', $o['Von']);
        if (isset($o['Bis'])) $this->Bis = JsonConverters::from('DateTime', $o['Bis']);
        if (isset($o['Monteure'])) $this->Monteure = JsonConverters::fromArray('AppointmentStoreUser', $o['Monteure']);
        if (isset($o['Nutzeinheiten'])) $this->Nutzeinheiten = JsonConverters::fromArray('AppointmentNutzeinheit', $o['Nutzeinheiten']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Guid)) $o['Guid'] = $this->Guid;
        if (isset($this->Von)) $o['Von'] = JsonConverters::to('DateTime', $this->Von);
        if (isset($this->Bis)) $o['Bis'] = JsonConverters::to('DateTime', $this->Bis);
        if (isset($this->Monteure)) $o['Monteure'] = JsonConverters::toArray('AppointmentStoreUser', $this->Monteure);
        if (isset($this->Nutzeinheiten)) $o['Nutzeinheiten'] = JsonConverters::toArray('AppointmentNutzeinheit', $this->Nutzeinheiten);
        return empty($o) ? new class(){} : $o;
    }
}

enum ProcessState : string
{
    case InProgress = 'InProgress';
    case Updating = 'Updating';
    case Creating = 'Creating';
    case Completed = 'Completed';
}

// @DataContract
class OrderState implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="LastModified")
        /** @var DateTime|null */
        public ?DateTime $LastModified=null,

        // @DataMember(Name="AuftragArten")
        /** @var array<OrderKind>|null */
        public ?array $AuftragArten=null,

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

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

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['LastModified'])) $this->LastModified = JsonConverters::from('DateTime', $o['LastModified']);
        if (isset($o['AuftragArten'])) $this->AuftragArten = JsonConverters::fromArray('Nullable<OrderKind>', $o['AuftragArten']);
        if (isset($o['Bearbeitungsstatus'])) $this->Bearbeitungsstatus = JsonConverters::from('ProcessState', $o['Bearbeitungsstatus']);
        if (isset($o['AbgeschlossenDatum'])) $this->AbgeschlossenDatum = JsonConverters::from('DateTime', $o['AbgeschlossenDatum']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->LastModified)) $o['LastModified'] = JsonConverters::to('DateTime', $this->LastModified);
        if (isset($this->AuftragArten)) $o['AuftragArten'] = JsonConverters::toArray('Nullable<OrderKind>', $this->AuftragArten);
        if (isset($this->Bearbeitungsstatus)) $o['Bearbeitungsstatus'] = JsonConverters::to('ProcessState', $this->Bearbeitungsstatus);
        if (isset($this->AbgeschlossenDatum)) $o['AbgeschlossenDatum'] = JsonConverters::to('DateTime', $this->AbgeschlossenDatum);
        return empty($o) ? new class(){} : $o;
    }
}

class Order implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="Guid")
        /** @var string */
        public string $Guid='',

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

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

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

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

        // @DataMember(Name="Termine")
        /** @var array<Appointment>|null */
        public ?array $Termine=null,

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

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Guid'])) $this->Guid = $o['Guid'];
        if (isset($o['Abrechnungseinheit'])) $this->Abrechnungseinheit = JsonConverters::from('Abrechnungseinheit', $o['Abrechnungseinheit']);
        if (isset($o['AuftragNummer'])) $this->AuftragNummer = $o['AuftragNummer'];
        if (isset($o['Bezeichnung'])) $this->Bezeichnung = $o['Bezeichnung'];
        if (isset($o['Anmerkung'])) $this->Anmerkung = $o['Anmerkung'];
        if (isset($o['Termine'])) $this->Termine = JsonConverters::fromArray('Appointment', $o['Termine']);
        if (isset($o['AuftragZustand'])) $this->AuftragZustand = JsonConverters::from('OrderState', $o['AuftragZustand']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Guid)) $o['Guid'] = $this->Guid;
        if (isset($this->Abrechnungseinheit)) $o['Abrechnungseinheit'] = JsonConverters::to('Abrechnungseinheit', $this->Abrechnungseinheit);
        if (isset($this->AuftragNummer)) $o['AuftragNummer'] = $this->AuftragNummer;
        if (isset($this->Bezeichnung)) $o['Bezeichnung'] = $this->Bezeichnung;
        if (isset($this->Anmerkung)) $o['Anmerkung'] = $this->Anmerkung;
        if (isset($this->Termine)) $o['Termine'] = JsonConverters::toArray('Appointment', $this->Termine);
        if (isset($this->AuftragZustand)) $o['AuftragZustand'] = JsonConverters::to('OrderState', $this->AuftragZustand);
        return empty($o) ? new class(){} : $o;
    }
}

enum DeviceOrderKind : string
{
    case Assembly = 'Assembly';
    case Maintenance = 'Maintenance';
    case Exchange = 'Exchange';
    case Reading = 'Reading';
    case Inspection = 'Inspection';
    case MainReading = 'MainReading';
}

// @DataContract
class DeviceOrderState implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="GeraeteGuid")
        /** @var string */
        public string $GeraeteGuid='',

        // @DataMember(Name="AuftragGuid")
        /** @var string */
        public string $AuftragGuid='',

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

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

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

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

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['GeraeteGuid'])) $this->GeraeteGuid = $o['GeraeteGuid'];
        if (isset($o['AuftragGuid'])) $this->AuftragGuid = $o['AuftragGuid'];
        if (isset($o['AuftragArt'])) $this->AuftragArt = JsonConverters::from('DeviceOrderKind', $o['AuftragArt']);
        if (isset($o['Bearbeitungsstatus'])) $this->Bearbeitungsstatus = JsonConverters::from('ProcessState', $o['Bearbeitungsstatus']);
        if (isset($o['AbgeschlossenDatum'])) $this->AbgeschlossenDatum = JsonConverters::from('DateTime', $o['AbgeschlossenDatum']);
        if (isset($o['AmwInfo'])) $this->AmwInfo = $o['AmwInfo'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->GeraeteGuid)) $o['GeraeteGuid'] = $this->GeraeteGuid;
        if (isset($this->AuftragGuid)) $o['AuftragGuid'] = $this->AuftragGuid;
        if (isset($this->AuftragArt)) $o['AuftragArt'] = JsonConverters::to('DeviceOrderKind', $this->AuftragArt);
        if (isset($this->Bearbeitungsstatus)) $o['Bearbeitungsstatus'] = JsonConverters::to('ProcessState', $this->Bearbeitungsstatus);
        if (isset($this->AbgeschlossenDatum)) $o['AbgeschlossenDatum'] = JsonConverters::to('DateTime', $this->AbgeschlossenDatum);
        if (isset($this->AmwInfo)) $o['AmwInfo'] = $this->AmwInfo;
        return empty($o) ? new class(){} : $o;
    }
}

class GetAppointmentResponse implements JsonSerializable
{
    public function __construct(
        /** @var Order|null */
        public ?Order $order=null,
        /** @var array<DeviceOrderState>|null */
        public ?array $backDeviceStates=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $responseStatus=null
    ) {
    }

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

// @DataContract
class GetAppointment implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="Guid")
        /** @var string */
        public string $Guid='',

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

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

PHP GetAppointment 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 /Appointment/{Guid} HTTP/1.1 
Host: concept2021-servamw.eras-online.de 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"appointment":{"Guid":"00000000000000000000000000000000","Von":"0001-01-01T00:00:00.0000000Z","Bis":"0001-01-01T00:00:00.0000000Z"},"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}