package eu.dnetlib.datasource.publisher.model;

import java.util.List;
import java.util.Objects;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * Datasource
 */
@JsonAutoDetect
@ApiModel(value = "Datasource model", description = "provides datasource details")
public class Datasource {

	private String id = null;
	private String officialname = null;
	private String englishname = null;
	private String websiteurl = null;
	private String logourl = null;
	private String contactemail = null;
	private String countrycode = null;
	private String countryname = null;
	private String organization = null;
	private double latitude;
	private double longitude;
	private String timezone = null;
	private String collectedfrom = null;
	private String dateofvalidation = null;
	private String registeredby = null;
	private String datasourceclass = null;
	private String typology = null;
	private String activationid = null;
	private String description = null;
	private String issn = null;
	private String eissn = null;
	private String lissn = null;
	private List<Api> api = null;

	public Datasource id(String id) {
		this.id = id;
		return this;
	}

	/**
	 * Get id
	 *
	 * @return id
	 **/
	@ApiModelProperty(required = true, value = "")
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Datasource officialname(String officialname) {
		this.officialname = officialname;
		return this;
	}

	/**
	 * Get englishname
	 *
	 * @return englishname
	 **/
	public String getEnglishname() {
		return englishname;
	}

	public void setEnglishname(String englishname) {
		this.englishname = englishname;
	}

	public Datasource englishname(String englishname) {
		this.englishname = englishname;
		return this;
	}

	/**
	 * Get officialname
	 *
	 * @return officialname
	 **/
	@ApiModelProperty(required = true, value = "")
	public String getOfficialname() {
		return officialname;
	}

	public void setOfficialname(String officialname) {
		this.officialname = officialname;
	}


	public Datasource websiteurl(String websiteurl) {
		this.websiteurl = websiteurl;
		return this;
	}

	/**
	 * Get websiteurl
	 *
	 * @return websiteurl
	 **/
	public String getWebsiteurl() {
		return websiteurl;
	}

	public void setWebsiteurl(String websiteurl) {
		this.websiteurl = websiteurl;
	}

	public Datasource logourl(String logourl) {
		this.logourl = logourl;
		return this;
	}

	/**
	 * Get logourl
	 *
	 * @return logourl
	 **/
	public String getLogourl() {
		return logourl;
	}

	public void setLogourl(String logourl) {
		this.logourl = logourl;
	}

	public Datasource contactemail(String contactemail) {
		this.contactemail = contactemail;
		return this;
	}

	/**
	 * Get contactemail
	 *
	 * @return contactemail
	 **/
	public String getContactemail() {
		return contactemail;
	}

	public void setContactemail(String contactemail) {
		this.contactemail = contactemail;
	}

	public Datasource countrycode(String countrycode) {
		this.countrycode = countrycode;
		return this;
	}

	/**
	 * Get countrycode
	 *
	 * @return countrycode
	 **/
	public String getCountrycode() {
		return countrycode;
	}

	public void setCountrycode(String countrycode) {
		this.countrycode = countrycode;
	}

	public Datasource countryname(String countryname) {
		this.countryname = countryname;
		return this;
	}

	/**
	 * Get countryname
	 *
	 * @return countryname
	 **/
	public String getCountryname() {
		return countryname;
	}

	public void setCountryname(String countryname) {
		this.countryname = countryname;
	}

	public Datasource organization(String organization) {
		this.organization = organization;
		return this;
	}

	/**
	 * Get organization
	 *
	 * @return organization
	 **/
	public String getOrganization() {
		return organization;
	}

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

	public Datasource latitude(double latitude) {
		this.latitude = latitude;
		return this;
	}

	/**
	 * Get latitude
	 *
	 * @return latitude
	 **/
	public double getLatitude() {
		return latitude;
	}

	public void setLatitude(double latitude) {
		this.latitude = latitude;
	}

	public Datasource longitude(double longitude) {
		this.longitude = longitude;
		return this;
	}

	/**
	 * Get longitude
	 *
	 * @return longitude
	 **/
	public double getLongitude() {
		return longitude;
	}

