@@ -40,12 +40,11 @@ public function addToken(Token $token)
40
40
$ response = $ this
41
41
->httpClient
42
42
->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 )
49
48
);
50
49
51
50
self ::throwTransportableExceptionIfNeeded ($ response );
@@ -61,12 +60,15 @@ public function deleteToken(TokenUUID $tokenUUID)
61
60
$ response = $ this
62
61
->httpClient
63
62
->get (
64
- '/token ' ,
63
+ sprintf (
64
+ '/%s/tokens/%s ' ,
65
+ $ this ->getAppUUID ()->composeUUID (),
66
+ $ tokenUUID ->composeUUID ()
67
+ ),
65
68
'delete ' ,
66
- Http::getAppQueryValues ($ this ),
67
- [
68
- Http::TOKEN_FIELD => $ tokenUUID ->toArray (),
69
- ]
69
+ [],
70
+ [],
71
+ Http::getApisearchHeaders ($ this )
70
72
);
71
73
72
74
self ::throwTransportableExceptionIfNeeded ($ response );
@@ -82,9 +84,14 @@ public function getTokens(): array
82
84
$ response = $ this
83
85
->httpClient
84
86
->get (
85
- '/tokens ' ,
87
+ sprintf (
88
+ '/%s/tokens ' ,
89
+ $ this ->getAppUUID ()->getId ()
90
+ ),
86
91
'get ' ,
87
- Http::getAppQueryValues ($ this )
92
+ [],
93
+ [],
94
+ Http::getApisearchHeaders ($ this )
88
95
);
89
96
90
97
self ::throwTransportableExceptionIfNeeded ($ response );
@@ -102,9 +109,14 @@ public function deleteTokens()
102
109
$ response = $ this
103
110
->httpClient
104
111
->get (
105
- '/tokens ' ,
112
+ sprintf (
113
+ '/%s/tokens ' ,
114
+ $ this ->getAppUUID ()->getId ()
115
+ ),
106
116
'delete ' ,
107
- Http::getAppQueryValues ($ this )
117
+ [],
118
+ [],
119
+ Http::getApisearchHeaders ($ this )
108
120
);
109
121
110
122
self ::throwTransportableExceptionIfNeeded ($ response );
@@ -120,9 +132,14 @@ public function getIndices(): array
120
132
$ response = $ this
121
133
->httpClient
122
134
->get (
123
- '/indices ' ,
135
+ sprintf (
136
+ '/%s/indices ' ,
137
+ $ this ->getAppUUID ()->getId ()
138
+ ),
124
139
'get ' ,
125
- Http::getAppQueryValues ($ this )
140
+ [],
141
+ [],
142
+ Http::getApisearchHeaders ($ this )
126
143
);
127
144
128
145
self ::throwTransportableExceptionIfNeeded ($ response );
@@ -150,13 +167,17 @@ public function createIndex(
150
167
$ response = $ this
151
168
->httpClient
152
169
->get (
153
- '/index ' ,
170
+ sprintf (
171
+ '/%s/indices ' ,
172
+ $ this ->getAppUUID ()->getId ()
173
+ ),
154
174
'put ' ,
155
- Http:: getAppQueryValues ( $ this ) ,
175
+ [] ,
156
176
[
157
177
Http::INDEX_FIELD => $ indexUUID ->toArray (),
158
178
Http::CONFIG_FIELD => $ config ->toArray (),
159
- ]
179
+ ],
180
+ Http::getApisearchHeaders ($ this )
160
181
);
161
182
162
183
self ::throwTransportableExceptionIfNeeded ($ response );
@@ -174,9 +195,15 @@ public function deleteIndex(IndexUUID $indexUUID)
174
195
$ response = $ this
175
196
->httpClient
176
197
->get (
177
- '/index ' ,
198
+ sprintf (
199
+ '/%s/indices/%s ' ,
200
+ $ this ->getAppUUID ()->composeUUID (),
201
+ $ indexUUID ->composeUUID ()
202
+ ),
178
203
'delete ' ,
179
- Http::getAppQueryValues ($ this , $ indexUUID )
204
+ [],
205
+ [],
206
+ Http::getApisearchHeaders ($ this )
180
207
);
181
208
182
209
self ::throwTransportableExceptionIfNeeded ($ response );
@@ -194,9 +221,15 @@ public function resetIndex(IndexUUID $indexUUID)
194
221
$ response = $ this
195
222
->httpClient
196
223
->get (
197
- '/index/reset ' ,
224
+ sprintf (
225
+ '/%s/indices/%s/reset ' ,
226
+ $ this ->getAppUUID ()->composeUUID (),
227
+ $ indexUUID ->composeUUID ()
228
+ ),
198
229
'post ' ,
199
- Http::getAppQueryValues ($ this , $ indexUUID )
230
+ [],
231
+ [],
232
+ Http::getApisearchHeaders ($ this )
200
233
);
201
234
202
235
self ::throwTransportableExceptionIfNeeded ($ response );
@@ -214,9 +247,15 @@ public function checkIndex(IndexUUID $indexUUID): bool
214
247
$ response = $ this
215
248
->httpClient
216
249
->get (
217
- '/index ' ,
250
+ sprintf (
251
+ '/%s/indices/%s ' ,
252
+ $ this ->getAppUUID ()->composeUUID (),
253
+ $ indexUUID ->composeUUID ()
254
+ ),
218
255
'head ' ,
219
- Http::getAppQueryValues ($ this , $ indexUUID )
256
+ [],
257
+ [],
258
+ Http::getApisearchHeaders ($ this )
220
259
);
221
260
222
261
if (null === $ response ) {
@@ -241,12 +280,15 @@ public function configureIndex(
241
280
$ response = $ this
242
281
->httpClient
243
282
->get (
244
- '/index ' ,
283
+ sprintf (
284
+ '/%s/indices/%s/configure ' ,
285
+ $ this ->getAppUUID ()->composeUUID (),
286
+ $ indexUUID ->composeUUID ()
287
+ ),
245
288
'post ' ,
246
- Http::getAppQueryValues ($ this , $ indexUUID ),
247
- [
248
- Http::CONFIG_FIELD => $ config ->toArray (),
249
- ]
289
+ [],
290
+ $ config ->toArray (),
291
+ Http::getApisearchHeaders ($ this )
250
292
);
251
293
252
294
if (null === $ response ) {
0 commit comments