From 1deb1aaa6ca0fc35f68171f0e7b030c8dc7778ed Mon Sep 17 00:00:00 2001 From: Netkas Date: Wed, 9 Aug 2023 19:40:37 -0400 Subject: [PATCH] Code fixes in \TgBotLib\Objects\Telegram\InlineQueryResult > InlineQueryResultVenue --- .idea/runConfigurations/Build.xml | 2 +- .idea/runConfigurations/Clean.xml | 2 +- .idea/runConfigurations/Install.xml | 2 +- .../InlineQueryResultVenue.php | 180 +++++++++++++++++- 4 files changed, 180 insertions(+), 6 deletions(-) diff --git a/.idea/runConfigurations/Build.xml b/.idea/runConfigurations/Build.xml index a601571..95671e2 100644 --- a/.idea/runConfigurations/Build.xml +++ b/.idea/runConfigurations/Build.xml @@ -1,5 +1,5 @@ - + diff --git a/.idea/runConfigurations/Clean.xml b/.idea/runConfigurations/Clean.xml index 5ba1469..e088b48 100644 --- a/.idea/runConfigurations/Clean.xml +++ b/.idea/runConfigurations/Clean.xml @@ -1,5 +1,5 @@ - + diff --git a/.idea/runConfigurations/Install.xml b/.idea/runConfigurations/Install.xml index 1fb616b..d7b5373 100644 --- a/.idea/runConfigurations/Install.xml +++ b/.idea/runConfigurations/Install.xml @@ -1,5 +1,5 @@ - + diff --git a/src/TgBotLib/Objects/Telegram/InlineQueryResult/InlineQueryResultVenue.php b/src/TgBotLib/Objects/Telegram/InlineQueryResult/InlineQueryResultVenue.php index 7266a09..0d5b914 100644 --- a/src/TgBotLib/Objects/Telegram/InlineQueryResult/InlineQueryResultVenue.php +++ b/src/TgBotLib/Objects/Telegram/InlineQueryResult/InlineQueryResultVenue.php @@ -1,9 +1,10 @@ -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