/*
 * 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.project;

import com.epam.ta.reportportal.ws.model.integration.IntegrationResource;
import com.fasterxml.jackson.annotation.JsonProperty;

import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

/**
 * Project resource representation for responses
 *
 * @author Pavel Bortnik
 */
public class ProjectResource {

	@NotNull
	@JsonProperty(value = "projectId", required = true)
	private Long projectId;

	@NotNull
	@JsonProperty(value = "projectName", required = true)
	private String projectName;

	@JsonProperty(value = "entryType", required = true)
	private String entryType;

	@NotNull
	@JsonProperty(value = "configuration", required = true)
	private ProjectConfiguration configuration;

	@JsonProperty(value = "users")
	private List<ProjectUser> users;

	@JsonProperty(value = "integrations")
	private List<IntegrationResource> integrations;

	@JsonProperty(value = "organization")
	private String organization;

	@NotNull
	@JsonProperty(value = "creationDate")
	private Date creationDate;

	public Date getCreationDate() {
		return creationDate;
	}

	public void setCreationDate(Date creationDate) {
		this.creationDate = creationDate;
	}

	public Long getProjectId() {
		return projectId;
	}

	public void setProjectId(Long projectId) {
		this.projectId = projectId;
	}

	public String getProjectName() {
		return projectName;
	}

	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}

	public String getEntryType() {
		return entryType;
	}

	public void setEntryType(String entryType) {
		this.entryType = entryType;
	}

	public void setConfiguration(ProjectConfiguration configuration) {
		this.configuration = configuration;
	}

	public ProjectConfiguration getConfiguration() {
		return configuration;
	}

	public List<IntegrationResource> getIntegrations() {
		return integrations;
	}

	public void setIntegrations(List<IntegrationResource> integrations) {
		this.integrations = integrations;
	}

	public List<ProjectUser> getUsers() {
		return users;
	}

	public void setUsers(List<ProjectUser> users) {
		this.users = users;
	}

	public String getOrganization() {
		return organization;
	}

	public void setOrganization(String organization) {
		this.organization = organization;
	}

	public static class ProjectUser {

		@JsonProperty(value = "login")
		private String login;

		@JsonProperty(value = "projectRole")
		private String projectRole;

		public String getLogin() {
			return login;
		}

		public void setLogin(String login) {
			this.login = login;
		}

		public void setProjectRole(String value) {
			this.projectRole = value;
		}

		public String getProjectRole() {
			return projectRole;
		}

		@Override
		public String toString() {
			return "ProjectUser{" + "projectRole='" + projectRole + '\'' + '}';
		}
	}
}

@@ -1584,16 +1584,94 @@
 ation;%0A%0A
+%09@JsonProperty(value = %22allocatedStorage%22)%0A%09private String allocatedStorage;%0A%0A
 %09@NotNul
@@ -2966,32 +2966,210 @@
 ganization;%0A%09%7D%0A%0A
+%09public String getAllocatedStorage() %7B%0A%09%09return allocatedStorage;%0A%09%7D%0A%0A%09public void setAllocatedStorage(String allocatedStorage) %7B%0A%09%09this.allocatedStorage = allocatedStorage;%0A%09%7D%0A%0A
 %09public static c

add allocated storage field to the project resource