-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerated from version 1.191.0. (#40)
- Loading branch information
1 parent
7aeb57b
commit 0d15d34
Showing
24 changed files
with
918 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
src/Models/ContentContentHighlightPropsHighlightSettings.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
59
src/Models/ContentContentHighlightPropsHighlightSettingsLimits.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/Models/ContentContentHighlightPropsHighlightSettingsResponseShape.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.