Code fixes in \TgBotLib\Objects\Telegram\InlineQueryResult > InlineQueryResultVenue

This commit is contained in:
Netkas 2023-08-09 19:40:37 -04:00
parent 77ce3969aa
commit 1deb1aaa6c
No known key found for this signature in database
GPG key ID: 5DAF58535614062B
4 changed files with 180 additions and 6 deletions

View file

@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Build" type="MAKEFILE_TARGET_RUN_CONFIGURATION" factoryName="Makefile">
<configuration default="false" name="Build" type="MAKEFILE_TARGET_RUN_CONFIGURATION" factoryName="Makefile" activateToolWindowBeforeRun="false">
<makefile filename="$PROJECT_DIR$/Makefile" target="build" workingDirectory="" arguments="">
<envs />
</makefile>

View file

@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Clean" type="MAKEFILE_TARGET_RUN_CONFIGURATION" factoryName="Makefile">
<configuration default="false" name="Clean" type="MAKEFILE_TARGET_RUN_CONFIGURATION" factoryName="Makefile" activateToolWindowBeforeRun="false">
<makefile filename="$PROJECT_DIR$/Makefile" target="clean" workingDirectory="" arguments="">
<envs />
</makefile>

View file

@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Install" type="MAKEFILE_TARGET_RUN_CONFIGURATION" factoryName="Makefile">
<configuration default="false" name="Install" type="MAKEFILE_TARGET_RUN_CONFIGURATION" factoryName="Makefile" activateToolWindowBeforeRun="false">
<makefile filename="$PROJECT_DIR$/Makefile" target="install" workingDirectory="" arguments="">
<envs />
</makefile>

View file

