1<?php
2/**
3 * BigBlueButton open source conferencing system - https://www.bigbluebutton.org/.
4 *
5 * Copyright (c) 2016-2018 BigBlueButton Inc. and by respective authors (see below).
6 *
7 * This program is free software; you can redistribute it and/or modify it under the
8 * terms of the GNU Lesser General Public License as published by the Free Software
9 * Foundation; either version 3.0 of the License, or (at your option) any later
10 * version.
11 *
12 * BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
13 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14 * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License along
17 * with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
18 */
19namespace BigBlueButton\Responses;
20
21/**
22 * Class CreateMeetingResponse
23 * @package BigBlueButton\Responses
24 */
25class CreateMeetingResponse extends BaseResponse
26{
27    /**
28     * @return string
29     */
30    public function getMeetingId()
31    {
32        return $this->rawXml->meetingID->__toString();
33    }
34
35    /**
36     * @return string
37     */
38    public function getInternalMeetingId()
39    {
40        return $this->rawXml->internalMeetingID->__toString();
41    }
42
43    /**
44     * @return string
45     */
46    public function getParentMeetingId()
47    {
48        return $this->rawXml->parentMeetingID->__toString();
49    }
50
51    /**
52     * @return string
53     */
54    public function getAttendeePassword()
55    {
56        return $this->rawXml->attendeePW->__toString();
57    }
58
59    /**
60     * @return string
61     */
62    public function getModeratorPassword()
63    {
64        return $this->rawXml->moderatorPW->__toString();
65    }
66
67    /**
68     * Creation timestamp.
69     *
70     * @return double
71     */
72    public function getCreationTime()
73    {
74        return (float) $this->rawXml->createTime;
75    }
76
77    /**
78     * @return int
79     */
80    public function getVoiceBridge()
81    {
82        return (int) $this->rawXml->voiceBridge;
83    }
84
85    /**
86     * @return string
87     */
88    public function getDialNumber()
89    {
90        return $this->rawXml->dialNumber->__toString();
91    }
92
93    /**
94     * Creation date at the format "Sun Jan 17 18:20:07 EST 2016".
95     *
96     * @return string
97     */
98    public function getCreationDate()
99    {
100        return $this->rawXml->createDate->__toString();
101    }
102
103    /**
104     * @return true
105     */
106    public function hasUserJoined()
107    {
108        return $this->rawXml->hasUserJoined->__toString() === 'true';
109    }
110
111    /**
112     * @return int
113     */
114    public function getDuration()
115    {
116        return (int) $this->rawXml->duration;
117    }
118
119    /**
120     * @return bool
121     */
122    public function hasBeenForciblyEnded()
123    {
124        return $this->rawXml->hasBeenForciblyEnded->__toString() === 'true';
125    }
126}
127