2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017 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 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22 package org.onap.aai.util.swagger;
24 import java.util.List;
31 private List<HttpVerb> httpMethods;
35 public List<HttpVerb> getHttpMethods() {
39 public void setHttpMethods(List<HttpVerb> httpMethods) {
40 this.httpMethods = httpMethods;
43 public String getTag(){
49 if(this.httpMethods != null){
50 if(this.httpMethods.size() != 0){
51 if(this.httpMethods.get(0).getTags() != null){
52 if(this.httpMethods.get(0).getTags().size() != 0){
53 this.tag = this.httpMethods.get(0).getTags().get(0);
67 public String toString() {
69 "path='" + path + '\'' +
70 ", httpMethods=" + httpMethods +
74 public void setPath(String path) {
78 public String getPath() {
82 public String getOperation(){
84 if(this.path != null){
85 return this.path.replaceAll("[^a-zA-Z0-9\\-]", "-") + "-";
91 public static class HttpVerb {
93 private List<String> tags;
97 private String summary;
99 private String operationId;
101 private List<String> consumes;
103 private boolean consumerEnabled;
105 private List<String> produces;
107 private List<Response> responses;
109 private List<Map<String, Object>> parameters;
111 private Map<String, Object> bodyParameters;
113 private boolean bodyParametersEnabled;
115 private boolean parametersEnabled;
117 private String schemaLink;
119 private String schemaType;
121 private boolean hasReturnSchema;
123 private String returnSchemaLink;
125 private String returnSchemaObject;
127 public void setConsumerEnabled(boolean consumerEnabled){
128 this.consumerEnabled = consumerEnabled;
131 public boolean isConsumerEnabled() {
132 return consumerEnabled;
136 public List<String> getTags() {
140 public void setTags(List<String> tags) {
144 public String getType() {
148 public void setType(String type) {
152 public String getSummary() {
156 public void setSummary(String summary) {
157 this.summary = summary;
160 public String getOperationId() {
164 public void setOperationId(String operationId) {
165 this.operationId = operationId;
168 public List<String> getConsumes() {
172 public void setConsumes(List<String> consumes) {
173 this.consumes = consumes;
176 public List<String> getProduces() {
180 public void setProduces(List<String> produces) {
181 this.produces = produces;
184 public List<Response> getResponses() {
188 public void setResponses(List<Response> responses) {
189 this.responses = responses;
192 public List<Map<String, Object>> getParameters() {
196 public void setParameters(List<Map<String, Object>> parameters) {
197 this.parameters = parameters;
201 public String toString() {
204 ", type='" + type + '\'' +
205 ", summary='" + summary + '\'' +
206 ", operationId='" + operationId + '\'' +
207 ", consumes=" + consumes +
208 ", produces=" + produces +
209 ", responses=" + responses +
210 ", parameters=" + parameters +
214 public void setParametersEnabled(boolean b) {
215 this.parametersEnabled = b;
218 public boolean isParametersEnabled() {
219 return parametersEnabled;
222 public boolean isBodyParametersEnabled() {
223 return bodyParametersEnabled;
226 public void setBodyParametersEnabled(boolean bodyParametersEnabled) {
227 this.bodyParametersEnabled = bodyParametersEnabled;
230 public Map<String, Object> getBodyParameters() {
231 return bodyParameters;
234 public void setBodyParameters(Map<String, Object> bodyParameters) {
235 this.bodyParameters = bodyParameters;
238 public String getSchemaLink() {
242 public void setSchemaLink(String schemaLink) {
243 this.schemaLink = schemaLink;
246 public String getSchemaType() {
250 public void setSchemaType(String schemaType) {
251 this.schemaType = schemaType;
254 public boolean isHasReturnSchema() {
255 return hasReturnSchema;
258 public void setHasReturnSchema(boolean hasReturnSchema) {
259 this.hasReturnSchema = hasReturnSchema;
262 public String getReturnSchemaLink() {
263 return returnSchemaLink;
266 public void setReturnSchemaLink(String returnSchemaLink) {
267 this.returnSchemaLink = returnSchemaLink;
270 public String getReturnSchemaObject() {
271 return returnSchemaObject;
274 public void setReturnSchemaObject(String returnSchemaObject) {
275 this.returnSchemaObject = returnSchemaObject;
278 public static class Response {
280 private String responseCode;
282 private String description;
284 public String getResponseCode() {
288 public void setResponseCode(String responseCode) {
289 this.responseCode = responseCode;
292 public String getDescription() {
296 public void setDescription(String description) {
297 this.description = description;
301 public String toString() {
303 "responseCode='" + responseCode + '\'' +
304 ", description='" + description + '\'' +