@ -1,9 +1,10 @@
<?php
<?php /** @noinspection PhpUnused */
/** @noinspection PhpMissingFieldTypeInspection */
/** @noinspection PhpMissingFieldTypeInspection */
namespace TgBotLib\Objects\Telegram\InlineQueryResult;
use InvalidArgumentException;
use TgBotLib\Interfaces\ObjectTypeInterface;
use TgBotLib\Objects\Telegram\InlineKeyboardMarkup;
use TgBotLib\Objects\Telegram\InputMessageContent\InputContactMessageContent;
@ -117,6 +118,23 @@
return $this->id;
}
/**
* Sets id.
*
* @param string $id
* @return $this
*/
public function setId(string $id): InlineQueryResultVenue
{
if(strlen($id) > 64)
{
throw new InvalidArgumentException('id must be between 1 and 64 characters');
}
$this->id = $id;
return $this;
}
/**
* Latitude of the venue location in degrees
*
@ -127,6 +145,18 @@
return $this->latitude;
}
/**
* Sets the latitude of the venue location in degrees
*
* @param float $latitude
* @return $this
*/
public function setLatitude(float $latitude): InlineQueryResultVenue
{
$this->latitude = $latitude;
return $this;
}
/**
* Longitude of the venue location in degrees
*
@ -137,6 +167,18 @@
return $this->longitude;
}
/**
* Sets the longitude of the venue location in degrees
*
* @param float $longitude
* @return $this
*/
public function setLongitude(float $longitude): InlineQueryResultVenue
{
$this->longitude = $longitude;
return $this;
}
/**
* Title of the venue
*
@ -147,6 +189,18 @@
return $this->title;
}
/**
* Sets the title of the venue
*
* @param string $title
* @return $this
*/
public function setTitle(string $title): InlineQueryResultVenue
{
$this->title = $title;
return $this;
}
/**
* Address of the venue
*
@ -157,6 +211,18 @@
return $this->address;
}
/**
* Sets the address of the venue
*
* @param string $address
* @return $this
*/
public function setAddress(string $address): InlineQueryResultVenue
{
$this->address = $address;
return $this;
}
/**
* Optional. Foursquare identifier of the venue if known
*
@ -167,6 +233,18 @@
return $this->foursquare_id;
}
/**
* Sets the foursquare identifier of the venue if known
*
* @param string|null $foursquare_id
* @return $this
*/
public function setFoursquareId(?string $foursquare_id): InlineQueryResultVenue
{
$this->foursquare_id = $foursquare_id;
return $this;
}
/**
* Optional. Foursquare type of the venue, if known.
* (For example, “arts_entertainment/default, “arts_entertainment/aquarium” or “food/icecream”.)
@ -178,6 +256,18 @@
return $this->foursquare_type;
}
/**
* Sets the foursquare type of the venue, if known.
*
* @param string|null $foursquare_type
* @return $this
*/
public function setFoursquareType(?string $foursquare_type): InlineQueryResultVenue
{
$this->foursquare_type = $foursquare_type;
return $this;
}
/**
* Optional. Google Places identifier of the venue
*
@ -188,6 +278,18 @@
return $this->google_place_id;
}
/**
* Sets the google places identifier of the venue
*
* @param string|null $google_place_id
* @return $this
*/
public function setGooglePlaceId(?string $google_place_id): InlineQueryResultVenue
{
$this->google_place_id = $google_place_id;
return $this;
}
/**
* Optional. Google Places type of the venue.
*
@ -199,6 +301,18 @@
return $this->google_place_type;
}
/**
* Sets the google places type of the venue.
*
* @param string|null $google_place_type
* @return $this
*/
public function setGooglePlaceType(?string $google_place_type): InlineQueryResultVenue
{
$this->google_place_type = $google_place_type;
return $this;
}
/**
* Optional. Inline keyboard attached to the message
*
@ -209,6 +323,18 @@
return $this->reply_markup;
}
/**
* Sets the inline keyboard attached to the message
*
* @param InlineKeyboardMarkup|null $reply_markup
* @return $this
*/
public function setReplyMarkup(?InlineKeyboardMarkup $reply_markup): InlineQueryResultVenue
{
$this->reply_markup = $reply_markup;
return $this;
}
/**
* Optional. Content of the message to be sent instead of the venue
*
@ -219,6 +345,18 @@
return $this->input_message_content;
}
/**
* Sets the content of the message to be sent instead of the venue
*
* @param InputVenueMessageContent|InputTextMessageContent|InputContactMessageContent|InputLocationMessageContent|InputInvoiceMessageContent|null $input_message_content
* @return $this
*/
public function setInputMessageContent(null|InputVenueMessageContent|InputTextMessageContent|InputContactMessageContent|InputLocationMessageContent|InputInvoiceMessageContent $input_message_content): InlineQueryResultVenue
{
$this->input_message_content = $input_message_content;
return $this;
}
/**
* Optional. Url of the thumbnail for the result
*
@ -229,6 +367,18 @@
return $this->thumbnail_url;
}
/**
* Sets the url of the thumbnail for the result
*
* @param string|null $thumbnail_url
* @return $this
*/
public function setThumbnailUrl(?string $thumbnail_url): InlineQueryResultVenue
{
$this->thumbnail_url = $thumbnail_url;
return $this;
}
/**
* Optional. Thumbnail width
*
@ -239,6 +389,18 @@
return $this->thumbnail_width;
}
/**
* Sets the thumbnail width
*
* @param int|null $thumbnail_width
* @return $this
*/
public function setThumbnailWidth(?int $thumbnail_width): InlineQueryResultVenue
{
$this->thumbnail_width = $thumbnail_width;
return $this;
}
/**
* Optional. Thumbnail height
*
@ -249,6 +411,18 @@
return $this->thumbnail_height;
}
/**
* Sets the thumbnail height
*
* @param int|null $thumbnail_height
* @return $this
*/
public function setThumbnailHeight(?int $thumbnail_height): InlineQueryResultVenue
{
$this->thumbnail_height = $thumbnail_height;
return $this;
}
/**
* Returns an array representation of the object
*
@ -276,7 +450,7 @@
}
/**
* Constructs object from an array representation
* Constructs an object from an array representation
*
* @param array $data
* @return ObjectTypeInterface