<back to all web services

SitemapSettingsMessage

The following routes are available for this service:
All Verbs/RestApi/sitefinity/sitemap/settings
All Verbs/RestApi/sitefinity/sitemap/settings/{Id}
<?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 SitemapGenerationCondition : string
{
    case Daily = 'Daily';
    case Weekly = 'Weekly';
    case Manual = 'Manual';
}

class SitemapSettings implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $IsEnabled=null,
        /** @var int */
        public int $UrlLimit=0,
        /** @var bool|null */
        public ?bool $Compress=null,
        /** @var SitemapGenerationCondition|null */
        public ?SitemapGenerationCondition $Condition=null,
        /** @var int */
        public int $DayToStart=0,
        /** @var DateTime */
        public DateTime $TimeToStart=new DateTime(),
        /** @var string */
        public string $SiteId='',
        /** @var string|null */
        public ?string $LastExecutionTime=null,
        /** @var string|null */
        public ?string $LastError=null,
        /** @var bool|null */
        public ?bool $PingGoogle=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['IsEnabled'])) $this->IsEnabled = $o['IsEnabled'];
        if (isset($o['UrlLimit'])) $this->UrlLimit = $o['UrlLimit'];
        if (isset($o['Compress'])) $this->Compress = $o['Compress'];
        if (isset($o['Condition'])) $this->Condition = JsonConverters::from('SitemapGenerationCondition', $o['Condition']);
        if (isset($o['DayToStart'])) $this->DayToStart = $o['DayToStart'];
        if (isset($o['TimeToStart'])) $this->TimeToStart = JsonConverters::from('DateTime', $o['TimeToStart']);
        if (isset($o['SiteId'])) $this->SiteId = $o['SiteId'];
        if (isset($o['LastExecutionTime'])) $this->LastExecutionTime = $o['LastExecutionTime'];
        if (isset($o['LastError'])) $this->LastError = $o['LastError'];
        if (isset($o['PingGoogle'])) $this->PingGoogle = $o['PingGoogle'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->IsEnabled)) $o['IsEnabled'] = $this->IsEnabled;
        if (isset($this->UrlLimit)) $o['UrlLimit'] = $this->UrlLimit;
        if (isset($this->Compress)) $o['Compress'] = $this->Compress;
        if (isset($this->Condition)) $o['Condition'] = JsonConverters::to('SitemapGenerationCondition', $this->Condition);
        if (isset($this->DayToStart)) $o['DayToStart'] = $this->DayToStart;
        if (isset($this->TimeToStart)) $o['TimeToStart'] = JsonConverters::to('DateTime', $this->TimeToStart);
        if (isset($this->SiteId)) $o['SiteId'] = $this->SiteId;
        if (isset($this->LastExecutionTime)) $o['LastExecutionTime'] = $this->LastExecutionTime;
        if (isset($this->LastError)) $o['LastError'] = $this->LastError;
        if (isset($this->PingGoogle)) $o['PingGoogle'] = $this->PingGoogle;
        return empty($o) ? new class(){} : $o;
    }
}

class SitemapSettingsMessage implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $Id='',
        /** @var SitemapSettings|null */
        public ?SitemapSettings $Item=null
    ) {
    }

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

class SitemapSettingsContext implements JsonSerializable
{
    public function __construct(
        /** @var SitemapSettings|null */
        public ?SitemapSettings $Item=null
    ) {
    }

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

PHP SitemapSettingsMessage DTOs

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

HTTP + JSV

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

POST /RestApi/sitefinity/sitemap/settings HTTP/1.1 
Host: www.asg.com.au 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Item: 
	{
		IsEnabled: False,
		UrlLimit: 0,
		Compress: False,
		Condition: Daily,
		DayToStart: 0,
		TimeToStart: 0001-01-01,
		LastExecutionTime: String,
		LastError: String,
		PingGoogle: False
	}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Item: 
	{
		IsEnabled: False,
		UrlLimit: 0,
		Compress: False,
		Condition: Daily,
		DayToStart: 0,
		TimeToStart: 0001-01-01,
		LastExecutionTime: String,
		LastError: String,
		PingGoogle: False
	}
}