2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
20 package org.onap.aai.util.swagger;
22 import java.util.List;
29 private List<HttpVerb> httpMethods;
33 public List<HttpVerb> getHttpMethods() {
37 public void setHttpMethods(List<HttpVerb> httpMethods) {
38 this.httpMethods = httpMethods;
41 public String getTag(){
47 if(this.httpMethods != null){
48 if(this.httpMethods.size() != 0){
49 if(this.httpMethods.get(0).getTags() != null){
50 if(this.httpMethods.get(0).getTags().size() != 0){
51 this.tag = this.httpMethods.get(0).getTags().get(0);
65 public String toString() {
67 "path='" + path + '\'' +
68 ", httpMethods=" + httpMethods +
72 public void setPath(String path) {
76 public String getPath() {
80 public String getOperation(){
82 if(this.path != null){
83 return this.path.replaceAll("[^a-zA-Z0-9\\-]", "-") + "-";
89 public static class HttpVerb {
91 private List<String> tags;
95 private String summary;
97 private String operationId;
99 private List<String> consumes;
101 private boolean consumerEnabled;
103 private List<String> produces;
105 private List<Response> responses;
107 private List<Map<String, Object>> parameters;
109 private Map<String, Object> bodyParameters;
111 private boolean bodyParametersEnabled;
113 private boolean parametersEnabled;
115 private String schemaLink;
117 private String schemaType;
119 private boolean hasReturnSchema;
121 private String returnSchemaLink;
123 private String returnSchemaObject;
125 public void setConsumerEnabled(boolean consumerEnabled){
126 this.consumerEnabled = consumerEnabled;
129 public boolean isConsumerEnabled() {
130 return consumerEnabled;
134 public List<String> getTags() {
138 public void setTags(List<String> tags) {
142 public String getType() {
146 public void setType(String type) {
150 public String getSummary() {
154 public void setSummary(String summary) {
155 this.summary = summary;
158 public String getOperationId() {
162 public void setOperationId(String operationId) {
163 this.operationId = operationId;
166 public List<String> getConsumes() {
170 public void setConsumes(List<String> consumes) {
171 this.consumes = consumes;
174 public List<String> getProduces() {
178 public void setProduces(List<String> produces) {
179 this.produces = produces;
182 public List<Response> getResponses() {
186 public void setResponses(List<Response> responses) {
187 this.responses = responses;
190 public List<Map<String, Object>> getParameters() {
194 public void setParameters(List<Map<String, Object>> parameters) {
195 this.parameters = parameters;
199 public String toString() {
202 ", type='" + type + '\'' +
203 ", summary='" + summary + '\'' +
204 ", operationId='" + operationId + '\'' +
205 ", consumes=" + consumes +
206 ", produces=" + produces +
207 ", responses=" + responses +
208 ", parameters=" + parameters +
212 public void setParametersEnabled(boolean b) {
213 this.parametersEnabled = b;
216 public boolean isParametersEnabled() {
217 return parametersEnabled;
220 public boolean isBodyParametersEnabled() {
221 return bodyParametersEnabled;
224 public void setBodyParametersEnabled(boolean bodyParametersEnabled) {
225 this.bodyParametersEnabled = bodyParametersEnabled;
228 public Map<String, Object> getBodyParameters() {
229 return bodyParameters;
232 public void setBodyParameters(Map<String, Object> bodyParameters) {
233 this.bodyParameters = bodyParameters;
236 public String getSchemaLink() {
240 public void setSchemaLink(String schemaLink) {
241 this.schemaLink = schemaLink;
244 public String getSchemaType() {
248 public void setSchemaType(String schemaType) {
249 this.schemaType = schemaType;
252 public boolean isHasReturnSchema() {
253 return hasReturnSchema;
256 public void setHasReturnSchema(boolean hasReturnSchema) {
257 this.hasReturnSchema = hasReturnSchema;
260 public String getReturnSchemaLink() {
261 return returnSchemaLink;
264 public void setReturnSchemaLink(String returnSchemaLink) {
265 this.returnSchemaLink = returnSchemaLink;
268 public String getReturnSchemaObject() {
269 return returnSchemaObject;
272 public void setReturnSchemaObject(String returnSchemaObject) {
273 this.returnSchemaObject = returnSchemaObject;
276 public static class Response {
278 private String responseCode;
280 private String description;
282 public String getResponseCode() {
286 public void setResponseCode(String responseCode) {
287 this.responseCode = responseCode;
290 public String getDescription() {
294 public void setDescription(String description) {
295 this.description = description;
299 public String toString() {
301 "responseCode='" + responseCode + '\'' +
302 ", description='" + description + '\'' +