/*
 * Swagger of Opencellsoft Api
 * @#Introduction
 *
 * The version of the OpenAPI document: 7.3.1-SNAPSHOT
 * Contact: contact@opencellsoft.fr
 *
 * 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.openapitools.client.model;

import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.openapitools.client.model.OrderLinks;
import org.openapitools.client.model.Resource;
import org.openapitools.client.model.ServiceInstance;

/**
 * Subscription
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2019-09-13T10:03:17.753Z[GMT]")
public class Subscription {
  public static final String SERIALIZED_NAME_CODE = "code";
  @SerializedName(SERIALIZED_NAME_CODE)
  private String code;

  public static final String SERIALIZED_NAME_OFFER_TEMPLATE = "offerTemplate";
  @SerializedName(SERIALIZED_NAME_OFFER_TEMPLATE)
  private Resource offerTemplate;

  public static final String SERIALIZED_NAME_SELLER = "seller";
  @SerializedName(SERIALIZED_NAME_SELLER)
  private Resource seller;

  public static final String SERIALIZED_NAME_USER_ACCOUNT = "userAccount";
  @SerializedName(SERIALIZED_NAME_USER_ACCOUNT)
  private Resource userAccount;

  public static final String SERIALIZED_NAME_SUBSCRIPTION_DATE = "subscriptionDate";
  @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_DATE)
  private String subscriptionDate;

  public static final String SERIALIZED_NAME_END_AGREEMENT_DATE = "endAgreementDate";
  @SerializedName(SERIALIZED_NAME_END_AGREEMENT_DATE)
  private String endAgreementDate;

  public static final String SERIALIZED_NAME_SERVICE_INSTANCES = "serviceInstances";
  @SerializedName(SERIALIZED_NAME_SERVICE_INSTANCES)
  private List<ServiceInstance> serviceInstances = null;

  public static final String SERIALIZED_NAME_LINKS = "links";
  @SerializedName(SERIALIZED_NAME_LINKS)
  private List<OrderLinks> links = null;

  public static final String SERIALIZED_NAME_ID = "id";
  @SerializedName(SERIALIZED_NAME_ID)
  private Long id;


  public Subscription code(String code) {
    
    this.code = code;
    return this;
  }

   /**
   * Get code
   * @return code
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public String getCode() {
    return code;
  }



  public void setCode(String code) {
    this.code = code;
  }


  public Subscription offerTemplate(Resource offerTemplate) {
    
    this.offerTemplate = offerTemplate;
    return this;
  }

   /**
   * Get offerTemplate
   * @return offerTemplate
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Resource getOfferTemplate() {
    return offerTemplate;
  }



  public void setOfferTemplate(Resource offerTemplate) {
    this.offerTemplate = offerTemplate;
  }


  public Subscription seller(Resource seller) {
    
    this.seller = seller;
    return this;
  }

   /**
   * Get seller
   * @return seller
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Resource getSeller() {
    return seller;
  }



  public void setSeller(Resource seller) {
    this.seller = seller;
  }


  public Subscription userAccount(Resource userAccount) {
    
    this.userAccount = userAccount;
    return this;
  }

   /**
   * Get userAccount
   * @return userAccount
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Resource getUserAccount() {
    return userAccount;
  }



  public void setUserAccount(Resource userAccount) {
    this.userAccount = userAccount;
  }


  public Subscription subscriptionDate(String subscriptionDate) {
    
    this.subscriptionDate = subscriptionDate;
    return this;
  }

   /**
   * Get subscriptionDate
   * @return subscriptionDate
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public String getSubscriptionDate() {
    return subscriptionDate;
  }



  public void setSubscriptionDate(String subscriptionDate) {
    this.subscriptionDate = subscriptionDate;
  }


  public Subscription endAgreementDate(String endAgreementDate) {
    
    this.endAgreementDate = endAgreementDate;
    return this;
  }

   /**
   * Get endAgreementDate
   * @return endAgreementDate
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public String getEndAgreementDate() {
    return endAgreementDate;
  }



  public void setEndAgreementDate(String endAgreementDate) {
    this.endAgreementDate = endAgreementDate;
  }


  public Subscription serviceInstances(List<ServiceInstance> serviceInstances) {
    
    this.serviceInstances = serviceInstances;
    return this;
  }

  public Subscription addServiceInstancesItem(ServiceInstance serviceInstancesItem) {
    if (this.serviceInstances == null) {
      this.serviceInstances = new ArrayList<ServiceInstance>();
    }
    this.serviceInstances.add(serviceInstancesItem);
    return this;
  }

   /**
   * Get serviceInstances
   * @return serviceInstances
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public List<ServiceInstance> getServiceInstances() {
    return serviceInstances;
  }



  public void setServiceInstances(List<ServiceInstance> serviceInstances) {
    this.serviceInstances = serviceInstances;
  }


  public Subscription links(List<OrderLinks> links) {
    
    this.links = links;
    return this;
  }

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

   /**
   * Get links
   * @return links
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

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



  public void setLinks(List<OrderLinks> links) {
    this.links = links;
  }


  public Subscription id(Long id) {
    
    this.id = id;
    return this;
  }

   /**
   * Get id
   * @return id
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Long getId() {
    return id;
  }



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


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Subscription subscription = (Subscription) o;
    return Objects.equals(this.code, subscription.code) &&
        Objects.equals(this.offerTemplate, subscription.offerTemplate) &&
        Objects.equals(this.seller, subscription.seller) &&
        Objects.equals(this.userAccount, subscription.userAccount) &&
        Objects.equals(this.subscriptionDate, subscription.subscriptionDate) &&
        Objects.equals(this.endAgreementDate, subscription.endAgreementDate) &&
        Objects.equals(this.serviceInstances, subscription.serviceInstances) &&
        Objects.equals(this.links, subscription.links) &&
        Objects.equals(this.id, subscription.id);
  }

  @Override
  public int hashCode() {
    return Objects.hash(code, offerTemplate, seller, userAccount, subscriptionDate, endAgreementDate, serviceInstances, links, id);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class Subscription {\n");
    sb.append("    code: ").append(toIndentedString(code)).append("\n");
    sb.append("    offerTemplate: ").append(toIndentedString(offerTemplate)).append("\n");
    sb.append("    seller: ").append(toIndentedString(seller)).append("\n");
    sb.append("    userAccount: ").append(toIndentedString(userAccount)).append("\n");
    sb.append("    subscriptionDate: ").append(toIndentedString(subscriptionDate)).append("\n");
    sb.append("    endAgreementDate: ").append(toIndentedString(endAgreementDate)).append("\n");
    sb.append("    serviceInstances: ").append(toIndentedString(serviceInstances)).append("\n");
    sb.append("    links: ").append(toIndentedString(links)).append("\n");
    sb.append("    id: ").append(toIndentedString(id)).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(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

