Server

<back to all web services

GetObjekt

Objekte
Requires Authentication
The following routes are available for this service:
GET/api/v1/objekte/{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
        /** @var string */
        public string $guid='',

        // @DataMember
        /** @var string|null */
        public ?string $street=null,

        // @DataMember
        /** @var string|null */
        public ?string $street2=null,

        // @DataMember
        /** @var string|null */
        public ?string $streetNumber=null,

        // @DataMember
        /** @var string|null */
        public ?string $zipcode=null,

        // @DataMember
        /** @var string|null */
        public ?string $city=null,

        // @DataMember
        /** @var string|null */
        public ?string $mailbox=null,

        // @DataMember
        /** @var string|null */
        public ?string $additional=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['guid'])) $this->guid = $o['guid'];
        if (isset($o['street'])) $this->street = $o['street'];
        if (isset($o['street2'])) $this->street2 = $o['street2'];
        if (isset($o['streetNumber'])) $this->streetNumber = $o['streetNumber'];
        if (isset($o['zipcode'])) $this->zipcode = $o['zipcode'];
        if (isset($o['city'])) $this->city = $o['city'];
        if (isset($o['mailbox'])) $this->mailbox = $o['mailbox'];
        if (isset($o['additional'])) $this->additional = $o['additional'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->guid)) $o['guid'] = $this->guid;
        if (isset($this->street)) $o['street'] = $this->street;
        if (isset($this->street2)) $o['street2'] = $this->street2;
        if (isset($this->streetNumber)) $o['streetNumber'] = $this->streetNumber;
        if (isset($this->zipcode)) $o['zipcode'] = $this->zipcode;
        if (isset($this->city)) $o['city'] = $this->city;
        if (isset($this->mailbox)) $o['mailbox'] = $this->mailbox;
        if (isset($this->additional)) $o['additional'] = $this->additional;
        return empty($o) ? new class(){} : $o;
    }
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        // @DataMember(Name="MarkedClosedAt")
        /** @var DateTime|null */
        public ?DateTime $MarkedClosedAt=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['IstAbgeschlossen'])) $this->IstAbgeschlossen = $o['IstAbgeschlossen'];
        if (isset($o['HatNebenkosten'])) $this->HatNebenkosten = $o['HatNebenkosten'];
        if (isset($o['ObjektGuid'])) $this->ObjektGuid = $o['ObjektGuid'];
        if (isset($o['AnmerkungKundenportal'])) $this->AnmerkungKundenportal = $o['AnmerkungKundenportal'];
        if (isset($o['KundenportalMarkedDone'])) $this->KundenportalMarkedDone = $o['KundenportalMarkedDone'];
        if (isset($o['MarkedDoneAt'])) $this->MarkedDoneAt = JsonConverters::from('DateTime', $o['MarkedDoneAt']);
        if (isset($o['KundenportalMarkedClosed'])) $this->KundenportalMarkedClosed = $o['KundenportalMarkedClosed'];
        if (isset($o['MarkedClosedAt'])) $this->MarkedClosedAt = JsonConverters::from('DateTime', $o['MarkedClosedAt']);
    }
    
    /** @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->IstAbgeschlossen)) $o['IstAbgeschlossen'] = $this->IstAbgeschlossen;
        if (isset($this->HatNebenkosten)) $o['HatNebenkosten'] = $this->HatNebenkosten;
        if (isset($this->ObjektGuid)) $o['ObjektGuid'] = $this->ObjektGuid;
        if (isset($this->AnmerkungKundenportal)) $o['AnmerkungKundenportal'] = $this->AnmerkungKundenportal;
        if (isset($this->KundenportalMarkedDone)) $o['KundenportalMarkedDone'] = $this->KundenportalMarkedDone;
        if (isset($this->MarkedDoneAt)) $o['MarkedDoneAt'] = JsonConverters::to('DateTime', $this->MarkedDoneAt);
        if (isset($this->KundenportalMarkedClosed)) $o['KundenportalMarkedClosed'] = $this->KundenportalMarkedClosed;
        if (isset($this->MarkedClosedAt)) $o['MarkedClosedAt'] = JsonConverters::to('DateTime', $this->MarkedClosedAt);
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract
class Objekt implements JsonSerializable
{
    public function __construct(
        // @DataMember
        /** @var string */
        public string $guid='',

        // @DataMember
        /** @var string|null */
        public ?string $number=null,

        // @DataMember
        /** @var string|null */
        public ?string $isCompleted=null,

        // @DataMember
        /** @var DateTime|null */
        public ?DateTime $completedDate=null,

        // @DataMember
        /** @var Address|null */
        public ?Address $address=null,

        // @DataMember
        /** @var array<Nutzeinheit>|null */
        public ?array $nutzeinheiten=null,

        // @DataMember
        /** @var array<BillingInformation>|null */
        public ?array $billingInformations=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['guid'])) $this->guid = $o['guid'];
        if (isset($o['number'])) $this->number = $o['number'];
        if (isset($o['isCompleted'])) $this->isCompleted = $o['isCompleted'];
        if (isset($o['completedDate'])) $this->completedDate = JsonConverters::from('DateTime', $o['completedDate']);
        if (isset($o['address'])) $this->address = JsonConverters::from('Address', $o['address']);
        if (isset($o['nutzeinheiten'])) $this->nutzeinheiten = JsonConverters::fromArray('Nutzeinheit', $o['nutzeinheiten']);
        if (isset($o['billingInformations'])) $this->billingInformations = JsonConverters::fromArray('BillingInformation', $o['billingInformations']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->guid)) $o['guid'] = $this->guid;
        if (isset($this->number)) $o['number'] = $this->number;
        if (isset($this->isCompleted)) $o['isCompleted'] = $this->isCompleted;
        if (isset($this->completedDate)) $o['completedDate'] = JsonConverters::to('DateTime', $this->completedDate);
        if (isset($this->address)) $o['address'] = JsonConverters::to('Address', $this->address);
        if (isset($this->nutzeinheiten)) $o['nutzeinheiten'] = JsonConverters::toArray('Nutzeinheit', $this->nutzeinheiten);
        if (isset($this->billingInformations)) $o['billingInformations'] = JsonConverters::toArray('BillingInformation', $this->billingInformations);
        return empty($o) ? new class(){} : $o;
    }
}

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

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

