/*
 * appNG REST API
 * The REST API for appNG
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: matthias.mueller@appng.org
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package org.appng.openapi.model;

import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.appng.openapi.model.Label;
import org.appng.openapi.model.Link;
import org.appng.openapi.model.Message;
import org.appng.openapi.model.Parameter;
import org.appng.openapi.model.Section;
import org.appng.openapi.model.User;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;

/**
 * PageDefinition
 */
@JsonPropertyOrder({
  PageDefinition.JSON_PROPERTY_SELF,
  PageDefinition.JSON_PROPERTY_USER_URL,
  PageDefinition.JSON_PROPERTY_USER,
  PageDefinition.JSON_PROPERTY_ID,
  PageDefinition.JSON_PROPERTY_MESSAGES,
  PageDefinition.JSON_PROPERTY_URL_PATH,
  PageDefinition.JSON_PROPERTY_URL_PARAMETERS,
  PageDefinition.JSON_PROPERTY_URL_TEMPLATE,
  PageDefinition.JSON_PROPERTY_GET_PARAMETERS,
  PageDefinition.JSON_PROPERTY_SESSION_PARAMETERS,
  PageDefinition.JSON_PROPERTY_TITLE,
  PageDefinition.JSON_PROPERTY_LINKS,
  PageDefinition.JSON_PROPERTY_SECTIONS,
  PageDefinition.JSON_PROPERTY_APP_N_G_VERSION,
  PageDefinition.JSON_PROPERTY_APP_VERSION
})
@JsonTypeName("PageDefinition")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-03-20T12:57:48.851+01:00[Europe/Berlin]")
public class PageDefinition {
  public static final String JSON_PROPERTY_SELF = "_self";
  private String self;

  public static final String JSON_PROPERTY_USER_URL = "_userUrl";
  private String userUrl;

  public static final String JSON_PROPERTY_USER = "user";
  private User user;

  public static final String JSON_PROPERTY_ID = "id";
  private String id;

  public static final String JSON_PROPERTY_MESSAGES = "messages";
  private List<Message> messages = null;

  public static final String JSON_PROPERTY_URL_PATH = "urlPath";
  private String urlPath;

  public static final String JSON_PROPERTY_URL_PARAMETERS = "urlParameters";
  private List<Parameter> urlParameters = null;

  public static final String JSON_PROPERTY_URL_TEMPLATE = "urlTemplate";
  private String urlTemplate;

  public static final String JSON_PROPERTY_GET_PARAMETERS = "getParameters";
  private Map<String, String> getParameters = null;

  public static final String JSON_PROPERTY_SESSION_PARAMETERS = "sessionParameters";
  private Map<String, String> sessionParameters = null;

  public static final String JSON_PROPERTY_TITLE = "title";
  private Label title;

  public static final String JSON_PROPERTY_LINKS = "links";
  private List<Link> links = null;

  public static final String JSON_PROPERTY_SECTIONS = "sections";
  private List<Section> sections = null;

  public static final String JSON_PROPERTY_APP_N_G_VERSION = "appNGVersion";
  private String appNGVersion = null;

  public static final String JSON_PROPERTY_APP_VERSION = "appVersion";
  private String appVersion = null;


  public PageDefinition self(String self) {
    
    this.self = self;
    return this;
  }

   /**
   * The URL of the page
   * @return self
  **/
  @ApiModelProperty(required = true, value = "The URL of the page")
  @JsonProperty(JSON_PROPERTY_SELF)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public String getSelf() {
    return self;
  }


  @JsonProperty(JSON_PROPERTY_SELF)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setSelf(String self) {
    this.self = self;
  }


  public PageDefinition userUrl(String userUrl) {
    
    this.userUrl = userUrl;
    return this;
  }

   /**
   * The URL of the page represented to the user
   * @return userUrl
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The URL of the page represented to the user")
  @JsonProperty(JSON_PROPERTY_USER_URL)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getUserUrl() {
    return userUrl;
  }


  @JsonProperty(JSON_PROPERTY_USER_URL)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setUserUrl(String userUrl) {
    this.userUrl = userUrl;
  }


  public PageDefinition user(User user) {
    
    this.user = user;
    return this;
  }

   /**
   * Get user
   * @return user
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")
  @JsonProperty(JSON_PROPERTY_USER)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public User getUser() {
    return user;
  }


  @JsonProperty(JSON_PROPERTY_USER)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setUser(User user) {
    this.user = user;
  }


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

   /**
   * Get id
   * @return id
  **/
  @ApiModelProperty(required = true, value = "")
  @JsonProperty(JSON_PROPERTY_ID)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public String getId() {
    return id;
  }


