WebService

<back to all web services

UpdateActionRequest

<?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 UpdateAction : string
{
    case doCheckVersion = 'doCheckVersion';
    case doNothing = 'doNothing';
    case doUpdate = 'doUpdate';
    case doDowngrade = 'doDowngrade';
    case sendVersionlist = 'sendVersionlist';
    case delete = 'delete';
    case install = 'install';
    case execute = 'execute';
    case copy = 'copy';
    case move = 'move';
    case Error = 'Error';
}

class ModulVersionsInfo implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Modul=null,
        /** @var string|null */
        public ?string $PruefAssembly=null,
        /** @var bool|null */
        public ?bool $istTestVersion=null,
        /** @var bool|null */
        public ?bool $istDisabled=null,
        /** @var string|null */
        public ?string $URL=null,
        /** @var bool|null */
        public ?bool $willTestVersion=null,
        /** @var int */
        public int $Major=0,
        /** @var int */
        public int $Minor=0,
        /** @var int */
        public int $Build=0,
        /** @var int */
        public int $Revision=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Modul'])) $this->Modul = $o['Modul'];
        if (isset($o['PruefAssembly'])) $this->PruefAssembly = $o['PruefAssembly'];
        if (isset($o['istTestVersion'])) $this->istTestVersion = $o['istTestVersion'];
        if (isset($o['istDisabled'])) $this->istDisabled = $o['istDisabled'];
        if (isset($o['URL'])) $this->URL = $o['URL'];
        if (isset($o['willTestVersion'])) $this->willTestVersion = $o['willTestVersion'];
        if (isset($o['Major'])) $this->Major = $o['Major'];
        if (isset($o['Minor'])) $this->Minor = $o['Minor'];
        if (isset($o['Build'])) $this->Build = $o['Build'];
        if (isset($o['Revision'])) $this->Revision = $o['Revision'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Modul)) $o['Modul'] = $this->Modul;
        if (isset($this->PruefAssembly)) $o['PruefAssembly'] = $this->PruefAssembly;
        if (isset($this->istTestVersion)) $o['istTestVersion'] = $this->istTestVersion;
        if (isset($this->istDisabled)) $o['istDisabled'] = $this->istDisabled;
        if (isset($this->URL)) $o['URL'] = $this->URL;
        if (isset($this->willTestVersion)) $o['willTestVersion'] = $this->willTestVersion;
        if (isset($this->Major)) $o['Major'] = $this->Major;
        if (isset($this->Minor)) $o['Minor'] = $this->Minor;
        if (isset($this->Build)) $o['Build'] = $this->Build;
        if (isset($this->Revision)) $o['Revision'] = $this->Revision;
        return empty($o) ? new class(){} : $o;
    }
}

class UpdateActionResponse implements JsonSerializable
{
    public function __construct(
        /** @var UpdateAction|null */
        public ?UpdateAction $Answer=null,
        /** @var string|null */
        public ?string $AnswerInfo1=null,
        /** @var string|null */
        public ?string $AnswerInfo2=null,
        /** @var array<string,ModulVersionsInfo>|null */
        public ?array $ModulVersionen=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Answer'])) $this->Answer = JsonConverters::from('UpdateAction', $o['Answer']);
        if (isset($o['AnswerInfo1'])) $this->AnswerInfo1 = $o['AnswerInfo1'];
        if (isset($o['AnswerInfo2'])) $this->AnswerInfo2 = $o['AnswerInfo2'];
        if (isset($o['ModulVersionen'])) $this->ModulVersionen = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','ModulVersionsInfo']), $o['ModulVersionen']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Answer)) $o['Answer'] = JsonConverters::to('UpdateAction', $this->Answer);
        if (isset($this->AnswerInfo1)) $o['AnswerInfo1'] = $this->AnswerInfo1;
        if (isset($this->AnswerInfo2)) $o['AnswerInfo2'] = $this->AnswerInfo2;
        if (isset($this->ModulVersionen)) $o['ModulVersionen'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','ModulVersionsInfo']), $this->ModulVersionen);
        return empty($o) ? new class(){} : $o;
    }
}

class UpdateActionRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $CryptedLicenseNr=null,
        /** @var string|null */
        public ?string $CryptedStamp=null,
        /** @var UpdateAction|null */
        public ?UpdateAction $Action=null
    ) {
    }

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

PHP UpdateActionRequest DTOs

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

HTTP + OTHER

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

POST /jsonl/reply/UpdateActionRequest HTTP/1.1 
Host: 52.142.207.43 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"CryptedLicenseNr":"String","CryptedStamp":"String","Action":"doCheckVersion"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Answer":"doCheckVersion","AnswerInfo1":"String","AnswerInfo2":"String","ModulVersionen":{"String":{"Modul":"String","PruefAssembly":"String","istTestVersion":false,"istDisabled":false,"URL":"String","willTestVersion":false,"Major":0,"Minor":0,"Build":0,"Revision":0}}}