	public void setLongitude(double longitude) {
		this.longitude = longitude;
	}

	public Datasource timezone(String timezone) {
		this.timezone = timezone;
		return this;
	}

	/**
	 * Get timezone
	 *
	 * @return timezone
	 **/
	public String getTimezone() {
		return timezone;
	}

	public void setTimezone(String timezone) {
		this.timezone = timezone;
	}

	public Datasource collectedfrom(String collectedfrom) {
		this.collectedfrom = collectedfrom;
		return this;
	}

	/**
	 * Get collectedfrom
	 *
	 * @return collectedfrom
	 **/
	public String getCollectedfrom() {
		return collectedfrom;
	}

	public void setCollectedfrom(String collectedfrom) {
		this.collectedfrom = collectedfrom;
	}

	public Datasource dateofvalidation(String dateofvalidation) {
		this.dateofvalidation = dateofvalidation;
		return this;
	}

	/**
	 * Get dateofvalidation
	 *
	 * @return dateofvalidation
	 **/
	public String getDateofvalidation() {
		return dateofvalidation;
	}

	public void setDateofvalidation(String dateofvalidation) {
		this.dateofvalidation = dateofvalidation;
	}

	public Datasource registeredby(String registeredby) {
		this.registeredby = registeredby;
		return this;
	}

	/**
	 * Get registeredby
	 *
	 * @return registeredby
	 **/
	public String getRegisteredby() {
		return registeredby;
	}

	public void setRegisteredby(String registeredby) {
		this.registeredby = registeredby;
	}

	public Datasource datasourceclass(String datasourcecclass) {
		this.datasourceclass = datasourcecclass;
		return this;
	}

	/**
	 * Get datasourcecclass
	 *
	 * @return datasourcecclass
	 **/
	public String getDatasourceclass() {
		return datasourceclass;
	}

	public void setDatasourcecclass(String datasourcecclass) {
		this.datasourceclass = datasourcecclass;
	}

	public Datasource typology(String typology) {
		this.typology = typology;
		return this;
	}

	/**
	 * Get typology
	 *
	 * @return typology
	 **/
	public String getTypology() {
		return typology;
	}

	public void setTypology(String typology) {
		this.typology = typology;
	}

	public Datasource activationid(String activationid) {
		this.activationid = activationid;
		return this;
	}

	/**
	 * Get activationid
	 *
	 * @return activationid
	 **/
	public String getActivationid() {
		return activationid;
	}

	public void setActivationid(String activationid) {
		this.activationid = activationid;
	}

	public Datasource description(String description) {
		this.description = description;
		return this;
	}

	/**
	 * Get description
	 *
	 * @return description
	 **/
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Datasource issn(String issn) {
		this.issn = issn;
		return this;
	}

	/**
	 * Get issn
	 *
	 * @return issn
	 **/
	public String getIssn() {
		return issn;
	}

	public void setIssn(String issn) {
		this.issn = issn;
	}

	public Datasource eissn(String eissn) {
		this.eissn = eissn;
		return this;
	}

	/**
	 * Get eissn
	 *
	 * @return eissn
	 **/
	public String getEissn() {
		return eissn;
	}

	public void setEissn(String eissn) {
		this.eissn = eissn;
	}

	public Datasource lissn(String lissn) {
		this.lissn = lissn;
		return this;
	}

	/**
	 * Get lissn
	 *
	 * @return lissn
	 **/
	public String getLissn() {
		return lissn;
	}

	public void setLissn(String lissn) {
		this.lissn = lissn;
	}

	public Datasource api(List<Api> api) {
		this.api = api;
		return this;
	}

	/**
	 * Get api
	 *
	 * @return api
	 **/
	public List<Api> getApi() {
		return api;
	}

