All Verbs | /RestApi/search/settings | ||
---|---|---|---|
GET | /RestApi/search/settings |
<?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 SettingsRequest implements JsonSerializable
{
public function __construct(
/** @var string */
public string $IndexId='',
/** @var string|null */
public ?string $SuggestionFields=null,
/** @var string|null */
public ?string $SectionName=null,
/** @var string|null */
public ?string $Text=null,
/** @var int */
public int $Take=0,
/** @var int */
public int $Skip=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['IndexId'])) $this->IndexId = $o['IndexId'];
if (isset($o['SuggestionFields'])) $this->SuggestionFields = $o['SuggestionFields'];
if (isset($o['SectionName'])) $this->SectionName = $o['SectionName'];
if (isset($o['Text'])) $this->Text = $o['Text'];
if (isset($o['Take'])) $this->Take = $o['Take'];
if (isset($o['Skip'])) $this->Skip = $o['Skip'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->IndexId)) $o['IndexId'] = $this->IndexId;
if (isset($this->SuggestionFields)) $o['SuggestionFields'] = $this->SuggestionFields;
if (isset($this->SectionName)) $o['SectionName'] = $this->SectionName;
if (isset($this->Text)) $o['Text'] = $this->Text;
if (isset($this->Take)) $o['Take'] = $this->Take;
if (isset($this->Skip)) $o['Skip'] = $this->Skip;
return empty($o) ? new class(){} : $o;
}
}
class SettingsResponse implements JsonSerializable
{
public function __construct(
/** @var SettingDto[]|null */
public ?array $Results=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Results'])) $this->Results = JsonConverters::fromArray('SettingDto', $o['Results']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Results)) $o['Results'] = JsonConverters::toArray('SettingDto', $this->Results);
return empty($o) ? new class(){} : $o;
}
}
class SettingDto implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Title=null,
/** @var string|null */
public ?string $SectionName=null,
/** @var string|null */
public ?string $FullSettingName=null,
/** @var array<string>|null */
public ?array $Path=null,
/** @var string|null */
public ?string $VisiblePath=null,
/** @var string|null */
public ?string $FullPath=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Title'])) $this->Title = $o['Title'];
if (isset($o['SectionName'])) $this->SectionName = $o['SectionName'];
if (isset($o['FullSettingName'])) $this->FullSettingName = $o['FullSettingName'];
if (isset($o['Path'])) $this->Path = JsonConverters::fromArray('string', $o['Path']);
if (isset($o['VisiblePath'])) $this->VisiblePath = $o['VisiblePath'];
if (isset($o['FullPath'])) $this->FullPath = $o['FullPath'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Title)) $o['Title'] = $this->Title;
if (isset($this->SectionName)) $o['SectionName'] = $this->SectionName;
if (isset($this->FullSettingName)) $o['FullSettingName'] = $this->FullSettingName;
if (isset($this->Path)) $o['Path'] = JsonConverters::toArray('string', $this->Path);
if (isset($this->VisiblePath)) $o['VisiblePath'] = $this->VisiblePath;
if (isset($this->FullPath)) $o['FullPath'] = $this->FullPath;
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /RestApi/search/settings HTTP/1.1
Host: www.asg.com.au
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<SettingsRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Telerik.Sitefinity.Search.Impl.Services.DTO">
<IndexId>00000000-0000-0000-0000-000000000000</IndexId>
<SectionName>String</SectionName>
<Skip>0</Skip>
<SuggestionFields>String</SuggestionFields>
<Take>0</Take>
<Text>String</Text>
</SettingsRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <SettingsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Telerik.Sitefinity.Search.Impl.Services.DTO"> <Results> <SettingDto> <FullPath>String</FullPath> <FullSettingName>String</FullSettingName> <Path xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" i:nil="true" /> <SectionName>String</SectionName> <Title>String</Title> <VisiblePath>String</VisiblePath> </SettingDto> </Results> </SettingsResponse>