1
|
|
|
<?php namespace CalDAVClient\Facade\Responses; |
2
|
|
|
/** |
3
|
|
|
* Copyright 2017 OpenStack Foundation |
4
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
5
|
|
|
* you may not use this file except in compliance with the License. |
6
|
|
|
* You may obtain a copy of the License at |
7
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
8
|
|
|
* Unless required by applicable law or agreed to in writing, software |
9
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
10
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
11
|
|
|
* See the License for the specific language governing permissions and |
12
|
|
|
* limitations under the License. |
13
|
|
|
**/ |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* Class EventCreatedResponse |
17
|
|
|
* @package CalDAVClient\Facade\Responses |
18
|
|
|
*/ |
19
|
|
|
class EventCreatedResponse extends HttpResponse |
20
|
|
|
{ |
21
|
|
|
/** |
22
|
|
|
* @var string |
23
|
|
|
*/ |
24
|
|
|
protected $uid; |
25
|
|
|
/** |
26
|
|
|
* @var string |
27
|
|
|
*/ |
28
|
|
|
protected $etag; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @var string |
32
|
|
|
*/ |
33
|
|
|
protected $resource_url; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* EventCreatedResponse constructor. |
37
|
|
|
* @param string $uid |
38
|
|
|
* @param string $etag |
39
|
|
|
* @param string $resource_url |
40
|
|
|
* @param string $body |
41
|
|
|
* @param int $code |
42
|
|
|
*/ |
43
|
|
|
public function __construct($uid, $etag, $resource_url, $body, $code) |
44
|
|
|
{ |
45
|
|
|
parent::__construct($body, $code); |
46
|
|
|
$this->uid = $uid; |
47
|
|
|
$this->etag = $etag; |
48
|
|
|
$this->resource_url = $resource_url; |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* @return string |
53
|
|
|
*/ |
54
|
|
|
public function getUid() |
55
|
|
|
{ |
56
|
|
|
return $this->uid; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* @return string |
61
|
|
|
*/ |
62
|
|
|
public function getETag() |
63
|
|
|
{ |
64
|
|
|
return $this->etag; |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* @return string |
69
|
|
|
*/ |
70
|
|
|
public function getResourceUrl(){ |
71
|
|
|
return $this->resource_url; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @return bool |
76
|
|
|
*/ |
77
|
|
|
public function isSuccessFull(){ |
78
|
|
|
return $this->code == HttpResponse::HttpCodeCreated; |
79
|
|
|
} |
80
|
|
|
} |