content: /*
   * Legal Entity Management API
   *
   * The version of the OpenAPI document: 4
   *
   *
   * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
   * https://openapi-generator.tech
   * Do not edit the class manually.
   */
  
  package com.adyen.model.legalentitymanagement;
  
  import com.fasterxml.jackson.annotation.JsonInclude;
  import com.fasterxml.jackson.annotation.JsonProperty;
  import com.fasterxml.jackson.annotation.JsonPropertyOrder;
  import com.fasterxml.jackson.core.JsonProcessingException;
  import java.util.*;
  import java.util.Arrays;
  
  /** Attachment */
  @JsonPropertyOrder({
    Attachment.JSON_PROPERTY_CONTENT,
    Attachment.JSON_PROPERTY_CONTENT_TYPE,
    Attachment.JSON_PROPERTY_FILENAME,
    Attachment.JSON_PROPERTY_PAGE_NAME,
    Attachment.JSON_PROPERTY_PAGE_TYPE
  })
  public class Attachment {
    public static final String JSON_PROPERTY_CONTENT = "content";
    private byte[] content;
  
    public static final String JSON_PROPERTY_CONTENT_TYPE = "contentType";
    @Deprecated // deprecated since Legal Entity Management API v1
    private String contentType;
  
    public static final String JSON_PROPERTY_FILENAME = "filename";
    @Deprecated // deprecated since Legal Entity Management API v1
    private String filename;
  
    public static final String JSON_PROPERTY_PAGE_NAME = "pageName";
    private String pageName;
  
    public static final String JSON_PROPERTY_PAGE_TYPE = "pageType";
    private String pageType;
  
    public Attachment() {}
  
    /**
     * The document in Base64-encoded string format.
     *
     * @param content The document in Base64-encoded string format.
     * @return the current {@code Attachment} instance, allowing for method chaining
     */
    public Attachment content(byte[] content) {
      this.content = content;
      return this;
    }
  
    /**
     * The document in Base64-encoded string format.
     *
     * @return content The document in Base64-encoded string format.
     */
    @JsonProperty(JSON_PROPERTY_CONTENT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public byte[] getContent() {
      return content;
    }
  
    /**
     * The document in Base64-encoded string format.
     *
     * @param content The document in Base64-encoded string format.
     */
    @JsonProperty(JSON_PROPERTY_CONTENT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setContent(byte[] content) {
      this.content = content;
    }
  
    /**
     * The file format. Possible values: **application/pdf**, **image/jpg**, **image/jpeg**,
     * **image/png**.
     *
     * @param contentType The file format. Possible values: **application/pdf**, **image/jpg**,
     *     **image/jpeg**, **image/png**.
     * @return the current {@code Attachment} instance, allowing for method chaining
     * @deprecated since Legal Entity Management API v1
     */
    @Deprecated // deprecated since Legal Entity Management API v1
    public Attachment contentType(String contentType) {
      this.contentType = contentType;
      return this;
    }
  
    /**
     * The file format. Possible values: **application/pdf**, **image/jpg**, **image/jpeg**,
     * **image/png**.
     *
     * @return contentType The file format. Possible values: **application/pdf**, **image/jpg**,
     *     **image/jpeg**, **image/png**.
     * @deprecated // deprecated since Legal Entity Management API v1
     */
    @Deprecated // deprecated since Legal Entity Management API v1
    @JsonProperty(JSON_PROPERTY_CONTENT_TYPE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getContentType() {
      return contentType;
    }
  
    /**
     * The file format. Possible values: **application/pdf**, **image/jpg**, **image/jpeg**,
     * **image/png**.
     *
     * @param contentType The file format. Possible values: **application/pdf**, **image/jpg**,
     *     **image/jpeg**, **image/png**.
     * @deprecated since Legal Entity Management API v1
     */
    @Deprecated // deprecated since Legal Entity Management API v1
    @JsonProperty(JSON_PROPERTY_CONTENT_TYPE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setContentType(String contentType) {
      this.contentType = contentType;
    }
  
    /**
     * The name of the file including the file extension.
     *
     * @param filename The name of the file including the file extension.
     * @return the current {@code Attachment} instance, allowing for method chaining
     * @deprecated since Legal Entity Management API v1
     */
    @Deprecated // deprecated since Legal Entity Management API v1
    public Attachment filename(String filename) {
      this.filename = filename;
      return this;
    }
  
    /**
     * The name of the file including the file extension.
     *
     * @return filename The name of the file including the file extension.
     * @deprecated // deprecated since Legal Entity Management API v1
     */
    @Deprecated // deprecated since Legal Entity Management API v1
    @JsonProperty(JSON_PROPERTY_FILENAME)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getFilename() {
      return filename;
    }
  
    /**
     * The name of the file including the file extension.
     *
     * @param filename The name of the file including the file extension.
     * @deprecated since Legal Entity Management API v1
     */
    @Deprecated // deprecated since Legal Entity Management API v1
    @JsonProperty(JSON_PROPERTY_FILENAME)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setFilename(String filename) {
      this.filename = filename;
    }
  
    /**
     * The name of the file including the file extension.
     *
     * @param pageName The name of the file including the file extension.
     * @return the current {@code Attachment} instance, allowing for method chaining
     */
    public Attachment pageName(String pageName) {
      this.pageName = pageName;
      return this;
    }
  
    /**
     * The name of the file including the file extension.
     *
     * @return pageName The name of the file including the file extension.
     */
    @JsonProperty(JSON_PROPERTY_PAGE_NAME)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getPageName() {
      return pageName;
    }
  
    /**
     * The name of the file including the file extension.
     *
     * @param pageName The name of the file including the file extension.
     */
    @JsonProperty(JSON_PROPERTY_PAGE_NAME)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setPageName(String pageName) {
      this.pageName = pageName;
    }
  
    /**
     * Specifies which side of the ID card is uploaded. * If the &#x60;type&#x60; is
     * **driversLicense** or **identityCard**, you must set this to **front** or **back**. * For any
     * other types, when this is omitted, we infer the page number based on the order of attachments.
     *
     * @param pageType Specifies which side of the ID card is uploaded. * If the &#x60;type&#x60; is
     *     **driversLicense** or **identityCard**, you must set this to **front** or **back**. * For
     *     any other types, when this is omitted, we infer the page number based on the order of
     *     attachments.
     * @return the current {@code Attachment} instance, allowing for method chaining
     */
    public Attachment pageType(String pageType) {
      this.pageType = pageType;
      return this;
    }
  
    /**
     * Specifies which side of the ID card is uploaded. * If the &#x60;type&#x60; is
     * **driversLicense** or **identityCard**, you must set this to **front** or **back**. * For any
     * other types, when this is omitted, we infer the page number based on the order of attachments.
     *
     * @return pageType Specifies which side of the ID card is uploaded. * If the &#x60;type&#x60; is
     *     **driversLicense** or **identityCard**, you must set this to **front** or **back**. * For
     *     any other types, when this is omitted, we infer the page number based on the order of
     *     attachments.
     */
    @JsonProperty(JSON_PROPERTY_PAGE_TYPE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getPageType() {
      return pageType;
    }
  
    /**
     * Specifies which side of the ID card is uploaded. * If the &#x60;type&#x60; is
     * **driversLicense** or **identityCard**, you must set this to **front** or **back**. * For any
     * other types, when this is omitted, we infer the page number based on the order of attachments.
     *
     * @param pageType Specifies which side of the ID card is uploaded. * If the &#x60;type&#x60; is
     *     **driversLicense** or **identityCard**, you must set this to **front** or **back**. * For
     *     any other types, when this is omitted, we infer the page number based on the order of
     *     attachments.
     */
    @JsonProperty(JSON_PROPERTY_PAGE_TYPE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setPageType(String pageType) {
      this.pageType = pageType;
    }
  
    /** Return true if this Attachment object is equal to o. */
    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      Attachment attachment = (Attachment) o;
      return Arrays.equals(this.content, attachment.content)
          && Objects.equals(this.contentType, attachment.contentType)
          && Objects.equals(this.filename, attachment.filename)
          && Objects.equals(this.pageName, attachment.pageName)
          && Objects.equals(this.pageType, attachment.pageType);
    }
  
    @Override
    public int hashCode() {
      return Objects.hash(Arrays.hashCode(content), contentType, filename, pageName, pageType);
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class Attachment {\n");
      sb.append("    content: ").append(toIndentedString(content)).append("\n");
      sb.append("    contentType: ").append(toIndentedString(contentType)).append("\n");
      sb.append("    filename: ").append(toIndentedString(filename)).append("\n");
      sb.append("    pageName: ").append(toIndentedString(pageName)).append("\n");
      sb.append("    pageType: ").append(toIndentedString(pageType)).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    ");
    }
  
    /**
     * Create an instance of Attachment given an JSON string
     *
     * @param jsonString JSON string
     * @return An instance of Attachment
     * @throws JsonProcessingException if the JSON string is invalid with respect to Attachment
     */
    public static Attachment fromJson(String jsonString) throws JsonProcessingException {
      return JSON.getMapper().readValue(jsonString, Attachment.class);
    }
  
    /**
     * Convert an instance of Attachment to an JSON string
     *
     * @return JSON string
     */
    public String toJson() throws JsonProcessingException {
      return JSON.getMapper().writeValueAsString(this);
    }
  }
  