1 | <?php |
||
14 | class Parameter extends AbstractModel implements Arrayable { |
||
15 | |||
16 | use RefPart; |
||
17 | use DescriptionPart; |
||
18 | use SchemaPart; |
||
19 | use TypePart; |
||
20 | use ItemsPart; |
||
21 | use RequiredPart; |
||
22 | use ExtensionPart; |
||
23 | |||
24 | /** @var string */ |
||
25 | private $name; |
||
26 | |||
27 | /** @var string */ |
||
28 | private $in; |
||
29 | |||
30 | /** @var boolean */ |
||
31 | private $allowEmptyValue = false; |
||
32 | |||
33 | 5 | public function __construct($contents = []) { |
|
36 | |||
37 | 5 | private function parse($contents = []) { |
|
38 | 5 | $data = CollectionUtils::toMap($contents); |
|
39 | |||
40 | 5 | $this->name = $data->get('name'); |
|
41 | 5 | $this->in = $data->get('in'); |
|
42 | 5 | $this->allowEmptyValue = $data->has('allowEmptyValue') && $data->get('allowEmptyValue'); |
|
43 | |||
44 | |||
45 | // parts |
||
46 | 5 | $this->parseRef($data); |
|
47 | 5 | $this->parseDescription($data); |
|
48 | 5 | $this->parseSchema($data); |
|
49 | 5 | $this->parseRequired($data); |
|
50 | 5 | $this->parseType($data); |
|
51 | 5 | $this->parseItems($data); |
|
52 | 5 | $this->parseExtensions($data); |
|
53 | 5 | } |
|
54 | |||
55 | 4 | public function toArray() { |
|
59 | |||
60 | /** |
||
61 | * |
||
62 | * @return string |
||
63 | */ |
||
64 | 1 | public function getName() { |
|
67 | |||
68 | /** |
||
69 | * |
||
70 | * @param string $name |
||
71 | */ |
||
72 | 1 | public function setName($name) { |
|
76 | |||
77 | /** |
||
78 | * |
||
79 | * @return string |
||
80 | */ |
||
81 | 1 | public function getIn() { |
|
82 | 1 | return $this->in; |
|
83 | } |
||
84 | |||
85 | /** |
||
86 | * |
||
87 | * @param string $in |
||
88 | */ |
||
89 | 1 | public function setIn($in) { |
|
90 | 1 | $this->in = $in; |
|
91 | 1 | return $this; |
|
92 | } |
||
93 | |||
94 | /** |
||
95 | * |
||
96 | * @return boolean |
||
97 | */ |
||
98 | public function getAllowEmptyValue() { |
||
101 | |||
102 | /** |
||
103 | * Sets the ability to pass empty-valued parameters. This is valid only for either `query` or |
||
104 | * `formData` parameters and allows you to send a parameter with a name only or an empty value. |
||
105 | * Default value is `false`. |
||
106 | * |
||
107 | * @param boolean $allowEmptyValue |
||
108 | */ |
||
109 | public function setAllowEmptyValue($allowEmptyValue) { |
||
113 | |||
114 | } |