  @JsonProperty(JSON_PROPERTY_ID)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setId(String id) {
    this.id = id;
  }


  public PageDefinition messages(List<Message> messages) {
    
    this.messages = messages;
    return this;
  }

  public PageDefinition addMessagesItem(Message messagesItem) {
    if (this.messages == null) {
      this.messages = new ArrayList<>();
    }
    this.messages.add(messagesItem);
    return this;
  }

   /**
   * Get messages
   * @return messages
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")
  @JsonProperty(JSON_PROPERTY_MESSAGES)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public List<Message> getMessages() {
    return messages;
  }


  @JsonProperty(JSON_PROPERTY_MESSAGES)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setMessages(List<Message> messages) {
    this.messages = messages;
  }


  public PageDefinition urlPath(String urlPath) {
    
    this.urlPath = urlPath;
    return this;
  }

   /**
   * the current URL path
   * @return urlPath
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "the current URL path")
  @JsonProperty(JSON_PROPERTY_URL_PATH)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getUrlPath() {
    return urlPath;
  }


  @JsonProperty(JSON_PROPERTY_URL_PATH)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setUrlPath(String urlPath) {
    this.urlPath = urlPath;
  }


  public PageDefinition urlParameters(List<Parameter> urlParameters) {
    
    this.urlParameters = urlParameters;
    return this;
  }

  public PageDefinition addUrlParametersItem(Parameter urlParametersItem) {
    if (this.urlParameters == null) {
      this.urlParameters = new ArrayList<>();
    }
    this.urlParameters.add(urlParametersItem);
    return this;
  }

   /**
   * Get urlParameters
   * @return urlParameters
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")
  @JsonProperty(JSON_PROPERTY_URL_PARAMETERS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public List<Parameter> getUrlParameters() {
    return urlParameters;
  }


  @JsonProperty(JSON_PROPERTY_URL_PARAMETERS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setUrlParameters(List<Parameter> urlParameters) {
    this.urlParameters = urlParameters;
  }


  public PageDefinition urlTemplate(String urlTemplate) {
    
    this.urlTemplate = urlTemplate;
    return this;
  }

   /**
   * A complete template for teh full path this page can handle
   * @return urlTemplate
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "A complete template for teh full path this page can handle")
  @JsonProperty(JSON_PROPERTY_URL_TEMPLATE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getUrlTemplate() {
    return urlTemplate;
  }


  @JsonProperty(JSON_PROPERTY_URL_TEMPLATE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setUrlTemplate(String urlTemplate) {
    this.urlTemplate = urlTemplate;
  }


  public PageDefinition getParameters(Map<String, String> getParameters) {
    
    this.getParameters = getParameters;
    return this;
  }

  public PageDefinition putGetParametersItem(String key, String getParametersItem) {
    if (this.getParameters == null) {
      this.getParameters = new HashMap<>();
    }
    this.getParameters.put(key, getParametersItem);
    return this;
  }

   /**
   * Get getParameters
   * @return getParameters
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")
  @JsonProperty(JSON_PROPERTY_GET_PARAMETERS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Map<String, String> getGetParameters() {
    return getParameters;
  }


  @JsonProperty(JSON_PROPERTY_GET_PARAMETERS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setGetParameters(Map<String, String> getParameters) {
    this.getParameters = getParameters;
  }


  public PageDefinition sessionParameters(Map<String, String> sessionParameters) {
    
    this.sessionParameters = sessionParameters;
    return this;
  }

  public PageDefinition putSessionParametersItem(String key, String sessionParametersItem) {
    if (this.sessionParameters == null) {
      this.sessionParameters = new HashMap<>();
    }
    this.sessionParameters.put(key, sessionParametersItem);
    return this;
  }

   /**
   * Get sessionParameters
   * @return sessionParameters
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")
  @JsonProperty(JSON_PROPERTY_SESSION_PARAMETERS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Map<String, String> getSessionParameters() {
    return sessionParameters;
  }


  @JsonProperty(JSON_PROPERTY_SESSION_PARAMETERS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setSessionParameters(Map<String, String> sessionParameters) {
    this.sessionParameters = sessionParameters;
  }


  public PageDefinition title(Label title) {
    
    this.title = title;
    return this;
  }

   /**
   * Get title
   * @return title
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")
  @JsonProperty(JSON_PROPERTY_TITLE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Label getTitle() {
    return title;
  }


  @JsonProperty(JSON_PROPERTY_TITLE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setTitle(Label title) {
    this.title = title;
  }


  public PageDefinition links(List<Link> links) {
    
    this.links = links;
    return this;
  }

  public PageDefinition addLinksItem(Link linksItem) {
    if (this.links == null) {
      this.links = new ArrayList<>();
    }
    this.links.add(linksItem);
    return this;
  }

   /**
   * Get links
   * @return links
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")
  @JsonProperty(JSON_PROPERTY_LINKS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public List<Link> getLinks() {
    return links;
  }


  @JsonProperty(JSON_PROPERTY_LINKS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setLinks(List<Link> links) {
    this.links = links;
  }


  public PageDefinition sections(List<Section> sections) {
    
    this.sections = sections;
    return this;
  }

  public PageDefinition addSectionsItem(Section sectionsItem) {
    if (this.sections == null) {
      this.sections = new ArrayList<>();
    }
    this.sections.add(sectionsItem);
    return this;
  }

   /**
   * Get sections
   * @return sections
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")
  @JsonProperty(JSON_PROPERTY_SECTIONS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public List<Section> getSections() {
    return sections;
  }


  @JsonProperty(JSON_PROPERTY_SECTIONS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setSections(List<Section> sections) {
    this.sections = sections;
  }


  public PageDefinition appNGVersion(String appNGVersion) {
    
    this.appNGVersion = appNGVersion;
    return this;
  }

   /**
   * The version of appNG
   * @return appNGVersion
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The version of appNG")
  @JsonProperty(JSON_PROPERTY_APP_N_G_VERSION)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getAppNGVersion() {
    return appNGVersion;
  }


  @JsonProperty(JSON_PROPERTY_APP_N_G_VERSION)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setAppNGVersion(String appNGVersion) {
    this.appNGVersion = appNGVersion;
  }


  public PageDefinition appVersion(String appVersion) {
    
    this.appVersion = appVersion;
    return this;
  }

   /**
   * The version of the application
   * @return appVersion
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The version of the application")
  @JsonProperty(JSON_PROPERTY_APP_VERSION)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getAppVersion() {
    return appVersion;
  }


  @JsonProperty(JSON_PROPERTY_APP_VERSION)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setAppVersion(String appVersion) {
    this.appVersion = appVersion;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    PageDefinition pageDefinition = (PageDefinition) o;
    return Objects.equals(this.self, pageDefinition.self) &&
        Objects.equals(this.userUrl, pageDefinition.userUrl) &&
        Objects.equals(this.user, pageDefinition.user) &&
        Objects.equals(this.id, pageDefinition.id) &&
        Objects.equals(this.messages, pageDefinition.messages) &&
        Objects.equals(this.urlPath, pageDefinition.urlPath) &&
        Objects.equals(this.urlParameters, pageDefinition.urlParameters) &&
        Objects.equals(this.urlTemplate, pageDefinition.urlTemplate) &&
        Objects.equals(this.getParameters, pageDefinition.getParameters) &&
        Objects.equals(this.sessionParameters, pageDefinition.sessionParameters) &&
        Objects.equals(this.title, pageDefinition.title) &&
        Objects.equals(this.links, pageDefinition.links) &&
        Objects.equals(this.sections, pageDefinition.sections) &&
        Objects.equals(this.appNGVersion, pageDefinition.appNGVersion) &&
        Objects.equals(this.appVersion, pageDefinition.appVersion);
  }

  @Override
  public int hashCode() {
    return Objects.hash(self, userUrl, user, id, messages, urlPath, urlParameters, urlTemplate, getParameters, sessionParameters, title, links, sections, appNGVersion, appVersion);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class PageDefinition {\n");
    sb.append("    self: ").append(toIndentedString(self)).append("\n");
    sb.append("    userUrl: ").append(toIndentedString(userUrl)).append("\n");
    sb.append("    user: ").append(toIndentedString(user)).append("\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    messages: ").append(toIndentedString(messages)).append("\n");
    sb.append("    urlPath: ").append(toIndentedString(urlPath)).append("\n");
    sb.append("    urlParameters: ").append(toIndentedString(urlParameters)).append("\n");
    sb.append("    urlTemplate: ").append(toIndentedString(urlTemplate)).append("\n");
    sb.append("    getParameters: ").append(toIndentedString(getParameters)).append("\n");
    sb.append("    sessionParameters: ").append(toIndentedString(sessionParameters)).append("\n");
    sb.append("    title: ").append(toIndentedString(title)).append("\n");
    sb.append("    links: ").append(toIndentedString(links)).append("\n");
    sb.append("    sections: ").append(toIndentedString(sections)).append("\n");
    sb.append("    appNGVersion: ").append(toIndentedString(appNGVersion)).append("\n");
    sb.append("    appVersion: ").append(toIndentedString(appVersion)).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    ");
  }

}

