@@ -40,12 +40,11 @@ public function addToken(Token $token)
4040 $ response = $ this
4141 ->httpClient
4242 ->get (
43- '/token ' ,
44- 'post ' ,
45- Http::getAppQueryValues ($ this ),
46- [
47- Http::TOKEN_FIELD => $ token ->toArray (),
48- ]
43+ sprintf ('/%s/tokens ' , $ this ->getAppUUID ()->getId ()),
44+ 'put ' ,
45+ [],
46+ $ token ->toArray (),
47+ Http::getApisearchHeaders ($ this )
4948 );
5049
5150 self ::throwTransportableExceptionIfNeeded ($ response );
@@ -61,12 +60,15 @@ public function deleteToken(TokenUUID $tokenUUID)
6160 $ response = $ this
6261 ->httpClient
6362 ->get (
64- '/token ' ,
63+ sprintf (
64+ '/%s/tokens/%s ' ,
65+ $ this ->getAppUUID ()->composeUUID (),
66+ $ tokenUUID ->composeUUID ()
67+ ),
6568 'delete ' ,
66- Http::getAppQueryValues ($ this ),
67- [
68- Http::TOKEN_FIELD => $ tokenUUID ->toArray (),
69- ]
69+ [],
70+ [],
71+ Http::getApisearchHeaders ($ this )
7072 );
7173
7274 self ::throwTransportableExceptionIfNeeded ($ response );
@@ -82,9 +84,14 @@ public function getTokens(): array
8284 $ response = $ this
8385 ->httpClient
8486 ->get (
85- '/tokens ' ,
87+ sprintf (
88+ '/%s/tokens ' ,
89+ $ this ->getAppUUID ()->getId ()
90+ ),
8691 'get ' ,
87- Http::getAppQueryValues ($ this )
92+ [],
93+ [],
94+ Http::getApisearchHeaders ($ this )
8895 );
8996
9097 self ::throwTransportableExceptionIfNeeded ($ response );
@@ -102,9 +109,14 @@ public function deleteTokens()
102109 $ response = $ this
103110 ->httpClient
104111 ->get (
105- '/tokens ' ,
112+ sprintf (
113+ '/%s/tokens ' ,
114+ $ this ->getAppUUID ()->getId ()
115+ ),
106116 'delete ' ,
107- Http::getAppQueryValues ($ this )
117+ [],
118+ [],
119+ Http::getApisearchHeaders ($ this )
108120 );
109121
110122 self ::throwTransportableExceptionIfNeeded ($ response );
@@ -120,9 +132,14 @@ public function getIndices(): array
120132 $ response = $ this
121133 ->httpClient
122134 ->get (
123- '/indices ' ,
135+ sprintf (
136+ '/%s/indices ' ,
137+ $ this ->getAppUUID ()->getId ()
138+ ),
124139 'get ' ,
125- Http::getAppQueryValues ($ this )
140+ [],
141+ [],
142+ Http::getApisearchHeaders ($ this )
126143 );
127144
128145 self ::throwTransportableExceptionIfNeeded ($ response );
@@ -150,13 +167,17 @@ public function createIndex(
150167 $ response = $ this
151168 ->httpClient
152169 ->get (
153- '/index ' ,
170+ sprintf (
171+ '/%s/indices ' ,
172+ $ this ->getAppUUID ()->getId ()
173+ ),
154174 'put ' ,
155- Http:: getAppQueryValues ( $ this ) ,
175+ [] ,
156176 [
157177 Http::INDEX_FIELD => $ indexUUID ->toArray (),
158178 Http::CONFIG_FIELD => $ config ->toArray (),
159- ]
179+ ],
180+ Http::getApisearchHeaders ($ this )
160181 );
161182
162183 self ::throwTransportableExceptionIfNeeded ($ response );
@@ -174,9 +195,15 @@ public function deleteIndex(IndexUUID $indexUUID)
174195 $ response = $ this
175196 ->httpClient
176197 ->get (
177- '/index ' ,
198+ sprintf (
199+ '/%s/indices/%s ' ,
200+ $ this ->getAppUUID ()->composeUUID (),
201+ $ indexUUID ->composeUUID ()
202+ ),
178203 'delete ' ,
179- Http::getAppQueryValues ($ this , $ indexUUID )
204+ [],
205+ [],
206+ Http::getApisearchHeaders ($ this )
180207 );
181208
182209 self ::throwTransportableExceptionIfNeeded ($ response );
@@ -194,9 +221,15 @@ public function resetIndex(IndexUUID $indexUUID)
194221 $ response = $ this
195222 ->httpClient
196223 ->get (
197- '/index/reset ' ,
224+ sprintf (
225+ '/%s/indices/%s/reset ' ,
226+ $ this ->getAppUUID ()->composeUUID (),
227+ $ indexUUID ->composeUUID ()
228+ ),
198229 'post ' ,
199- Http::getAppQueryValues ($ this , $ indexUUID )
230+ [],
231+ [],
232+ Http::getApisearchHeaders ($ this )
200233 );
201234
202235 self ::throwTransportableExceptionIfNeeded ($ response );
@@ -214,9 +247,15 @@ public function checkIndex(IndexUUID $indexUUID): bool
214247 $ response = $ this
215248 ->httpClient
216249 ->get (
217- '/index ' ,
250+ sprintf (
251+ '/%s/indices/%s ' ,
252+ $ this ->getAppUUID ()->composeUUID (),
253+ $ indexUUID ->composeUUID ()
254+ ),
218255 'head ' ,
219- Http::getAppQueryValues ($ this , $ indexUUID )
256+ [],
257+ [],
258+ Http::getApisearchHeaders ($ this )
220259 );
221260
222261 if (null === $ response ) {
@@ -241,12 +280,15 @@ public function configureIndex(
241280 $ response = $ this
242281 ->httpClient
243282 ->get (
244- '/index ' ,
283+ sprintf (
284+ '/%s/indices/%s/configure ' ,
285+ $ this ->getAppUUID ()->composeUUID (),
286+ $ indexUUID ->composeUUID ()
287+ ),
245288 'post ' ,
246- Http::getAppQueryValues ($ this , $ indexUUID ),
247- [
248- Http::CONFIG_FIELD => $ config ->toArray (),
249- ]
289+ [],
290+ $ config ->toArray (),
291+ Http::getApisearchHeaders ($ this )
250292 );
251293
252294 if (null === $ response ) {
0 commit comments