/*
 * Copyright 2019 EPAM Systems
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.epam.ta.reportportal.ws.model.log;

import com.epam.ta.reportportal.ws.model.issue.Issue;
import com.fasterxml.jackson.annotation.JsonInclude;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author <a href="mailto:ihar_kahadouski@epam.com">Ihar Kahadouski</a>
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class SearchLogRs {

	private Long launchId;

	private String launchName;

	private Long itemId;

	private String itemName;

	private String path;

	private Map<Long, String> pathNames;

	private double duration;

	private String status;

	private Issue issue;

	private Set<String> patternTemplates;

	private List<String> logMessages;

	public String getLaunchName() {
		return launchName;
	}

	public void setLaunchName(String launchName) {
		this.launchName = launchName;
	}

	public Map<Long, String> getPathNames() {
		return pathNames;
	}

	public void setPathNames(Map<Long, String> pathNames) {
		this.pathNames = pathNames;
	}

	public Long getLaunchId() {
		return launchId;
	}

	public void setLaunchId(Long launchId) {
		this.launchId = launchId;
	}

	public Set<String> getPatternTemplates() {
		return patternTemplates;
	}

	public void setPatternTemplates(Set<String> patternTemplates) {
		this.patternTemplates = patternTemplates;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public Long getItemId() {
		return itemId;
	}

	public void setItemId(Long itemId) {
		this.itemId = itemId;
	}

	public String getItemName() {
		return itemName;
	}

	public void setItemName(String itemName) {
		this.itemName = itemName;
	}

	public double getDuration() {
		return duration;
	}

	public void setDuration(double duration) {
		this.duration = duration;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Issue getIssue() {
		return issue;
	}

	public void setIssue(Issue issue) {
		this.issue = issue;
	}

	public List<String> getLogMessages() {
		return logMessages;
	}

	public void setLogMessages(List<String> logMessages) {
		this.logMessages = logMessages;
	}

	@Override
	public String toString() {
		final StringBuilder sb = new StringBuilder("SearchLogRs{");
		sb.append("launchId=").append(launchId);
		sb.append(", launchName='").append(launchName).append('\'');
		sb.append(", itemId=").append(itemId);
		sb.append(", itemName='").append(itemName).append('\'');
		sb.append(", path='").append(path).append('\'');
		sb.append(", pathNames=").append(pathNames);
		sb.append(", duration=").append(duration);
		sb.append(", status='").append(status).append('\'');
		sb.append(", issue=").append(issue);
		sb.append(", patternTemplates=").append(patternTemplates);
		sb.append(", logMessages=").append(logMessages);
		sb.append('}');
		return sb.toString();
	}
}

@@ -1261,28 +1261,617 @@
 ist%3C
-String%3E logMessages;
+LogEntry%3E logs;%0A%0A%09public static class LogEntry %7B%0A%09%09private String message;%0A%09%09private String level;%0A%0A%09%09public String getMessage() %7B%0A%09%09%09return message;%0A%09%09%7D%0A%0A%09%09public void setMessage(String message) %7B%0A%09%09%09this.message = message;%0A%09%09%7D%0A%0A%09%09public String getLevel() %7B%0A%09%09%09return level;%0A%09%09%7D%0A%0A%09%09public void setLevel(String level) %7B%0A%09%09%09this.level = level;%0A%09%09%7D%0A%0A%09%09@Override%0A%09%09public String toString() %7B%0A%09%09%09final StringBuilder sb = new StringBuilder(%22LogEntry%7B%22);%0A%09%09%09sb.append(%22message='%22).append(message).append('%5C'');%0A%09%09%09sb.append(%22, level='%22).append(level).append('%5C'');%0A%09%09%09sb.append('%7D');%0A%09%09%09return sb.toString();%0A%09%09%7D%0A%09%7D
 %0A%0A%09p
@@ -3207,22 +3207,24 @@
 ist%3C
-String
+LogEntry
 %3E getLog
 Mess
@@ -3219,23 +3219,16 @@
 %3E getLog
-Message
 s() %7B%0A%09%09
@@ -3233,31 +3233,24 @@
 %09%09return log
-Message
 s;%0A%09%7D%0A%0A%09publ
@@ -3267,76 +3267,50 @@
 tLog
-Messages(List%3CString%3E logMessages) %7B%0A%09%09this.logMessages = logMessage
+s(List%3CLogEntry%3E logs) %7B%0A%09%09this.logs = log
 s;%0A%09
@@ -3935,23 +3935,16 @@
 d(%22, log
-Message
 s=%22).app
@@ -3950,23 +3950,16 @@
 pend(log
-Message
 s);%0A%09%09sb

add log level to response