/*
 * Copyright 2016 EPAM Systems
 * 
 * 
 * This file is part of EPAM Report Portal.
 * https://github.com/reportportal/commons-model
 * 
 * Report Portal is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Report Portal is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Report Portal.  If not, see <http://www.gnu.org/licenses/>.
 */ 

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

import com.epam.ta.reportportal.ws.annotations.NotEmpty;
import com.epam.ta.reportportal.ws.model.ValidationConstraints;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * Confirmation resource of user creation with user-data
 * 
 * @author Andrei_Ramanchuk
 */
@JsonInclude(Include.NON_NULL)
public class CreateUserRQConfirm {

	@NotNull
	@NotEmpty
	@Pattern(regexp = "[a-zA-Z0-9-_.]+")
	@Size(min = ValidationConstraints.MIN_LOGIN_LENGTH, max = ValidationConstraints.MAX_LOGIN_LENGTH)
	@JsonProperty(value = "login", required = true)
	@ApiModelProperty(required = true)
	private String login;

	@NotNull
	@NotEmpty
	@Size(min = ValidationConstraints.MIN_PASSWORD_LENGTH, max = ValidationConstraints.MAX_PASSWORD_LENGTH)
	@JsonProperty(value = "password", required = true)
	@ApiModelProperty(required = true)
	private String password;

	@NotNull
	@NotEmpty
	@Pattern(regexp = "[\\pL0-9-_ \\.]+")
	@Size(min = ValidationConstraints.MIN_USER_NAME_LENGTH, max = ValidationConstraints.MAX_USER_NAME_LENGTH)
	@JsonProperty(value = "fullName", required = true)
	@ApiModelProperty(required = true)
	private String fullName;

	@NotNull
	@NotEmpty
	@JsonProperty(value = "email", required = true)
	@ApiModelProperty(required = true)
	private String email;

	// Field will be populated by handler cause be stored in bid
	private String defaultProject;

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

	public String getLogin() {
		return login;
	}

	public void setPassword(String value) {
		this.password = value;
	}

	public String getPassword() {
		return password;
	}

	public void setFullName(String value) {
		this.fullName = value;
	}

	public String getFullName() {
		return fullName;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getDefaultProject() {
		return defaultProject;
	}

	public void setDefaultProject(String value) {
		this.defaultProject = value;
	}

	@Override
	public String toString() {
		final StringBuilder sb = new StringBuilder("CreateUserRQConfirm{");
		sb.append("login='").append(login).append('\'');
		sb.append(", password='").append(password).append('\''); //NOSONAR
		sb.append(", fullName='").append(fullName).append('\'');
		sb.append(", email='").append(email).append('\'');
		sb.append(", defaultProject='").append(defaultProject).append('\'');
		sb.append('}');
		return sb.toString();
	}
}
@@ -16,9 +16,9 @@
  201
-6
+8
  EPA
@@ -33,442 +33,381 @@
 s%0A *
- 
 %0A * 
-%0A * This file is part of EPAM Report Portal.%0A * https://github.com/reportportal/commons-model%0A * %0A * Report Portal is free software: you can redistribute it and/or modify%0A * it under the terms of the GNU General Public License as published by%0A * the Free Software Foundation, either version 3 of the License, or%0A * (at your option) any later version.%0A * %0A * Report Portal is distributed in the hope that it will be useful,%0A * but
+Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A *
  WIT
@@ -415,323 +415,181 @@
 OUT 
-ANY 
 WARRANT
-Y; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A * GNU General Public License for more details.%0A * %0A * You should have received a copy of the GNU General Public License%0A * along with Report Portal.  If not, see %3Chttp://www.gnu.org/l
+IES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the L
 icense
-s/%3E
 .%0A */
- 
 %0A%0Apa
@@ -1169,17 +1169,16 @@
 -data%0A *
- 
 %0A * @aut
@@ -2193,103 +2193,8 @@
 l;%0A%0A
-%09// Field will be populated by handler cause be stored in bid%0A%09private String defaultProject;%0A%0A
 %09pub
@@ -2665,156 +2665,8 @@
 %09%7D%0A%0A
-%09public String getDefaultProject() %7B%0A%09%09return defaultProject;%0A%09%7D%0A%0A%09public void setDefaultProject(String value) %7B%0A%09%09this.defaultProject = value;%0A%09%7D%0A%0A
 %09@Ov
@@ -2883,18 +2883,8 @@
 '');
- //NOSONAR
 %0A%09%09s
@@ -2996,79 +2996,8 @@
 ');%0A
-%09%09sb.append(%22, defaultProject='%22).append(defaultProject).append('%5C'');%0A
 %09%09sb

remove unused default project field