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

com.adobe.target.delivery.v1.model.RequestDetails Maven / Gradle / Ivy

There is a newer version: 2.6.1
Show newest version
/*
 * Copyright 2021 Adobe. All rights reserved.
 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License. You may obtain a copy
 * of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
 * OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 *
 * NOTE: This is an auto generated file. Do not edit directly.
 */
package com.adobe.target.delivery.v1.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/**
 * Object common for prefetch, execute and notifications in order to specify the request details.
 */
public class RequestDetails {
  @JsonProperty("$_type")
  protected String $type;

  @JsonProperty("address")
  private Address address;

  @JsonProperty("parameters")
  private Map parameters = new HashMap<>();

  @JsonProperty("profileParameters")
  private Map profileParameters = new HashMap<>();

  @JsonProperty("order")
  private Order order;

  @JsonProperty("product")
  private Product product;

  public RequestDetails $type(String $type) {
    this.$type = $type;
    return this;
  }

  /**
   * Get $type
   *
   * @return $type
   */
  public String get$Type() {
    return $type;
  }

  public void set$Type(String $type) {
    this.$type = $type;
  }

  public RequestDetails address(Address address) {
    this.address = address;
    return this;
  }

  /**
   * Get address
   *
   * @return address
   */
  public Address getAddress() {
    return address;
  }

  public void setAddress(Address address) {
    this.address = address;
  }

  public RequestDetails parameters(Map parameters) {
    this.parameters = parameters;
    return this;
  }

  public RequestDetails putParametersItem(String key, String parametersItem) {
    if (this.parameters == null) {
      this.parameters = new HashMap<>();
    }
    this.parameters.put(key, parametersItem);
    return this;
  }

  /**
   * Parameters map. Same object is reused for mbox or profile parameters with slight validation
   * differences. Following names are not allowed for mbox parameters: 'orderId',
   * 'orderTotal', productPurchasedIds' Validation (for both mbox and profile
   * parameters): * Max 50 parameters limit. * Parameter name should not be blank. * Parameter name
   * max length 128. * Parameter name should not start with 'profile.' * Parameter value
   * length max 5000.
   *
   * @return parameters
   */
  public Map getParameters() {
    return parameters;
  }

  public void setParameters(Map parameters) {
    this.parameters = parameters;
  }

  public RequestDetails profileParameters(Map profileParameters) {
    this.profileParameters = profileParameters;
    return this;
  }

  public RequestDetails putProfileParametersItem(String key, String profileParametersItem) {
    if (this.profileParameters == null) {
      this.profileParameters = new HashMap<>();
    }
    this.profileParameters.put(key, profileParametersItem);
    return this;
  }

  /**
   * Parameters map. Same object is reused for mbox or profile parameters with slight validation
   * differences. Following names are not allowed for mbox parameters: 'orderId',
   * 'orderTotal', productPurchasedIds' Validation (for both mbox and profile
   * parameters): * Max 50 parameters limit. * Parameter name should not be blank. * Parameter name
   * max length 128. * Parameter name should not start with 'profile.' * Parameter value
   * length max 5000.
   *
   * @return profileParameters
   */
  public Map getProfileParameters() {
    return profileParameters;
  }

  public void setProfileParameters(Map profileParameters) {
    this.profileParameters = profileParameters;
  }

  public RequestDetails order(Order order) {
    this.order = order;
    return this;
  }

  /**
   * Get order
   *
   * @return order
   */
  public Order getOrder() {
    return order;
  }

  public void setOrder(Order order) {
    this.order = order;
  }

  public RequestDetails product(Product product) {
    this.product = product;
    return this;
  }

  /**
   * Get product
   *
   * @return product
   */
  public Product getProduct() {
    return product;
  }

  public void setProduct(Product product) {
    this.product = product;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    RequestDetails requestDetails = (RequestDetails) o;
    return Objects.equals(this.$type, requestDetails.$type)
        && Objects.equals(this.address, requestDetails.address)
        && Objects.equals(this.parameters, requestDetails.parameters)
        && Objects.equals(this.profileParameters, requestDetails.profileParameters)
        && Objects.equals(this.order, requestDetails.order)
        && Objects.equals(this.product, requestDetails.product);
  }

  @Override
  public int hashCode() {
    return Objects.hash($type, address, parameters, profileParameters, order, product);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class RequestDetails {\n");
    sb.append("    $type: ").append(toIndentedString($type)).append("\n");
    sb.append("    address: ").append(toIndentedString(address)).append("\n");
    sb.append("    parameters: ").append(toIndentedString(parameters)).append("\n");
    sb.append("    profileParameters: ").append(toIndentedString(profileParameters)).append("\n");
    sb.append("    order: ").append(toIndentedString(order)).append("\n");
    sb.append("    product: ").append(toIndentedString(product)).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 - 2024 Weber Informatics LLC | Privacy Policy