content: /*
   * Open Banking API
   *
   * The version of the OpenAPI document: 1
   *
   *
   * 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.openbanking;
  
  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.*;
  
  /** AccountParty */
  @JsonPropertyOrder({AccountParty.JSON_PROPERTY_IDENTITY, AccountParty.JSON_PROPERTY_ROLE})
  public class AccountParty {
    public static final String JSON_PROPERTY_IDENTITY = "identity";
    private Identity identity;
  
    public static final String JSON_PROPERTY_ROLE = "role";
    private PartyRole role;
  
    public AccountParty() {}
  
    /**
     * identity
     *
     * @param identity
     * @return the current {@code AccountParty} instance, allowing for method chaining
     */
    public AccountParty identity(Identity identity) {
      this.identity = identity;
      return this;
    }
  
    /**
     * Get identity
     *
     * @return identity
     */
    @JsonProperty(JSON_PROPERTY_IDENTITY)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public Identity getIdentity() {
      return identity;
    }
  
    /**
     * identity
     *
     * @param identity
     */
    @JsonProperty(JSON_PROPERTY_IDENTITY)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setIdentity(Identity identity) {
      this.identity = identity;
    }
  
    /**
     * role
     *
     * @param role
     * @return the current {@code AccountParty} instance, allowing for method chaining
     */
    public AccountParty role(PartyRole role) {
      this.role = role;
      return this;
    }
  
    /**
     * Get role
     *
     * @return role
     */
    @JsonProperty(JSON_PROPERTY_ROLE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public PartyRole getRole() {
      return role;
    }
  
    /**
     * role
     *
     * @param role
     */
    @JsonProperty(JSON_PROPERTY_ROLE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setRole(PartyRole role) {
      this.role = role;
    }
  
    /** Return true if this AccountParty object is equal to o. */
    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      AccountParty accountParty = (AccountParty) o;
      return Objects.equals(this.identity, accountParty.identity)
          && Objects.equals(this.role, accountParty.role);
    }
  
    @Override
    public int hashCode() {
      return Objects.hash(identity, role);
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class AccountParty {\n");
      sb.append("    identity: ").append(toIndentedString(identity)).append("\n");
      sb.append("    role: ").append(toIndentedString(role)).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 AccountParty given an JSON string
     *
     * @param jsonString JSON string
     * @return An instance of AccountParty
     * @throws JsonProcessingException if the JSON string is invalid with respect to AccountParty
     */
    public static AccountParty fromJson(String jsonString) throws JsonProcessingException {
      return JSON.getMapper().readValue(jsonString, AccountParty.class);
    }
  
    /**
     * Convert an instance of AccountParty to an JSON string
     *
     * @return JSON string
     */
    public String toJson() throws JsonProcessingException {
      return JSON.getMapper().writeValueAsString(this);
    }
  }
  