	public void setApi(List<Api> api) {
		this.api = api;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (o == null || getClass() != o.getClass()) {
			return false;
		}
		Datasource datasource = (Datasource) o;
		return Objects.equals(this.id, datasource.id) &&
				Objects.equals(this.officialname, datasource.officialname) &&
				Objects.equals(this.englishname, datasource.englishname) &&
				Objects.equals(this.websiteurl, datasource.websiteurl) &&
				Objects.equals(this.logourl, datasource.logourl) &&
				Objects.equals(this.contactemail, datasource.contactemail) &&
				Objects.equals(this.countrycode, datasource.countrycode) &&
				Objects.equals(this.countryname, datasource.countryname) &&
				Objects.equals(this.organization, datasource.organization) &&
				Objects.equals(this.latitude, datasource.latitude) &&
				Objects.equals(this.longitude, datasource.longitude) &&
				Objects.equals(this.timezone, datasource.timezone) &&
				Objects.equals(this.collectedfrom, datasource.collectedfrom) &&
				Objects.equals(this.dateofvalidation, datasource.dateofvalidation) &&
				Objects.equals(this.registeredby, datasource.registeredby) &&
				Objects.equals(this.datasourceclass, datasource.datasourceclass) &&
				Objects.equals(this.typology, datasource.typology) &&
				Objects.equals(this.activationid, datasource.activationid) &&
				Objects.equals(this.description, datasource.description) &&
				Objects.equals(this.issn, datasource.issn) &&
				Objects.equals(this.eissn, datasource.eissn) &&
				Objects.equals(this.lissn, datasource.lissn) &&
				Objects.equals(this.api, datasource.api);
	}

	@Override
	public int hashCode() {
		return Objects.hash(id, officialname, englishname, websiteurl, logourl, contactemail, countrycode, countryname, organization, latitude, longitude, timezone,
				collectedfrom, dateofvalidation, registeredby, datasourceclass, typology, activationid, description,
				issn, eissn, lissn, api);
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("class Datasource {\n");

		sb.append("    id: ").append(toIndentedString(id)).append("\n");
		sb.append("    officialname: ").append(toIndentedString(officialname)).append("\n");
		sb.append("    englishname: ").append(toIndentedString(englishname)).append("\n");
		sb.append("    websiteurl: ").append(toIndentedString(websiteurl)).append("\n");
		sb.append("    logourl: ").append(toIndentedString(logourl)).append("\n");
		sb.append("    contactemail: ").append(toIndentedString(contactemail)).append("\n");
		sb.append("    countrycode: ").append(toIndentedString(countrycode)).append("\n");
		sb.append("    countryname: ").append(toIndentedString(countryname)).append("\n");
		sb.append("    organization: ").append(toIndentedString(organization)).append("\n");
		sb.append("    latitude: ").append(toIndentedString(latitude)).append("\n");
		sb.append("    longitude: ").append(toIndentedString(longitude)).append("\n");
		sb.append("    timezone: ").append(toIndentedString(timezone)).append("\n");
		sb.append("    collectedfrom: ").append(toIndentedString(collectedfrom)).append("\n");
		sb.append("    dateofvalidation: ").append(toIndentedString(dateofvalidation)).append("\n");
		sb.append("    registeredby: ").append(toIndentedString(registeredby)).append("\n");
		sb.append("    datasourcecclass: ").append(toIndentedString(datasourceclass)).append("\n");
		sb.append("    typology: ").append(toIndentedString(typology)).append("\n");
		sb.append("    activationid: ").append(toIndentedString(activationid)).append("\n");
		sb.append("    description: ").append(toIndentedString(description)).append("\n");
		sb.append("    issn: ").append(toIndentedString(issn)).append("\n");
		sb.append("    eissn: ").append(toIndentedString(eissn)).append("\n");
		sb.append("    lissn: ").append(toIndentedString(lissn)).append("\n");
		sb.append("    api: ").append(toIndentedString(api)).append("\n");
		sb.append("}");
		return sb.toString();
	}

	/**
	 * Convert the given object to string with each line indented by 4 spaces
	 * (except the first line).
	 */
	private String toIndentedString(Object o) {
		if (o == null) {
			return "null";
		}
		return o.toString().replace("\n", "\n    ");
	}
}

