Skip to content

Commit

Permalink
Regenerated from version 1.191.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
KSGRelewise committed Nov 29, 2024
1 parent 7aeb57b commit 8356bc6
Show file tree
Hide file tree
Showing 24 changed files with 918 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Generator/Generator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<ItemGroup>
<PackageReference Include="AngleSharp.Xml" Version="1.0.0" />
<PackageReference Include="Relewise.Client" Version="1.170.0" />
<PackageReference Include="Relewise.Client" Version="1.191.0" />
</ItemGroup>

</Project>
7 changes: 6 additions & 1 deletion Generator/XMLDocsFetcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static async Task<XmlDocumentation> Get(string package, string version)
{
seeReference.OuterHtml = seeReference.GetAttribute("cref")?.Split(".").Last() ?? seeReference.GetAttribute("langword")?.Split(".").Last() ?? string.Empty;
}

foreach (var member in document.GetElementsByTagName("doc")[0].Children[1].Children)
{
foreach (var child in member.Children)
Expand All @@ -55,6 +55,11 @@ public static async Task<XmlDocumentation> Get(string package, string version)
{
exampleWrapper.OuterHtml = exampleWrapper.InnerHtml.Trim();
}
foreach (var exampleWrapper in child.Children.Where(c => c.TagName == "SEEALSO"))
{
// We intentionally remove these tags entirely as there is no good way to present them in PHP. This is the same as saying that we don't support them in PHP.
exampleWrapper.OuterHtml = "";
}

result.Summaries.TryAdd(member.GetAttribute("name")!, HttpUtility.HtmlDecode(JoinInOneLine(child.InnerHtml)));
}
Expand Down
72 changes: 72 additions & 0 deletions src/Models/ContentContentHighlightPropsHighlightSettings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php declare(strict_types=1);

namespace Relewise\Models;

/** Encapsulates how search highlighting is to work. */
class ContentContentHighlightPropsHighlightSettings
{
/** If highlighting is enabled for search query. */
public bool $enabled;
/** The limits, f.e. how many result hits to process, how many 'snippets' to produce per-field/per-entry. */
public ContentContentHighlightPropsHighlightSettingsLimits $limit;
/** The properties to include in highlight. */
public ContentHighlightProps $highlightable;
/** The way highlights to be returned. Should it be indices of matches, or matched text with a few words around? */
public ContentContentHighlightPropsHighlightSettingsResponseShape $shape;

public static function create() : ContentContentHighlightPropsHighlightSettings
{
$result = new ContentContentHighlightPropsHighlightSettings();
return $result;
}

public static function hydrate(array $arr) : ContentContentHighlightPropsHighlightSettings
{
$result = new ContentContentHighlightPropsHighlightSettings();
if (array_key_exists("enabled", $arr))
{
$result->enabled = $arr["enabled"];
}
if (array_key_exists("limit", $arr))
{
$result->limit = ContentContentHighlightPropsHighlightSettingsLimits::hydrate($arr["limit"]);
}
if (array_key_exists("highlightable", $arr))
{
$result->highlightable = ContentHighlightProps::hydrate($arr["highlightable"]);
}
if (array_key_exists("shape", $arr))
{
$result->shape = ContentContentHighlightPropsHighlightSettingsResponseShape::hydrate($arr["shape"]);
}
return $result;
}

/** If highlighting is enabled for search query. */
function setEnabled(bool $enabled)
{
$this->enabled = $enabled;
return $this;
}

/** The limits, f.e. how many result hits to process, how many 'snippets' to produce per-field/per-entry. */
function setLimit(ContentContentHighlightPropsHighlightSettingsLimits $limit)
{
$this->limit = $limit;
return $this;
}

/** The properties to include in highlight. */
function setHighlightable(ContentHighlightProps $highlightable)
{
$this->highlightable = $highlightable;
return $this;
}

/** The way highlights to be returned. Should it be indices of matches, or matched text with a few words around? */
function setShape(ContentContentHighlightPropsHighlightSettingsResponseShape $shape)
{
$this->shape = $shape;
return $this;
}
}
59 changes: 59 additions & 0 deletions src/Models/ContentContentHighlightPropsHighlightSettingsLimits.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php declare(strict_types=1);

