1 | <?php namespace nyx\notify\transports\slack; |
||
16 | class Response extends Message |
||
17 | { |
||
18 | /** |
||
19 | * The types a Response can be of. |
||
20 | */ |
||
21 | const TYPE_CHANNEL = 'in_channel'; |
||
22 | const TYPE_EPHEMERAL = 'ephemeral'; |
||
23 | |||
24 | /** |
||
25 | * @var string The type of the Response. One of the TYPE_* class constants. |
||
26 | */ |
||
27 | protected $type; |
||
28 | |||
29 | /** |
||
30 | * @var string The URL this Response should be sent to. |
||
31 | */ |
||
32 | protected $url; |
||
33 | |||
34 | /** |
||
35 | * @var bool Whether the original Message should be replaced by this Response. When false, this Response |
||
36 | * will be considered a brand new Message. |
||
37 | */ |
||
38 | protected $replaceOriginal; |
||
39 | |||
40 | /** |
||
41 | * @var bool Whether the original Message should be deleted. If a new one is sent along this Response, |
||
42 | * it will be published as a brand new Message. |
||
43 | */ |
||
44 | protected $deleteOriginal; |
||
45 | |||
46 | /** |
||
47 | * {@inheritDoc} |
||
48 | */ |
||
49 | public function setAttributes(array $attributes) : Message |
||
71 | |||
72 | /** |
||
73 | * Returns the type of the Response. |
||
74 | * |
||
75 | * @return string |
||
76 | */ |
||
77 | public function getType() : ?string |
||
81 | |||
82 | /** |
||
83 | * Sets the type of the Response. |
||
84 | * |
||
85 | * @param string $type |
||
86 | * @return $this |
||
87 | * @throws \InvalidArgumentException |
||
88 | */ |
||
89 | public function setType(string $type) : Response |
||
99 | |||
100 | /** |
||
101 | * Returns the URL this Response should be sent to. |
||
102 | * |
||
103 | * @return string |
||
104 | */ |
||
105 | public function getResponseUrl() : ?string |
||
109 | |||
110 | /** |
||
111 | * Sets the URL this Response should be sent to. |
||
112 | * |
||
113 | * @param string $url |
||
114 | * @return $this |
||
115 | */ |
||
116 | public function setResponseUrl(string $url) : Response |
||
122 | |||
123 | /** |
||
124 | * Checks whether the original Message should be replaced by this Response. |
||
125 | * |
||
126 | * @return bool |
||
127 | */ |
||
128 | public function shouldReplaceOriginal() : bool |
||
132 | |||
133 | /** |
||
134 | * Sets whether the original Message should be replaced by this Response. |
||
135 | * |
||
136 | * @param bool $replace |
||
137 | * @return $this |
||
138 | */ |
||
139 | public function setReplaceOriginal(bool $replace) : Response |
||
145 | |||
146 | /** |
||
147 | * Checks whether the original Message should be deleted. |
||
148 | * |
||
149 | * @return bool |
||
150 | */ |
||
151 | public function shouldDeleteOriginal() : bool |
||
155 | |||
156 | /** |
||
157 | * Sets whether the original Message should be deleted. |
||
158 | * |
||
159 | * @param bool $delete |
||
160 | * @return $this |
||
161 | */ |
||
162 | public function setDeleteOriginal(bool $delete) : Response |
||
168 | |||
169 | /** |
||
170 | * {@inheritDoc} |
||
171 | */ |
||
172 | public function toArray() : array |
||
181 | } |
||
182 |