Skip to content

Commit 9874ab6

Browse files
1 parent 7d49077 commit 9874ab6

File tree

2 files changed

+225
-1
lines changed

2 files changed

+225
-1
lines changed
Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
<?php
2+
/*
3+
* Copyright 2014 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
6+
* use this file except in compliance with the License. You may obtain a copy of
7+
* the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
* License for the specific language governing permissions and limitations under
15+
* the License.
16+
*/
17+
18+
namespace Google\Service\YouTube;
19+
20+
class LiveChatGiftDetails extends \Google\Model
21+
{
22+
/**
23+
* The alternative text to be used for accessibility.
24+
*
25+
* @var string
26+
*/
27+
public $altText;
28+
/**
29+
* The number of times the gift has been sent in a row.
30+
*
31+
* @var int
32+
*/
33+
public $comboCount;
34+
/**
35+
* The duration of the gift.
36+
*
37+
* @var string
38+
*/
39+
public $giftDuration;
40+
/**
41+
* The name of the gift.
42+
*
43+
* @var string
44+
*/
45+
public $giftName;
46+
/**
47+
* The URL of the gift image.
48+
*
49+
* @var string
50+
*/
51+
public $giftUrl;
52+
/**
53+
* Whether the gift involves a visual effect.
54+
*
55+
* @var bool
56+
*/
57+
public $hasVisualEffect;
58+
/**
59+
* The cost of the gift in jewels.
60+
*
61+
* @var int
62+
*/
63+
public $jewelsCount;
64+
/**
65+
* The BCP-47 language code of the gift.
66+
*
67+
* @var string
68+
*/
69+
public $language;
70+
71+
/**
72+
* The alternative text to be used for accessibility.
73+
*
74+
* @param string $altText
75+
*/
76+
public function setAltText($altText)
77+
{
78+
$this->altText = $altText;
79+
}
80+
/**
81+
* @return string
82+
*/
83+
public function getAltText()
84+
{
85+
return $this->altText;
86+
}
87+
/**
88+
* The number of times the gift has been sent in a row.
89+
*
90+
* @param int $comboCount
91+
*/
92+
public function setComboCount($comboCount)
93+
{
94+
$this->comboCount = $comboCount;
95+
}
96+
/**
97+
* @return int
98+
*/
99+
public function getComboCount()
100+
{
101+
return $this->comboCount;
102+
}
103+
/**
104+
* The duration of the gift.
105+
*
106+
* @param string $giftDuration
107+
*/
108+
public function setGiftDuration($giftDuration)
109+
{
110+
$this->giftDuration = $giftDuration;
111+
}
112+
/**
113+
* @return string
114+
*/
115+
public function getGiftDuration()
116+
{
117+
return $this->giftDuration;
118+
}
119+
/**
120+
* The name of the gift.
121+
*
122+
* @param string $giftName
123+
*/
124+
public function setGiftName($giftName)
125+
{
126+
$this->giftName = $giftName;
127+
}
128+
/**
129+
* @return string
130+
*/
131+
public function getGiftName()
132+
{
133+
return $this->giftName;
134+
}
135+
/**
136+
* The URL of the gift image.
137+
*
138+
* @param string $giftUrl
139+
*/
140+
public function setGiftUrl($giftUrl)
141+
{
142+
$this->giftUrl = $giftUrl;
143+
}
144+
/**
145+
* @return string
146+
*/
147+
public function getGiftUrl()
148+
{
149+
return $this->giftUrl;
150+
}
151+
/**
152+
* Whether the gift involves a visual effect.
153+
*
154+
* @param bool $hasVisualEffect
155+
*/
156+
public function setHasVisualEffect($hasVisualEffect)
157+
{
158+
$this->hasVisualEffect = $hasVisualEffect;
159+
}
160+
/**
161+
* @return bool
162+
*/
163+
public function getHasVisualEffect()
164+
{
165+
return $this->hasVisualEffect;
166+
}
167+
/**
168+
* The cost of the gift in jewels.
169+
*
170+
* @param int $jewelsCount
171+
*/
172+
public function setJewelsCount($jewelsCount)
173+
{
174+
$this->jewelsCount = $jewelsCount;
175+
}
176+
/**
177+
* @return int
178+
*/
179+
public function getJewelsCount()
180+
{
181+
return $this->jewelsCount;
182+
}
183+
/**
184+
* The BCP-47 language code of the gift.
185+
*
186+
* @param string $language
187+
*/
188+
public function setLanguage($language)
189+
{
190+
$this->language = $language;
191+
}
192+
/**
193+
* @return string
194+
*/
195+
public function getLanguage()
196+
{
197+
return $this->language;
198+
}
199+
}
200+
201+
// Adding a class alias for backwards compatibility with the previous class name.
202+
class_alias(LiveChatGiftDetails::class, 'Google_Service_YouTube_LiveChatGiftDetails');

src/YouTube/LiveChatMessageSnippet.php

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ class LiveChatMessageSnippet extends \Google\Model
3636
public const TYPE_superChatEvent = 'superChatEvent';
3737
public const TYPE_superStickerEvent = 'superStickerEvent';
3838
public const TYPE_pollEvent = 'pollEvent';
39+
/**
40+
* A virtual gift sent by a viewer to support a creator.
41+
*/
42+
public const TYPE_giftEvent = 'giftEvent';
3943
/**
4044
* The ID of the user that authored this message, this field is not always
4145
* filled. textMessageEvent - the user that wrote the message fanFundingEvent
@@ -62,6 +66,8 @@ class LiveChatMessageSnippet extends \Google\Model
6266
public $displayMessage;
6367
protected $fanFundingEventDetailsType = LiveChatFanFundingEventDetails::class;
6468
protected $fanFundingEventDetailsDataType = '';
69+
protected $giftDetailsType = LiveChatGiftDetails::class;
70+
protected $giftDetailsDataType = '';
6571
protected $giftMembershipReceivedDetailsType = LiveChatGiftMembershipReceivedDetails::class;
6672
protected $giftMembershipReceivedDetailsDataType = '';
6773
/**
@@ -171,6 +177,22 @@ public function getFanFundingEventDetails()
171177
{
172178
return $this->fanFundingEventDetails;
173179
}
180+
/**
181+
* Details about the gift event, this is only set if the type is 'giftEvent'.
182+
*
183+
* @param LiveChatGiftDetails $giftDetails
184+
*/
185+
public function setGiftDetails(LiveChatGiftDetails $giftDetails)
186+
{
187+
$this->giftDetails = $giftDetails;
188+
}
189+
/**
190+
* @return LiveChatGiftDetails
191+
*/
192+
public function getGiftDetails()
193+
{
194+
return $this->giftDetails;
195+
}
174196
/**
175197
* Details about the Gift Membership Received event, this is only set if the
176198
* type is 'giftMembershipReceivedEvent'.
@@ -389,7 +411,7 @@ public function getTextMessageDetails()
389411
* chatEndedEvent, sponsorOnlyModeStartedEvent, sponsorOnlyModeEndedEvent,
390412
* newSponsorEvent, memberMilestoneChatEvent, membershipGiftingEvent,
391413
* giftMembershipReceivedEvent, messageDeletedEvent, messageRetractedEvent,
392-
* userBannedEvent, superChatEvent, superStickerEvent, pollEvent
414+
* userBannedEvent, superChatEvent, superStickerEvent, pollEvent, giftEvent
393415
*
394416
* @param self::TYPE_* $type
395417
*/

0 commit comments

Comments
 (0)