class GetObjekt implements IHasBearerToken, JsonSerializable
{
    public function __construct(
        // @ApiMember(IsRequired=true, ParameterType="query")
        /** @var string */
        public string $bearerToken='',

        // @ApiMember(IsRequired=true, ParameterType="path")
        /** @var string */
        public string $guid='',

        // @ApiMember(ParameterType="query")
        /** @var string|null */
        public ?string $include=null
    ) {
    }

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

PHP GetObjekt DTOs

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

HTTP + XML

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

GET /api/v1/objekte/{Guid} HTTP/1.1 
Host: messtecc-servdesk.eras-online.de 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<GetObjektResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eras2Web.Service.Desktop.Server.ServiceModel.Eras2WebExt.Get">
  <Objekt xmlns:d2p1="http://schemas.datacontract.org/2004/07/Eras2Web.Service.Desktop.Server.ServiceModel.Eras2WebExt.Models">
    <d2p1:Address>
      <d2p1:Additional>String</d2p1:Additional>
      <d2p1:City>String</d2p1:City>
      <d2p1:Guid>00000000-0000-0000-0000-000000000000</d2p1:Guid>
      <d2p1:Mailbox>String</d2p1:Mailbox>
      <d2p1:Street>String</d2p1:Street>
      <d2p1:Street2>String</d2p1:Street2>
      <d2p1:StreetNumber>String</d2p1:StreetNumber>
      <d2p1:Zipcode>String</d2p1:Zipcode>
    </d2p1:Address>
    <d2p1:BillingInformations>
      <d2p1:BillingInformation>
        <d2p1:From>0001-01-01T00:00:00</d2p1:From>
        <d2p1:Guid>String</d2p1:Guid>
        <d2p1:HasNebenkosten>false</d2p1:HasNebenkosten>
        <d2p1:IsCompleted>false</d2p1:IsCompleted>
        <d2p1:To>0001-01-01T00:00:00</d2p1:To>
      </d2p1:BillingInformation>
    </d2p1:BillingInformations>
    <d2p1:CompletedDate>0001-01-01T00:00:00</d2p1:CompletedDate>
    <d2p1:Guid>00000000-0000-0000-0000-000000000000</d2p1:Guid>
    <d2p1:IsCompleted>String</d2p1:IsCompleted>
    <d2p1:Number>String</d2p1:Number>
    <d2p1:Nutzeinheiten>
      <d2p1:Nutzeinheit>
        <d2p1:Address>
          <d2p1:Additional>String</d2p1:Additional>
          <d2p1:City>String</d2p1:City>
          <d2p1:Guid>00000000-0000-0000-0000-000000000000</d2p1:Guid>
          <d2p1:Mailbox>String</d2p1:Mailbox>
          <d2p1:Street>String</d2p1:Street>
          <d2p1:Street2>String</d2p1:Street2>
          <d2p1:StreetNumber>String</d2p1:StreetNumber>
          <d2p1:Zipcode>String</d2p1:Zipcode>
        </d2p1:Address>
        <d2p1:Guid>00000000-0000-0000-0000-000000000000</d2p1:Guid>
        <d2p1:Location>String</d2p1:Location>
        <d2p1:Number>String</d2p1:Number>
        <d2p1:NutzeinheitenDevices>
          <d2p1:NutzeinheitDevice>
            <d2p1:AssignedFromDate>0001-01-01T00:00:00</d2p1:AssignedFromDate>
            <d2p1:AssignedToDate>0001-01-01T00:00:00</d2p1:AssignedToDate>
            <d2p1:Device>
              <d2p1:CalibrationDate>0001-01-01T00:00:00</d2p1:CalibrationDate>
              <d2p1:DeinstallationDate>0001-01-01T00:00:00</d2p1:DeinstallationDate>
              <d2p1:Description>String</d2p1:Description>
              <d2p1:DeviceCatalog xmlns:d8p1="http://schemas.datacontract.org/2004/07/Eras2Web.Service.Desktop.Server.ServiceModel.Stammdaten">
                <d8p1:Ablesbar>false</d8p1:Ablesbar>
                <d8p1:Abzug>false</d8p1:Abzug>
                <d8p1:Funk>false</d8p1:Funk>
                <d8p1:Guid>String</d8p1:Guid>
                <d8p1:Hkvv>false</d8p1:Hkvv>
                <d8p1:Klasse>String</d8p1:Klasse>
                <d8p1:TypKurz>String</d8p1:TypKurz>
                <d8p1:TypLang>String</d8p1:TypLang>
              </d2p1:DeviceCatalog>
              <d2p1:DeviceConsumptions>
                <d2p1:DeviceConsumption>
                  <d2p1:AmpouleColour>String</d2p1:AmpouleColour>
                  <d2p1:ChangeDate>0001-01-01T00:00:00</d2p1:ChangeDate>
                  <d2p1:DeviceGuid>String</d2p1:DeviceGuid>
                  <d2p1:DeviceReading>0</d2p1:DeviceReading>
                  <d2p1:DeviceReadingDate>0001-01-01T00:00:00</d2p1:DeviceReadingDate>
                  <d2p1:DeviceReadingKind>ZA</d2p1:DeviceReadingKind>
                  <d2p1:Guid>00000000-0000-0000-0000-000000000000</d2p1:Guid>
                  <d2p1:Note>String</d2p1:Note>
                </d2p1:DeviceConsumption>
              </d2p1:DeviceConsumptions>
              <d2p1:Guid>00000000-0000-0000-0000-000000000000</d2p1:Guid>
              <d2p1:InstallationDate>0001-01-01T00:00:00</d2p1:InstallationDate>
              <d2p1:Label>String</d2p1:Label>
              <d2p1:Note>String</d2p1:Note>
              <d2p1:Number>String</d2p1:Number>
              <d2p1:Unit>L</d2p1:Unit>
            </d2p1:Device>
            <d2p1:Guid>00000000-0000-0000-0000-000000000000</d2p1:Guid>
            <d2p1:IsMaintained>false</d2p1:IsMaintained>
            <d2p1:IsRented>false</d2p1:IsRented>
            <d2p1:OngoingNumber>String</d2p1:OngoingNumber>
            <d2p1:Room>String</d2p1:Room>
          </d2p1:NutzeinheitDevice>
        </d2p1:NutzeinheitenDevices>
        <d2p1:Nutzer>
          <d2p1:Nutzer>
            <d2p1:EigentuemerBewohnt>String</d2p1:EigentuemerBewohnt>
            <d2p1:Email>String</d2p1:Email>
            <d2p1:Guid>00000000-0000-0000-0000-000000000000</d2p1:Guid>
            <d2p1:IsCreatedByApp>false</d2p1:IsCreatedByApp>
            <d2p1:IsDeleted>false</d2p1:IsDeleted>
            <d2p1:IstUvi>String</d2p1:IstUvi>
            <d2p1:Mobil>String</d2p1:Mobil>
            <d2p1:Name1>String</d2p1:Name1>
            <d2p1:Name2>String</d2p1:Name2>
            <d2p1:Name3>String</d2p1:Name3>
            <d2p1:Name4>String</d2p1:Name4>
            <d2p1:NutzeinheitNumberExternal>String</d2p1:NutzeinheitNumberExternal>
            <d2p1:NutzerInNutzeinheitSequence>0</d2p1:NutzerInNutzeinheitSequence>
            <d2p1:NutzerType>Leerstand</d2p1:NutzerType>
            <d2p1:RangeFrom>0001-01-01T00:00:00</d2p1:RangeFrom>
            <d2p1:RangeTo>0001-01-01T00:00:00</d2p1:RangeTo>
            <d2p1:Salutation>String</d2p1:Salutation>
            <d2p1:Title>String</d2p1:Title>
          </d2p1:Nutzer>
        </d2p1:Nutzer>
        <d2p1:OwnerNutzeinheiten>
          <d2p1:OwnerNutzeinheit>
            <d2p1:Address>
              <d2p1:Additional>String</d2p1:Additional>
              <d2p1:City>String</d2p1:City>
              <d2p1:Guid>00000000-0000-0000-0000-000000000000</d2p1:Guid>
              <d2p1:Mailbox>String</d2p1:Mailbox>
              <d2p1:Street>String</d2p1:Street>
              <d2p1:Street2>String</d2p1:Street2>
              <d2p1:StreetNumber>String</d2p1:StreetNumber>
              <d2p1:Zipcode>String</d2p1:Zipcode>
            </d2p1:Address>
            <d2p1:Guid>00000000-0000-0000-0000-000000000000</d2p1:Guid>
            <d2p1:Name1>String</d2p1:Name1>
            <d2p1:Name2>String</d2p1:Name2>
            <d2p1:Name3>String</d2p1:Name3>
            <d2p1:Name4>String</d2p1:Name4>
            <d2p1:RangeFrom>0001-01-01T00:00:00</d2p1:RangeFrom>
            <d2p1:RangeTo>0001-01-01T00:00:00</d2p1:RangeTo>
            <d2p1:Salutation>String</d2p1:Salutation>
            <d2p1:Title>String</d2p1:Title>
          </d2p1:OwnerNutzeinheit>
        </d2p1:OwnerNutzeinheiten>
      </d2p1:Nutzeinheit>
    </d2p1:Nutzeinheiten>
  </Objekt>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
</GetObjektResponse>