1 | <?php |
||
20 | class UrlResource implements \JsonSerializable |
||
21 | { |
||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | public $kind = 'urlshortener#url'; |
||
26 | |||
27 | /** |
||
28 | * Short URL, e.g. "http://goo.gl/l6MS". |
||
29 | * |
||
30 | * @var string |
||
31 | */ |
||
32 | public $id; |
||
33 | |||
34 | /** |
||
35 | * Long URL, e.g. "http://www.google.com/". |
||
36 | * Might not be present if the status is "REMOVED". |
||
37 | * |
||
38 | * @var string|null |
||
39 | */ |
||
40 | public $longUrl; |
||
41 | |||
42 | /** |
||
43 | * Status of the target URL. |
||
44 | * |
||
45 | * Possible values: "OK", "MALWARE", "PHISHING", or "REMOVED". |
||
46 | * A URL might be marked "REMOVED" if it was flagged as spam, for example. |
||
47 | * |
||
48 | * @var string |
||
49 | */ |
||
50 | public $status; |
||
51 | |||
52 | /** |
||
53 | * @param \stdClass $json |
||
54 | * @return UrlResource |
||
55 | */ |
||
56 | 3 | public static function createFromJson(\stdClass $json) |
|
69 | |||
70 | /** |
||
71 | * Serialize this resource into an array for json |
||
72 | * |
||
73 | * @return array |
||
74 | */ |
||
75 | 12 | public function jsonSerialize() |
|
88 | } |
||
89 |