Skip to content

Commit 0d15d34

Browse files
authored
Regenerated from version 1.191.0. (#40)
1 parent 7aeb57b commit 0d15d34

24 files changed

+918
-4
lines changed

Generator/Generator.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<ItemGroup>
1111
<PackageReference Include="AngleSharp.Xml" Version="1.0.0" />
12-
<PackageReference Include="Relewise.Client" Version="1.170.0" />
12+
<PackageReference Include="Relewise.Client" Version="1.191.0" />
1313
</ItemGroup>
1414

1515
</Project>

Generator/XMLDocsFetcher.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public static async Task<XmlDocumentation> Get(string package, string version)
3232
{
3333
seeReference.OuterHtml = seeReference.GetAttribute("cref")?.Split(".").Last() ?? seeReference.GetAttribute("langword")?.Split(".").Last() ?? string.Empty;
3434
}
35-
35+
3636
foreach (var member in document.GetElementsByTagName("doc")[0].Children[1].Children)
3737
{
3838
foreach (var child in member.Children)
@@ -55,6 +55,11 @@ public static async Task<XmlDocumentation> Get(string package, string version)
5555
{
5656
exampleWrapper.OuterHtml = exampleWrapper.InnerHtml.Trim();
5757
}
58+
foreach (var exampleWrapper in child.Children.Where(c => c.TagName == "SEEALSO"))
59+
{
60+
// 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.
61+
exampleWrapper.OuterHtml = "";
62+
}
5863

5964
result.Summaries.TryAdd(member.GetAttribute("name")!, HttpUtility.HtmlDecode(JoinInOneLine(child.InnerHtml)));
6065
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace Relewise\Models;
4+
5+
/** Encapsulates how search highlighting is to work. */
6+
class ContentContentHighlightPropsHighlightSettings
7+
{
8+
/** If highlighting is enabled for search query. */
9+
public bool $enabled;
10+
/** The limits, f.e. how many result hits to process, how many 'snippets' to produce per-field/per-entry. */
11+
public ContentContentHighlightPropsHighlightSettingsLimits $limit;
12+
/** The properties to include in highlight. */
13+
public ContentHighlightProps $highlightable;
14+
/** The way highlights to be returned. Should it be indices of matches, or matched text with a few words around? */
15+
public ContentContentHighlightPropsHighlightSettingsResponseShape $shape;
16+
17+
public static function create() : ContentContentHighlightPropsHighlightSettings
18+
{
19+
$result = new ContentContentHighlightPropsHighlightSettings();
20+
return $result;
21+
}
22+
23+
public static function hydrate(array $arr) : ContentContentHighlightPropsHighlightSettings
24+
{
25+
$result = new ContentContentHighlightPropsHighlightSettings();
26+
if (array_key_exists("enabled", $arr))
27+
{
28+
$result->enabled = $arr["enabled"];
29+
}
30+
if (array_key_exists("limit", $arr))
31+
{
32+
$result->limit = ContentContentHighlightPropsHighlightSettingsLimits::hydrate($arr["limit"]);
33+
}
34+
if (array_key_exists("highlightable", $arr))
35+
{
36+
$result->highlightable = ContentHighlightProps::hydrate($arr["highlightable"]);
37+
}
38+
if (array_key_exists("shape", $arr))
39+
{
40+
$result->shape = ContentContentHighlightPropsHighlightSettingsResponseShape::hydrate($arr["shape"]);
41+
}
42+
return $result;
43+
}
44+
45+
/** If highlighting is enabled for search query. */
46+
function setEnabled(bool $enabled)
47+
{
48+
$this->enabled = $enabled;
49+
return $this;
50+
}
51+
52+
/** The limits, f.e. how many result hits to process, how many 'snippets' to produce per-field/per-entry. */
53+
function setLimit(ContentContentHighlightPropsHighlightSettingsLimits $limit)
54+
{
55+
$this->limit = $limit;
56+
return $this;
57+
}
58+
59+
/** The properties to include in highlight. */
60+
function setHighlightable(ContentHighlightProps $highlightable)
61+
{
62+
$this->highlightable = $highlightable;
63+
return $this;
64+
}
65+
66+
/** The way highlights to be returned. Should it be indices of matches, or matched text with a few words around? */
67+
function setShape(ContentContentHighlightPropsHighlightSettingsResponseShape $shape)
68+
{
69+
$this->shape = $shape;
70+
return $this;
71+
}
72+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace Relewise\Models;
4+
5+
/** Limits for highlighting. */
6+
class ContentContentHighlightPropsHighlightSettingsLimits
7+
{
8+
/** How many entries from search result to process? */
9+
public ?int $maxEntryLimit;
10+
/** How many snippets to return per matched search result across all fields? */
11+
public ?int $maxSnippetsPerEntry;
12+
/** How many snippets to return per matched search result single field? */
13+
public ?int $maxSnippetsPerField;
14+
15+
public static function create() : ContentContentHighlightPropsHighlightSettingsLimits
16+
{
17+
$result = new ContentContentHighlightPropsHighlightSettingsLimits();
18+
return $result;
19+
}
20+
21+
public static function hydrate(array $arr) : ContentContentHighlightPropsHighlightSettingsLimits
22+
{
23+
$result = new ContentContentHighlightPropsHighlightSettingsLimits();
24+
if (array_key_exists("maxEntryLimit", $arr))
25+
{
26+
$result->maxEntryLimit = $arr["maxEntryLimit"];
27+
}
28+
if (array_key_exists("maxSnippetsPerEntry", $arr))
29+
{
30+
$result->maxSnippetsPerEntry = $arr["maxSnippetsPerEntry"];
31+
}
32+
if (array_key_exists("maxSnippetsPerField", $arr))
33+
{
34+
$result->maxSnippetsPerField = $arr["maxSnippetsPerField"];
35+
}
36+
return $result;
37+
}
38+
39+
/** How many entries from search result to process? */
40+
function setMaxEntryLimit(?int $maxEntryLimit)
41+
{
42+
$this->maxEntryLimit = $maxEntryLimit;
43+
return $this;
44+
}
45+
46+
/** How many snippets to return per matched search result across all fields? */
47+
function setMaxSnippetsPerEntry(?int $maxSnippetsPerEntry)
48+
{
49+
$this->maxSnippetsPerEntry = $maxSnippetsPerEntry;
50+
return $this;
51+
}
52+
53+
/** How many snippets to return per matched search result single field? */
54+
function setMaxSnippetsPerField(?int $maxSnippetsPerField)
55+
{
56+
$this->maxSnippetsPerField = $maxSnippetsPerField;
57+
return $this;
58+
}
59+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace Relewise\Models;
4+
5+
class ContentContentHighlightPropsHighlightSettingsResponseShape
6+
{
7+
/** If highlights should be presented as offsets/indices within inspected data values. */
8+
public bool $includeOffsets;
9+
10+
public static function create() : ContentContentHighlightPropsHighlightSettingsResponseShape
11+
{
12+
$result = new ContentContentHighlightPropsHighlightSettingsResponseShape();
13+
return $result;
14+
}
15+
16+
public static function hydrate(array $arr) : ContentContentHighlightPropsHighlightSettingsResponseShape
17+
{
18+
$result = new ContentContentHighlightPropsHighlightSettingsResponseShape();
19+
if (array_key_exists("includeOffsets", $arr))
20+
{
21+
$result->includeOffsets = $arr["includeOffsets"];
22+
}
23+
return $result;
24+
}
25+
26+
/** If highlights should be presented as offsets/indices within inspected data values. */
27+
function setIncludeOffsets(bool $includeOffsets)
28+
{
29+
$this->includeOffsets = $includeOffsets;
30+
return $this;
31+
}
32+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace Relewise\Models;
4+
5+
/** The properties to be included in highlighting. */
6+
abstract class ContentHighlightProperties
7+
{
8+
public string $typeDefinition = "";
9+
/** If highlights should include display name. */
10+
public bool $displayName;
11+
public array $dataKeys;
12+
13+
14+
public static function hydrate(array $arr)
15+
{
16+
$type = $arr["\$type"];
17+
if ($type=="Relewise.Client.Requests.Shared.Highlighting.ContentHighlightProps, Relewise.Client")
18+
{
19+
return ContentHighlightProps::hydrate($arr);
20+
}
21+
}
22+
23+
public static function hydrateBase(mixed $result, array $arr)
24+
{
25+
if (array_key_exists("displayName", $arr))
26+
{
27+
$result->displayName = $arr["displayName"];
28+
}
29+
if (array_key_exists("dataKeys", $arr))
30+
{
31+
$result->dataKeys = array();
32+
foreach($arr["dataKeys"] as &$value)
33+
{
34+
array_push($result->dataKeys, $value);
35+
}
36+
}
37+
return $result;
38+
}
39+
40+
/** If highlights should include display name. */
41+
function setDisplayName(bool $displayName)
42+
{
43+
$this->displayName = $displayName;
44+
return $this;
45+
}
46+
47+
function setDataKeys(string ... $dataKeys)
48+
{
49+
$this->dataKeys = $dataKeys;
50+
return $this;
51+
}
52+
53+
/** @param string[] $dataKeys new value. */
54+
function setDataKeysFromArray(array $dataKeys)
55+
{
56+
$this->dataKeys = $dataKeys;
57+
return $this;
58+
}
59+
60+
function addToDataKeys(string $dataKeys)
61+
{
62+
if (!isset($this->dataKeys))
63+
{
64+
$this->dataKeys = array();
65+
}
66+
array_push($this->dataKeys, $dataKeys);
67+
return $this;
68+
}
69+
}

src/Models/ContentHighlightProps.php

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace Relewise\Models;
4+
5+
class ContentHighlightProps extends ContentHighlightProperties
6+
{
7+
public string $typeDefinition = "Relewise.Client.Requests.Shared.Highlighting.ContentHighlightProps, Relewise.Client";
8+
public static function create() : ContentHighlightProps
9+
{
10+
$result = new ContentHighlightProps();
11+
return $result;
12+
}
13+
14+
public static function hydrate(array $arr) : ContentHighlightProps
15+
{
16+
$result = ContentHighlightProperties::hydrateBase(new ContentHighlightProps(), $arr);
17+
return $result;
18+
}
19+
20+
function setDisplayName(bool $displayName)
21+
{
22+
$this->displayName = $displayName;
23+
return $this;
24+
}
25+
26+
function setDataKeys(string ... $dataKeys)
27+
{
28+
$this->dataKeys = $dataKeys;
29+
return $this;
30+
}
31+
32+
/** @param string[] $dataKeys new value. */
33+
function setDataKeysFromArray(array $dataKeys)
34+
{
35+
$this->dataKeys = $dataKeys;
36+
return $this;
37+
}
38+
39+
function addToDataKeys(string $dataKeys)
40+
{
41+
if (!isset($this->dataKeys))
42+
{
43+
$this->dataKeys = array();
44+
}
45+
array_push($this->dataKeys, $dataKeys);
46+
return $this;
47+
}
48+
}

src/Models/ContentResult.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class ContentResult
1111
public array $data;
1212
public array $categoryPaths;
1313
public ViewedByUserInfo $viewedByUser;
14+
public ?HighlightResult $highlight;
1415

1516
public static function create(string $contentId, int $rank) : ContentResult
1617
{
@@ -63,6 +64,10 @@ public static function hydrate(array $arr) : ContentResult
6364
{
6465
$result->viewedByUser = ViewedByUserInfo::hydrate($arr["viewedByUser"]);
6566
}
67+
if (array_key_exists("highlight", $arr))
68+
{
69+
$result->highlight = HighlightResult::hydrate($arr["highlight"]);
70+
}
6671
return $result;
6772
}
6873

@@ -152,4 +157,10 @@ function setViewedByUser(ViewedByUserInfo $viewedByUser)
152157
$this->viewedByUser = $viewedByUser;
153158
return $this;
154159
}
160+
161+
function setHighlight(?HighlightResult $highlight)
162+
{
163+
$this->highlight = $highlight;
164+
return $this;
165+
}
155166
}

src/Models/ContentSearchSettings.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class ContentSearchSettings extends SearchSettings
77
public string $typeDefinition = "Relewise.Client.Requests.Search.Settings.ContentSearchSettings, Relewise.Client";
88
public ?SelectedContentPropertiesSettings $selectedContentProperties;
99
public RecommendationSettings $recommendations;
10+
public ?ContentSearchSettingsHighlightSettings $highlight;
1011

1112
public static function create() : ContentSearchSettings
1213
{
@@ -25,6 +26,10 @@ public static function hydrate(array $arr) : ContentSearchSettings
2526
{
2627
$result->recommendations = RecommendationSettings::hydrate($arr["recommendations"]);
2728
}
29+
if (array_key_exists("highlight", $arr))
30+
{
31+
$result->highlight = ContentSearchSettingsHighlightSettings::hydrate($arr["highlight"]);
32+
}
2833
return $result;
2934
}
3035

@@ -39,4 +44,10 @@ function setRecommendations(RecommendationSettings $recommendations)
3944
$this->recommendations = $recommendations;
4045
return $this;
4146
}
47+
48+
function setHighlight(?ContentSearchSettingsHighlightSettings $highlight)
49+
{
50+
$this->highlight = $highlight;
51+
return $this;
52+
}
4253
}

0 commit comments

Comments
 (0)