Extension of Yang files for OpenROADM
[ccsdk/features.git] / sdnr / wt / odlux / framework / src / models / elasticSearch.ts
1 /**\r
2  * ============LICENSE_START========================================================================\r
3  * ONAP : ccsdk feature sdnr wt odlux\r
4  * =================================================================================================\r
5  * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.\r
6  * =================================================================================================\r
7  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except\r
8  * in compliance with the License. You may obtain a copy of the License at\r
9  *\r
10  * http://www.apache.org/licenses/LICENSE-2.0\r
11  *\r
12  * Unless required by applicable law or agreed to in writing, software distributed under the License\r
13  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\r
14  * or implied. See the License for the specific language governing permissions and limitations under\r
15  * the License.\r
16  * ============LICENSE_END==========================================================================\r
17  */\r
18 export type Result<TSource extends {}> = {\r
19   output: {\r
20     pagination?: {\r
21       size: number,\r
22       page: number,\r
23       total: number\r
24     },\r
25     data: TSource[];\r
26   }\r
27 }\r
28 \r
29 export type HitEntry<TSource extends {}> = {\r
30   _index: string;\r
31   _type: string;\r
32   _id: string;\r
33   _score: number;\r
34   _source: TSource;\r
35 }\r
36 \r
37 type ActionResponse ={\r
38   _index: string;\r
39   _type: string;\r
40   _id: string;\r
41   _shards: {\r
42     total: number,\r
43     successful: number,\r
44     failed: number\r
45     },\r
46 \r
47 }\r
48 \r
49 export type PostResponse = ActionResponse & {\r
50   created: boolean\r
51 }\r
52 \r
53 export type DeleteResponse = ActionResponse & {\r
54   found: boolean\r
55 }\r
56 \r