<back to all web services

CommentUpdateRequest

The following routes are available for this service:
PUT/RestApi/comments-api/comments
<?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 CommentUpdateRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Key=null,
        /** @var string|null */
        public ?string $Message=null,
        /** @var string|null */
        public ?string $Status=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Email=null,
        /** @var string|null */
        public ?string $CustomData=null,
        /** @var float|null */
        public ?float $Rating=null
    ) {
    }

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

class CommentResponse implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Key=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Message=null,
        /** @var DateTime */
        public DateTime $DateCreated=new DateTime(),
        /** @var string|null */
        public ?string $ProfilePictureUrl=null,
        /** @var string|null */
        public ?string $ProfilePictureThumbnailUrl=null,
        /** @var string|null */
        public ?string $Status=null,
        /** @var string|null */
        public ?string $Email=null,
        /** @var string|null */
        public ?string $ThreadKey=null,
        /** @var string|null */
        public ?string $AuthorIpAddress=null,
        /** @var string|null */
        public ?string $CustomData=null,
        /** @var float|null */
        public ?float $Rating=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Key'])) $this->Key = $o['Key'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Message'])) $this->Message = $o['Message'];
        if (isset($o['DateCreated'])) $this->DateCreated = JsonConverters::from('DateTime', $o['DateCreated']);
        if (isset($o['ProfilePictureUrl'])) $this->ProfilePictureUrl = $o['ProfilePictureUrl'];
        if (isset($o['ProfilePictureThumbnailUrl'])) $this->ProfilePictureThumbnailUrl = $o['ProfilePictureThumbnailUrl'];
        if (isset($o['Status'])) $this->Status = $o['Status'];
        if (isset($o['Email'])) $this->Email = $o['Email'];
        if (isset($o['ThreadKey'])) $this->ThreadKey = $o['ThreadKey'];
        if (isset($o['AuthorIpAddress'])) $this->AuthorIpAddress = $o['AuthorIpAddress'];
        if (isset($o['CustomData'])) $this->CustomData = $o['CustomData'];
        if (isset($o['Rating'])) $this->Rating = $o['Rating'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Key)) $o['Key'] = $this->Key;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Message)) $o['Message'] = $this->Message;
        if (isset($this->DateCreated)) $o['DateCreated'] = JsonConverters::to('DateTime', $this->DateCreated);
        if (isset($this->ProfilePictureUrl)) $o['ProfilePictureUrl'] = $this->ProfilePictureUrl;
        if (isset($this->ProfilePictureThumbnailUrl)) $o['ProfilePictureThumbnailUrl'] = $this->ProfilePictureThumbnailUrl;
        if (isset($this->Status)) $o['Status'] = $this->Status;
        if (isset($this->Email)) $o['Email'] = $this->Email;
        if (isset($this->ThreadKey)) $o['ThreadKey'] = $this->ThreadKey;
        if (isset($this->AuthorIpAddress)) $o['AuthorIpAddress'] = $this->AuthorIpAddress;
        if (isset($this->CustomData)) $o['CustomData'] = $this->CustomData;
        if (isset($this->Rating)) $o['Rating'] = $this->Rating;
        return empty($o) ? new class(){} : $o;
    }
}

PHP CommentUpdateRequest 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.

PUT /RestApi/comments-api/comments HTTP/1.1 
Host: www.asg.com.au 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"Key":"String","Message":"String","Status":"String","Name":"String","Email":"String","CustomData":"String","Rating":0}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Key":"String","Name":"String","Message":"String","DateCreated":"\/Date(-62135596800000-0000)\/","ProfilePictureUrl":"String","ProfilePictureThumbnailUrl":"String","Status":"String","Email":"String","ThreadKey":"String","AuthorIpAddress":"String","CustomData":"String","Rating":0}