1
- using LootLocker . LootLockerEnums ;
1
+ using System ;
2
+ using LootLocker . LootLockerEnums ;
2
3
using LootLocker . Requests ;
3
- using System ;
4
4
5
5
#if LOOTLOCKER_USE_NEWTONSOFTJSON
6
6
using Newtonsoft . Json . Linq ;
@@ -192,10 +192,56 @@ public bool TryGetValueAsBase64(out LootLockerMetadataBase64Value output)
192
192
}
193
193
}
194
194
195
+ /// <summary>
196
+ /// </summary>
197
+ public class LootLockerMetadataSourceAndKeys
198
+ {
199
+ /// <summary>
200
+ /// The type of source that the source id refers to
201
+ /// </summary>
202
+ public LootLockerMetadataSources source { get ; set ; }
203
+ /// <summary>
204
+ /// The id of the specific source that the set operation was taken on
205
+ /// </summary>
206
+ public string id { get ; set ; }
207
+ /// <summary>
208
+ /// A list of keys existing on the specified source
209
+ /// </summary>
210
+ public string [ ] keys { get ; set ; }
211
+ }
212
+
213
+ /// <summary>
214
+ /// </summary>
215
+ public class LootLockerMetadataSourceAndEntries
216
+ {
217
+ /// <summary>
218
+ /// The type of source that the source id refers to
219
+ /// </summary>
220
+ public LootLockerMetadataSources source { get ; set ; }
221
+ /// <summary>
222
+ /// The id of the specific source that the set operation was taken on
223
+ /// </summary>
224
+ public string source_id { get ; set ; }
225
+ /// <summary>
226
+ /// A list of keys existing on the specified source
227
+ /// </summary>
228
+ public LootLockerMetadataEntry [ ] entries { get ; set ; }
229
+ }
230
+
195
231
//==================================================
196
232
// Request Definitions
197
233
//==================================================
198
234
235
+ /// <summary>
236
+ /// </summary>
237
+ public class LootLockerGetMultisourceMetadataRequest
238
+ {
239
+ /// <summary>
240
+ /// The source & key combos to get
241
+ /// </summary>
242
+ public LootLockerMetadataSourceAndKeys [ ] sources { get ; set ; }
243
+ }
244
+
199
245
//==================================================
200
246
// Response Definitions
201
247
//==================================================
@@ -222,6 +268,16 @@ public class LootLockerGetMetadataResponse : LootLockerResponse
222
268
/// </summary>
223
269
public LootLockerMetadataEntry entry { get ; set ; }
224
270
} ;
271
+
272
+ /// <summary>
273
+ /// </summary>
274
+ public class LootLockerGetMultisourceMetadataResponse : LootLockerResponse
275
+ {
276
+ /// <summary>
277
+ /// The requested sources with the requested entries for each source
278
+ /// </summary>
279
+ public LootLockerMetadataSourceAndEntries [ ] Metadata { get ; set ; }
280
+ } ;
225
281
}
226
282
227
283
//==================================================
@@ -260,5 +316,32 @@ public static void ListMetadata(LootLockerMetadataSources Source, string SourceI
260
316
LootLockerResponse . Deserialize < LootLockerListMetadataResponse > ( onComplete , serverResponse ) ;
261
317
} ) ;
262
318
}
319
+ public static void GetMultisourceMetadata ( LootLockerMetadataSourceAndKeys [ ] SourcesAndKeysToGet , bool ignoreFiles , Action < LootLockerGetMultisourceMetadataResponse > onComplete )
320
+ {
321
+ if ( SourcesAndKeysToGet == null )
322
+ {
323
+ onComplete ? . Invoke ( LootLockerResponseFactory . InputUnserializableError < LootLockerGetMultisourceMetadataResponse > ( ) ) ;
324
+ return ;
325
+ }
326
+ string endpoint = LootLockerEndPoints . getMultisourceMetadata . endPoint ;
327
+
328
+ string queryParams = "" ;
329
+ if ( ignoreFiles ) { queryParams += $ "ignore_files=true"; } else { queryParams += $ "ignore_files=false"; }
330
+
331
+ if ( ! string . IsNullOrEmpty ( queryParams ) )
332
+ {
333
+ queryParams = $ "?{ queryParams } ";
334
+ endpoint += queryParams ;
335
+ }
336
+
337
+ LootLockerGetMultisourceMetadataRequest request = new LootLockerGetMultisourceMetadataRequest { sources = SourcesAndKeysToGet } ;
338
+
339
+ string json = LootLockerJson . SerializeObject ( request ) ;
340
+ LootLockerServerRequest . CallAPI ( endpoint , LootLockerEndPoints . getMultisourceMetadata . httpMethod , json , onComplete :
341
+ ( serverResponse ) =>
342
+ {
343
+ LootLockerResponse . Deserialize < LootLockerGetMultisourceMetadataResponse > ( onComplete , serverResponse ) ;
344
+ } ) ;
345
+ }
263
346
}
264
347
}
0 commit comments