All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openapitools.client.model.FulfillmentCreateRequest Maven / Gradle / Ivy

There is a newer version: 3.2.1
Show newest version
/*
* Quickstart API Reference
* Zuora Quickstart API is the API that helps you achieve fundamental use cases.
* It provides a much simplified object model and improved performance, enabling developers to easily learn and use.
*/

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.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.client.model.FulfillmentItemCreateRequestForFulfillmentPost;
import org.openapitools.client.model.FulfillmentProcessingOption;
import org.openapitools.client.model.FulfillmentRequest;
import org.openapitools.client.model.Revenue;
import org.openapitools.jackson.nullable.JsonNullable;
import org.threeten.bp.LocalDate;

import org.openapitools.client.JSON.CustomFieldAdapter;
import org.openapitools.client.JSON.NullableFieldAdapter;
/**
 * FulfillmentCreateRequest
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class FulfillmentCreateRequest {
  public static final String SERIALIZED_NAME_PROCESSING_OPTIONS = "processing_options";
  @SerializedName(SERIALIZED_NAME_PROCESSING_OPTIONS)
  private FulfillmentProcessingOption processingOptions;

  public static final String SERIALIZED_NAME_ORDER_LINE_ITEM_ID = "order_line_item_id";
  @SerializedName(SERIALIZED_NAME_ORDER_LINE_ITEM_ID)
  private String orderLineItemId;

  public static final String SERIALIZED_NAME_CARRIER = "carrier";
  @SerializedName(SERIALIZED_NAME_CARRIER)
  private String carrier;

  public static final String SERIALIZED_NAME_CUSTOM_FIELDS = "custom_fields";
  @SerializedName(SERIALIZED_NAME_CUSTOM_FIELDS)
  @JsonAdapter(CustomFieldAdapter.class)
  private Map customFields = null;

  public static final String SERIALIZED_NAME_DESCRIPTION = "description";
  @SerializedName(SERIALIZED_NAME_DESCRIPTION)
  private String description;

  public static final String SERIALIZED_NAME_REVENUE = "revenue";
  @SerializedName(SERIALIZED_NAME_REVENUE)
  private Revenue revenue;

  public static final String SERIALIZED_NAME_EXTERNAL_ID = "external_id";
  @SerializedName(SERIALIZED_NAME_EXTERNAL_ID)
  private String externalId;

  public static final String SERIALIZED_NAME_FULFILLMENT_DATE = "fulfillment_date";
  @SerializedName(SERIALIZED_NAME_FULFILLMENT_DATE)
  private LocalDate fulfillmentDate;

  public static final String SERIALIZED_NAME_LOCATION = "location";
  @SerializedName(SERIALIZED_NAME_LOCATION)
  private String location;

  public static final String SERIALIZED_NAME_FULFILLMENT_SYSTEM = "fulfillment_system";
  @SerializedName(SERIALIZED_NAME_FULFILLMENT_SYSTEM)
  private String fulfillmentSystem;

  /**
   * The type of fulfillment.
   */
  @JsonAdapter(TypeEnum.Adapter.class)
  public enum TypeEnum {
    DELIVERY("delivery"),
    
    RETURN("return"),
    
    UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");

    private String value;

    TypeEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static TypeEnum fromValue(String value) {
      for (TypeEnum b : TypeEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

    public static class Adapter extends TypeAdapter {
      @Override
      public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public TypeEnum read(final JsonReader jsonReader) throws IOException {
        String value =  jsonReader.nextString();
        return TypeEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_TYPE = "type";
  @SerializedName(SERIALIZED_NAME_TYPE)
  private TypeEnum type;

  public static final String SERIALIZED_NAME_QUANTITY = "quantity";
  @SerializedName(SERIALIZED_NAME_QUANTITY)
  private BigDecimal quantity;

  /**
   * The status of the invoice.
   */
  @JsonAdapter(StateEnum.Adapter.class)
  public enum StateEnum {
    ACCEPTED("accepted"),
    
    BOOKED("booked"),
    
    SENT_TO_BILLING("sent_to_billing"),
    
    COMPLETE("complete"),
    
    CANCELED("canceled"),
    
    UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");

    private String value;

    StateEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static StateEnum fromValue(String value) {
      for (StateEnum b : StateEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

    public static class Adapter extends TypeAdapter {
      @Override
      public void write(final JsonWriter jsonWriter, final StateEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public StateEnum read(final JsonReader jsonReader) throws IOException {
        String value =  jsonReader.nextString();
        return StateEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_STATE = "state";
  @SerializedName(SERIALIZED_NAME_STATE)
  private StateEnum state;

  public static final String SERIALIZED_NAME_TRACKING_NUMBER = "tracking_number";
  @SerializedName(SERIALIZED_NAME_TRACKING_NUMBER)
  private String trackingNumber;

  public static final String SERIALIZED_NAME_ITEMS = "items";
  @SerializedName(SERIALIZED_NAME_ITEMS)
  private List items = null;

  public FulfillmentCreateRequest() { 
  }

  public FulfillmentCreateRequest processingOptions(FulfillmentProcessingOption processingOptions) {
    
    this.processingOptions = processingOptions;
    return this;
  }

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

  public FulfillmentProcessingOption getProcessingOptions() {
    return processingOptions;
  }


  public void setProcessingOptions(FulfillmentProcessingOption processingOptions) {
    this.processingOptions = processingOptions;
  }


  public FulfillmentCreateRequest orderLineItemId(String orderLineItemId) {
    
    this.orderLineItemId = orderLineItemId;
    return this;
  }

   /**
   * The unique identifier of the associated order line item.
   * @return orderLineItemId
  **/
  @javax.annotation.Nonnull
  @ApiModelProperty(required = true, value = "The unique identifier of the associated order line item.")

  public String getOrderLineItemId() {
    return orderLineItemId;
  }


  public void setOrderLineItemId(String orderLineItemId) {
    this.orderLineItemId = orderLineItemId;
  }


  public FulfillmentCreateRequest carrier(String carrier) {
    
    this.carrier = carrier;
    return this;
  }

   /**
   * The name of the shipping carrier for this fulfillment.
   * @return carrier
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The name of the shipping carrier for this fulfillment.")

  public String getCarrier() {
    return carrier;
  }


  public void setCarrier(String carrier) {
    this.carrier = carrier;
  }


  public FulfillmentCreateRequest customFields(Map customFields) {
    
    this.customFields = customFields;
    return this;
  }

  public FulfillmentCreateRequest putCustomFieldsItem(String key, String customFieldsItem) {
    if (this.customFields == null) {
      this.customFields = new HashMap();
    }
    this.customFields.put(key, customFieldsItem);
    return this;
  }

   /**
   * Set of user-defined fields associated with this object. Useful for storing additional information about the object in a structured format.
   * @return customFields
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Set of user-defined fields associated with this object. Useful for storing additional information about the object in a structured format.")

  public Map getCustomFields() {
    return customFields;
  }


  public void setCustomFields(Map customFields) {
    this.customFields = customFields;
  }


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

   /**
   * An arbitrary string attached to the object. Often useful for displaying to users.
   * @return description
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "An arbitrary string attached to the object. Often useful for displaying to users.")

  public String getDescription() {
    return description;
  }


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


  public FulfillmentCreateRequest revenue(Revenue revenue) {
    
    this.revenue = revenue;
    return this;
  }

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

  public Revenue getRevenue() {
    return revenue;
  }


  public void setRevenue(Revenue revenue) {
    this.revenue = revenue;
  }


  public FulfillmentCreateRequest externalId(String externalId) {
    
    this.externalId = externalId;
    return this;
  }

   /**
   * An external identifier for the fulfillment
   * @return externalId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "An external identifier for the fulfillment")

  public String getExternalId() {
    return externalId;
  }


  public void setExternalId(String externalId) {
    this.externalId = externalId;
  }


  public FulfillmentCreateRequest fulfillmentDate(LocalDate fulfillmentDate) {
    
    this.fulfillmentDate = fulfillmentDate;
    return this;
  }

   /**
   * The date of the fulfillment.
   * @return fulfillmentDate
  **/
  @javax.annotation.Nonnull
  @ApiModelProperty(example = "Sat Jan 01 00:00:00 GMT 2022", required = true, value = "The date of the fulfillment.")

  public LocalDate getFulfillmentDate() {
    return fulfillmentDate;
  }


  public void setFulfillmentDate(LocalDate fulfillmentDate) {
    this.fulfillmentDate = fulfillmentDate;
  }


  public FulfillmentCreateRequest location(String location) {
    
    this.location = location;
    return this;
  }

   /**
   * The fulfillment location of the fulfillment.
   * @return location
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The fulfillment location of the fulfillment.")

  public String getLocation() {
    return location;
  }


  public void setLocation(String location) {
    this.location = location;
  }


  public FulfillmentCreateRequest fulfillmentSystem(String fulfillmentSystem) {
    
    this.fulfillmentSystem = fulfillmentSystem;
    return this;
  }

   /**
   * The fulfillment system for the fulfillment.
   * @return fulfillmentSystem
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The fulfillment system for the fulfillment.")

  public String getFulfillmentSystem() {
    return fulfillmentSystem;
  }


  public void setFulfillmentSystem(String fulfillmentSystem) {
    this.fulfillmentSystem = fulfillmentSystem;
  }


  public FulfillmentCreateRequest type(TypeEnum type) {
    
    this.type = type;
    return this;
  }

   /**
   * The type of fulfillment.
   * @return type
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The type of fulfillment.")

  public TypeEnum getType() {
    return type;
  }


  public void setType(TypeEnum type) {
    this.type = type;
  }


  public FulfillmentCreateRequest quantity(BigDecimal quantity) {
    
    this.quantity = quantity;
    return this;
  }

   /**
   * The number of units of this item.
   * @return quantity
  **/
  @javax.annotation.Nonnull
  @ApiModelProperty(required = true, value = "The number of units of this item.")

  public BigDecimal getQuantity() {
    return quantity;
  }


  public void setQuantity(BigDecimal quantity) {
    this.quantity = quantity;
  }


  public FulfillmentCreateRequest state(StateEnum state) {
    
    this.state = state;
    return this;
  }

   /**
   * The status of the invoice.
   * @return state
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The status of the invoice.")

  public StateEnum getState() {
    return state;
  }


  public void setState(StateEnum state) {
    this.state = state;
  }


  public FulfillmentCreateRequest trackingNumber(String trackingNumber) {
    
    this.trackingNumber = trackingNumber;
    return this;
  }

   /**
   * The tracking number of the fulfillment.
   * @return trackingNumber
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The tracking number of the fulfillment.")

  public String getTrackingNumber() {
    return trackingNumber;
  }


  public void setTrackingNumber(String trackingNumber) {
    this.trackingNumber = trackingNumber;
  }


  public FulfillmentCreateRequest items(List items) {
    
    this.items = items;
    return this;
  }

  public FulfillmentCreateRequest addItemsItem(FulfillmentItemCreateRequestForFulfillmentPost itemsItem) {
    if (this.items == null) {
      this.items = new ArrayList();
    }
    this.items.add(itemsItem);
    return this;
  }

   /**
   * Information of all fulfillment items.
   * @return items
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Information of all fulfillment items.")

  public List getItems() {
    return items;
  }


  public void setItems(List items) {
    this.items = items;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    FulfillmentCreateRequest fulfillmentCreateRequest = (FulfillmentCreateRequest) o;
    return Objects.equals(this.processingOptions, fulfillmentCreateRequest.processingOptions) &&
        Objects.equals(this.orderLineItemId, fulfillmentCreateRequest.orderLineItemId) &&
        Objects.equals(this.carrier, fulfillmentCreateRequest.carrier) &&
        Objects.equals(this.customFields, fulfillmentCreateRequest.customFields) &&
        Objects.equals(this.description, fulfillmentCreateRequest.description) &&
        Objects.equals(this.revenue, fulfillmentCreateRequest.revenue) &&
        Objects.equals(this.externalId, fulfillmentCreateRequest.externalId) &&
        Objects.equals(this.fulfillmentDate, fulfillmentCreateRequest.fulfillmentDate) &&
        Objects.equals(this.location, fulfillmentCreateRequest.location) &&
        Objects.equals(this.fulfillmentSystem, fulfillmentCreateRequest.fulfillmentSystem) &&
        Objects.equals(this.type, fulfillmentCreateRequest.type) &&
        Objects.equals(this.quantity, fulfillmentCreateRequest.quantity) &&
        Objects.equals(this.state, fulfillmentCreateRequest.state) &&
        Objects.equals(this.trackingNumber, fulfillmentCreateRequest.trackingNumber) &&
        Objects.equals(this.items, fulfillmentCreateRequest.items);
  }

  private static  boolean equalsNullable(JsonNullable a, JsonNullable b) {
    return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
  }

  @Override
  public int hashCode() {
    return Objects.hash(processingOptions, orderLineItemId, carrier, customFields, description, revenue, externalId, fulfillmentDate, location, fulfillmentSystem, type, quantity, state, trackingNumber, items);
  }

  private static  int hashCodeNullable(JsonNullable a) {
    if (a == null) {
      return 1;
    }
    return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class FulfillmentCreateRequest {\n");
    sb.append("    processingOptions: ").append(toIndentedString(processingOptions)).append("\n");
    sb.append("    orderLineItemId: ").append(toIndentedString(orderLineItemId)).append("\n");
    sb.append("    carrier: ").append(toIndentedString(carrier)).append("\n");
    sb.append("    customFields: ").append(toIndentedString(customFields)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    revenue: ").append(toIndentedString(revenue)).append("\n");
    sb.append("    externalId: ").append(toIndentedString(externalId)).append("\n");
    sb.append("    fulfillmentDate: ").append(toIndentedString(fulfillmentDate)).append("\n");
    sb.append("    location: ").append(toIndentedString(location)).append("\n");
    sb.append("    fulfillmentSystem: ").append(toIndentedString(fulfillmentSystem)).append("\n");
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    quantity: ").append(toIndentedString(quantity)).append("\n");
    sb.append("    state: ").append(toIndentedString(state)).append("\n");
    sb.append("    trackingNumber: ").append(toIndentedString(trackingNumber)).append("\n");
    sb.append("    items: ").append(toIndentedString(items)).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    ");
  }

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy