ee6e0ff2256f06dd2b26969f7f988749c72c7c28
[netconf.git] / restconf / sal-rest-docgen / src / main / java / org / opendaylight / netconf / sal / rest / doc / impl / AllModulesDocGenerator.java
1 /*
2  * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.netconf.sal.rest.doc.impl;
9
10 import static java.util.Objects.requireNonNull;
11
12 import javax.ws.rs.core.UriInfo;
13 import org.opendaylight.netconf.sal.rest.doc.impl.ApiDocServiceImpl.OAversion;
14 import org.opendaylight.netconf.sal.rest.doc.swagger.CommonApiObject;
15 import org.opendaylight.netconf.sal.rest.doc.swagger.SwaggerObject;
16
17 public class AllModulesDocGenerator {
18     private final ApiDocGeneratorRFC8040 apiDocGeneratorRFC8040;
19
20     public AllModulesDocGenerator(final ApiDocGeneratorRFC8040 apiDocGeneratorRFC8040) {
21         this.apiDocGeneratorRFC8040 = requireNonNull(apiDocGeneratorRFC8040);
22     }
23
24     public CommonApiObject getAllModulesDoc(final UriInfo uriInfo, final OAversion oaversion) {
25         final DefinitionNames definitionNames = new DefinitionNames();
26         final SwaggerObject doc = apiDocGeneratorRFC8040.getAllModulesDoc(uriInfo, definitionNames, oaversion);
27
28         return BaseYangSwaggerGenerator.getAppropriateDoc(doc, oaversion);
29     }
30 }