1 <?php
2
3 namespace PayPal\Api;
4
5 use PayPal\Common\PayPalModel;
6 use PayPal\Validation\UrlValidator;
7
8 /**
9 * Class FileAttachment
10 *
11 * File attached to an invoice or template
12 *
13 * @package PayPal\Api
14 *
15 * @property string name
16 * @property string url
17 */
18 class FileAttachment extends PayPalModel
19 {
20 /**
21 * Name of the file attached.
22 *
23 * @param string $name
24 *
25 * @return $this
26 */
27 public function setName($name)
28 {
29 $this->name = $name;
30 return $this;
31 }
32
33 /**
34 * Name of the file attached.
35 *
36 * @return string
37 */
38 public function getName()
39 {
40 return $this->name;
41 }
42
43 /**
44 * URL of the attached file that can be downloaded.
45 *
46 * @param string $url
47 * @throws \InvalidArgumentException
48 * @return $this
49 */
50 public function setUrl($url)
51 {
52 UrlValidator::validate($url, "Url");
53 $this->url = $url;
54 return $this;
55 }
56
57 /**
58 * URL of the attached file that can be downloaded.
59 *
60 * @return string
61 */
62 public function getUrl()
63 {
64 return $this->url;
65 }
66
67 }
68