/*
 * Copyright 2010-2013 Ning, Inc.
 * Copyright 2015 Groupon, Inc
 * Copyright 2015 The Billing Project, LLC
 *
 * The Billing Project licenses this file 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 CONDITIONS OF ANY KIND, either express or implied.  See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */

package org.killbill.billing.client.model;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

public class ComboPaymentTransaction extends KillBillObject {

    private Account account;
    private PaymentMethod paymentMethod;
    private PaymentTransaction transaction;

    public ComboPaymentTransaction() { }

    @JsonCreator
    public ComboPaymentTransaction(@JsonProperty("account") final Account account,
                                   @JsonProperty("paymentMethod") final PaymentMethod paymentMethod,
                                   @JsonProperty("transaction") final PaymentTransaction transaction) {
        super(null);
        this.account = account;
        this.paymentMethod = paymentMethod;
        this.transaction = transaction;
    }

    public Account getAccount() {
        return account;
    }

    public PaymentMethod getPaymentMethod() {
        return paymentMethod;
    }

    public PaymentTransaction getTransaction() {
        return transaction;
    }

    @Override
    public String toString() {
        return "ComboPaymentTransaction{" +
               "account=" + account +
               ", paymentMethod=" + paymentMethod +
               ", transaction=" + transaction +
               '}';
    }

    @Override
    public boolean equals(final Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof ComboPaymentTransaction)) {
            return false;
        }

        final ComboPaymentTransaction that = (ComboPaymentTransaction) o;

        if (account != null ? !account.equals(that.account) : that.account != null) {
            return false;
        }
        if (paymentMethod != null ? !paymentMethod.equals(that.paymentMethod) : that.paymentMethod != null) {
            return false;
        }
        return !(transaction != null ? !transaction.equals(that.transaction) : that.transaction != null);

    }

    @Override
    public int hashCode() {
        int result = account != null ? account.hashCode() : 0;
        result = 31 * result + (paymentMethod != null ? paymentMethod.hashCode() : 0);
        result = 31 * result + (transaction != null ? transaction.hashCode() : 0);
        return result;
    }
}

@@ -750,16 +750,40 @@
 model;%0A%0A
+import java.util.List;%0A%0A
 import c
@@ -1059,16 +1059,143 @@
 action;%0A
+    private List%3CPluginProperty%3E paymentMethodPluginProperties;%0A    private List%3CPluginProperty%3E transactionPluginProperties;%0A%0A
 %0A    pub
@@ -1534,379 +1534,1043 @@
 tion
-) %7B%0A        super(null);%0A        this.account = account;%0A        this.paymentMethod = paymentMethod;%0A        this.transaction = transaction;%0A    %7D%0A%0A    public Account getAccount() %7B%0A        return account;%0A    %7D%0A%0A    public PaymentMethod getPaymentMethod() %7B%0A        return paymentMethod;%0A    %7D%0A%0A    public PaymentTransaction getTransaction() %7B%0A        return transaction
+,%0A                                   @JsonProperty(%22paymentMethodPluginProperties%22) final List%3CPluginProperty%3E paymentMethodPluginProperties,%0A                                   @JsonProperty(%22transactionPluginProperties%22) final List%3CPluginProperty%3E transactionPluginProperties) %7B%0A        super(null);%0A        this.account = account;%0A        this.paymentMethod = paymentMethod;%0A        this.transaction = transaction;%0A        this.paymentMethodPluginProperties = paymentMethodPluginProperties;%0A        this.transactionPluginProperties = transactionPluginProperties;%0A    %7D%0A%0A    public Account getAccount() %7B%0A        return account;%0A    %7D%0A%0A    public PaymentMethod getPaymentMethod() %7B%0A        return paymentMethod;%0A    %7D%0A%0A    public PaymentTransaction getTransaction() %7B%0A        return transaction;%0A    %7D%0A%0A    public List%3CPluginProperty%3E getPaymentMethodPluginProperties() %7B%0A        return paymentMethodPluginProperties;%0A    %7D%0A%0A    public List%3CPluginProperty%3E getTransactionPluginProperties() %7B%0A        return transactionPluginProperties
 ;%0A  
@@ -2801,16 +2801,180 @@
 ction +%0A
+               %22, paymentMethodPluginProperties=%22 + paymentMethodPluginProperties +%0A               %22, transactionPluginProperties=%22 + transactionPluginProperties +%0A
         
@@ -3537,32 +3537,380 @@
 alse;%0A        %7D%0A
+        if (transaction != null ? !transaction.equals(that.transaction) : that.transaction != null) %7B%0A            return false;%0A        %7D%0A        if (paymentMethodPluginProperties != null ? !paymentMethodPluginProperties.equals(that.paymentMethodPluginProperties) : that.paymentMethodPluginProperties != null) %7B%0A            return false;%0A        %7D%0A
         return !
@@ -3913,32 +3913,48 @@
 rn !(transaction
+PluginProperties
  != null ? !tran
@@ -3952,32 +3952,48 @@
 l ? !transaction
+PluginProperties
 .equals(that.tra
@@ -3992,32 +3992,48 @@
 that.transaction
+PluginProperties
 ) : that.transac
@@ -4028,32 +4028,48 @@
 that.transaction
+PluginProperties
  != null);%0A%0A    
@@ -4338,32 +4338,266 @@
 ashCode() : 0);%0A
+        result = 31 * result + (paymentMethodPluginProperties != null ? paymentMethodPluginProperties.hashCode() : 0);%0A        result = 31 * result + (transactionPluginProperties != null ? transactionPluginProperties.hashCode() : 0);%0A
         return r

Add plugin properties per operations in payment combo call