Add setters to LinkPreviewOptions

This commit is contained in:
netkas 2024-10-07 13:03:47 -04:00
parent b3d26446e6
commit 9a3d0b8188

View file

@ -17,11 +17,21 @@ class LinkPreviewOptions implements ObjectTypeInterface
* *
* @return bool * @return bool
*/ */
public function getIsDisabled(): bool public function isDisabled(): bool
{ {
return $this->is_disabled; return $this->is_disabled;
} }
/**
* Sets the value of is_disabled
*
* @param bool $is_disabled
*/
public function setIsDisabled(bool $is_disabled): void
{
$this->is_disabled = $is_disabled;
}
/** /**
* Optional. URL to use for the link preview. If empty, then the first URL found in the message text will be used * Optional. URL to use for the link preview. If empty, then the first URL found in the message text will be used
* *
@ -32,6 +42,16 @@ class LinkPreviewOptions implements ObjectTypeInterface
return $this->url; return $this->url;
} }
/**
* Sets the value of url
*
* @param string|null $url
*/
public function setUrl(?string $url): void
{
$this->url = $url;
}
/** /**
* Optional. True, if the media in the link preview is supposed to be shrunk; ignored if the URL isn't * Optional. True, if the media in the link preview is supposed to be shrunk; ignored if the URL isn't
* explicitly specified or media size change isn't supported for the preview * explicitly specified or media size change isn't supported for the preview
@ -43,6 +63,16 @@ class LinkPreviewOptions implements ObjectTypeInterface
return $this->prefer_small_media; return $this->prefer_small_media;
} }
/**
* Sets the value of prefer_small_media
*
* @param bool $prefer_small_media
*/
public function setPreferSmallMedia(bool $prefer_small_media): void
{
$this->prefer_small_media = $prefer_small_media;
}
/** /**
* Optional. True, if the media in the link preview is supposed to be enlarged; * Optional. True, if the media in the link preview is supposed to be enlarged;
* ignored if the URL isn't explicitly specified or media size change isn't supported for the preview * ignored if the URL isn't explicitly specified or media size change isn't supported for the preview
@ -54,6 +84,16 @@ class LinkPreviewOptions implements ObjectTypeInterface
return $this->prefer_large_media; return $this->prefer_large_media;
} }
/**
* Sets the value of prefer_large_media
*
* @param bool $prefer_large_media
*/
public function setPreferLargeMedia(bool $prefer_large_media): void
{
$this->prefer_large_media = $prefer_large_media;
}
/** /**
* Optional. True, if the link preview must be shown above the message text; otherwise, * Optional. True, if the link preview must be shown above the message text; otherwise,
* the link preview will be shown below the message text * the link preview will be shown below the message text
@ -65,6 +105,16 @@ class LinkPreviewOptions implements ObjectTypeInterface
return $this->show_above_text; return $this->show_above_text;
} }
/**
* Sets the value of show_above_text
*
* @param bool $show_above_text
*/
public function setShowAboveText(bool $show_above_text): void
{
$this->show_above_text = $show_above_text;
}
/** /**
* @inheritDoc * @inheritDoc
*/ */