Initial add of APPC client libraries
[appc.git] / appc-client / code-generator / src / main / resources / templates / client-kit / service.ftl
1 <#--
2  ============LICENSE_START=======================================================
3  ONAP : APPC
4  ================================================================================
5  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  ================================================================================
7  Copyright (C) 2017 Amdocs
8  =============================================================================
9  Licensed under the Apache License, Version 2.0 (the "License");
10  you may not use this file except in compliance with the License.
11  You may obtain a copy of the License at
12  
13       http://www.apache.org/licenses/LICENSE-2.0
14  
15  Unless required by applicable law or agreed to in writing, software
16  distributed under the License is distributed on an "AS IS" BASIS,
17  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  See the License for the specific language governing permissions and
19  limitations under the License.
20  
21  ECOMP is a trademark and service mark of AT&T Intellectual Property.
22  ============LICENSE_END=========================================================
23 -->
24
25 /*
26  * NOTE: This file is auto-generated and should not be changed manually.
27  */
28 package ${meta.api\.package};
29
30 <#list service?keys as action>
31     <#assign outputType = service[action].post.responses["200"].schema.properties.output.$ref?keep_after_last("/")>
32     <#assign inputType = service[action].post.parameters[0].schema.properties.input.$ref?keep_after_last("/")>
33 import ${meta.model\.package}.${outputType};
34 import ${meta.model\.package}.${inputType};
35 </#list>
36 import ${meta.exceptions\.package}.AppcClientException;
37 import ${meta.utils\.package}.RPC;
38
39 <#if model.info.description??>
40 /**
41 * ${model.info.description}
42 */
43 </#if>
44 <@generated/>
45 public interface ${meta.interface\.classname} {
46
47 <#list service?keys as action>
48     <#assign returnType = service[action].post.responses["200"].schema.properties.output.$ref?keep_after_last("/")>
49     <#assign rpcName = service[action].post.operationId>
50     <#assign methodName = toJavaName(rpcName)>
51     <#assign methodInputType = service[action].post.parameters[0].schema.properties.input.$ref?keep_after_last("/")>
52     <#assign methodInputName = methodInputType?uncap_first>
53     <#assign description = service[action].post.description>
54     /**
55      * ${description}
56      *
57      * @param ${methodInputName} - RPC input object
58      */
59     @RPC(name="${rpcName}", outputType=${returnType}.class)
60     ${returnType} ${methodName}(${methodInputType} ${methodInputName}) throws AppcClientException;
61
62     /**
63      * ${description}
64      *
65      * @param ${methodInputName} - RPC input object
66      * @return listener - callback implementation
67      */
68     @RPC(name="${rpcName}", outputType=${returnType}.class)
69     void ${methodName}(${methodInputType} ${methodInputName}, ResponseHandler<${returnType}> listener) throws AppcClientException;
70
71 </#list>
72 }