namespace Relewise\Models;

/** Limits for highlighting. */
class ContentContentHighlightPropsHighlightSettingsLimits
{
/** How many entries from search result to process? */
public ?int $maxEntryLimit;
/** How many snippets to return per matched search result across all fields? */
public ?int $maxSnippetsPerEntry;
/** How many snippets to return per matched search result single field? */
public ?int $maxSnippetsPerField;

public static function create() : ContentContentHighlightPropsHighlightSettingsLimits
{
$result = new ContentContentHighlightPropsHighlightSettingsLimits();
return $result;
}

public static function hydrate(array $arr) : ContentContentHighlightPropsHighlightSettingsLimits
{
$result = new ContentContentHighlightPropsHighlightSettingsLimits();
if (array_key_exists("maxEntryLimit", $arr))
{
$result->maxEntryLimit = $arr["maxEntryLimit"];
}
if (array_key_exists("maxSnippetsPerEntry", $arr))
{
$result->maxSnippetsPerEntry = $arr["maxSnippetsPerEntry"];
}
if (array_key_exists("maxSnippetsPerField", $arr))
{
$result->maxSnippetsPerField = $arr["maxSnippetsPerField"];
}
return $result;
}

/** How many entries from search result to process? */
function setMaxEntryLimit(?int $maxEntryLimit)
{
$this->maxEntryLimit = $maxEntryLimit;
return $this;
}

/** How many snippets to return per matched search result across all fields? */
function setMaxSnippetsPerEntry(?int $maxSnippetsPerEntry)
{
$this->maxSnippetsPerEntry = $maxSnippetsPerEntry;
return $this;
}

/** How many snippets to return per matched search result single field? */
function setMaxSnippetsPerField(?int $maxSnippetsPerField)
{
$this->maxSnippetsPerField = $maxSnippetsPerField;
return $this;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php declare(strict_types=1);

namespace Relewise\Models;

class ContentContentHighlightPropsHighlightSettingsResponseShape
{
/** If highlights should be presented as offsets/indices within inspected data values. */
public bool $includeOffsets;

public static function create() : ContentContentHighlightPropsHighlightSettingsResponseShape
{
$result = new ContentContentHighlightPropsHighlightSettingsResponseShape();
return $result;
}

public static function hydrate(array $arr) : ContentContentHighlightPropsHighlightSettingsResponseShape
{
$result = new ContentContentHighlightPropsHighlightSettingsResponseShape();
if (array_key_exists("includeOffsets", $arr))
{
$result->includeOffsets = $arr["includeOffsets"];
}
return $result;
}

/** If highlights should be presented as offsets/indices within inspected data values. */
function setIncludeOffsets(bool $includeOffsets)
{
$this->includeOffsets = $includeOffsets;
return $this;
}
}
69 changes: 69 additions & 0 deletions src/Models/ContentHighlightProperties.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?php declare(strict_types=1);

namespace Relewise\Models;

/** The properties to be included in highlighting. */
abstract class ContentHighlightProperties
{
public string $typeDefinition = "";
/** If highlights should include display name. */
public bool $displayName;
public array $dataKeys;


public static function hydrate(array $arr)
{
$type = $arr["\$type"];
if ($type=="Relewise.Client.Requests.Shared.Highlighting.ContentHighlightProps, Relewise.Client")
{
return ContentHighlightProps::hydrate($arr);
}
}

public static function hydrateBase(mixed $result, array $arr)
{
if (array_key_exists("displayName", $arr))
{
$result->displayName = $arr["displayName"];
}
if (array_key_exists("dataKeys", $arr))
{
$result->dataKeys = array();
foreach($arr["dataKeys"] as &$value)
{
array_push($result->dataKeys, $value);
}
}
return $result;
}

/** If highlights should include display name. */
function setDisplayName(bool $displayName)
{
$this->displayName = $displayName;
return $this;
}

function setDataKeys(string ... $dataKeys)
{
$this->dataKeys = $dataKeys;
return $this;
}

/** @param string[] $dataKeys new value. */
function setDataKeysFromArray(array $dataKeys)
{
$this->dataKeys = $dataKeys;
return $this;
}

function addToDataKeys(string $dataKeys)
{
if (!isset($this->dataKeys))
{
$this->dataKeys = array();
}
array_push($this->dataKeys, $dataKeys);
return $this;
}
}
48 changes: 48 additions & 0 deletions src/Models/ContentHighlightProps.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php declare(strict_types=1);

namespace Relewise\Models;

class ContentHighlightProps extends ContentHighlightProperties
{
public string $typeDefinition = "Relewise.Client.Requests.Shared.Highlighting.ContentHighlightProps, Relewise.Client";
public static function create() : ContentHighlightProps
{
$result = new ContentHighlightProps();
return $result;
}

public static function hydrate(array $arr) : ContentHighlightProps
{
$result = ContentHighlightProperties::hydrateBase(new ContentHighlightProps(), $arr);
return $result;
}

function setDisplayName(bool $displayName)
{
$this->displayName = $displayName;
return $this;
}

function setDataKeys(string ... $dataKeys)
{
$this->dataKeys = $dataKeys;
return $this;
}

/** @param string[] $dataKeys new value. */
function setDataKeysFromArray(array $dataKeys)
{
$this->dataKeys = $dataKeys;
return $this;
}

function addToDataKeys(string $dataKeys)
{
if (!isset($this->dataKeys))
{
$this->dataKeys = array();
}
array_push($this->dataKeys, $dataKeys);
return $this;
}
}
11 changes: 11 additions & 0 deletions src/Models/ContentResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class ContentResult
public array $data;
public array $categoryPaths;
public ViewedByUserInfo $viewedByUser;
public ?HighlightResult $highlight;

public static function create(string $contentId, int $rank) : ContentResult
{
Expand Down Expand Up @@ -63,6 +64,10 @@ public static function hydrate(array $arr) : ContentResult
{
$result->viewedByUser = ViewedByUserInfo::hydrate($arr["viewedByUser"]);
}
if (array_key_exists("highlight", $arr))
{
$result->highlight = HighlightResult::hydrate($arr["highlight"]);
}
return $result;
}

Expand Down Expand Up @@ -152,4 +157,10 @@ function setViewedByUser(ViewedByUserInfo $viewedByUser)
$this->viewedByUser = $viewedByUser;
return $this;
}

function setHighlight(?HighlightResult $highlight)
{
$this->highlight = $highlight;
return $this;
}
}
11 changes: 11 additions & 0 deletions src/Models/ContentSearchSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class ContentSearchSettings extends SearchSettings
public string $typeDefinition = "Relewise.Client.Requests.Search.Settings.ContentSearchSettings, Relewise.Client";
public ?SelectedContentPropertiesSettings $selectedContentProperties;
public RecommendationSettings $recommendations;
public ?ContentSearchSettingsHighlightSettings $highlight;

public static function create() : ContentSearchSettings
{
Expand All @@ -25,6 +26,10 @@ public static function hydrate(array $arr) : ContentSearchSettings
{
$result->recommendations = RecommendationSettings::hydrate($arr["recommendations"]);
}
if (array_key_exists("highlight", $arr))
{
$result->highlight = ContentSearchSettingsHighlightSettings::hydrate($arr["highlight"]);
}
return $result;
}

Expand All @@ -39,4 +44,10 @@ function setRecommendations(RecommendationSettings $recommendations)
$this->recommendations = $recommendations;
return $this;
}

function setHighlight(?ContentSearchSettingsHighlightSettings $highlight)
{
$this->highlight = $highlight;
return $this;
}
}
Loading

0 comments on commit 8356bc6

Please sign in to comment.