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

com.paypal.sdk.models.OrderAuthorizeRequest Maven / Gradle / Ivy

/*
 * PaypalServerSDKLib
 *
 * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
 */

package com.paypal.sdk.models;

import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonSetter;

/**
 * This is a model class for OrderAuthorizeRequest type.
 */
public class OrderAuthorizeRequest {
    private OrderAuthorizeRequestPaymentSource paymentSource;

    /**
     * Default constructor.
     */
    public OrderAuthorizeRequest() {
    }

    /**
     * Initialization constructor.
     * @param  paymentSource  OrderAuthorizeRequestPaymentSource value for paymentSource.
     */
    public OrderAuthorizeRequest(
            OrderAuthorizeRequestPaymentSource paymentSource) {
        this.paymentSource = paymentSource;
    }

    /**
     * Getter for PaymentSource.
     * The payment source definition.
     * @return Returns the OrderAuthorizeRequestPaymentSource
     */
    @JsonGetter("payment_source")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public OrderAuthorizeRequestPaymentSource getPaymentSource() {
        return paymentSource;
    }

    /**
     * Setter for PaymentSource.
     * The payment source definition.
     * @param paymentSource Value for OrderAuthorizeRequestPaymentSource
     */
    @JsonSetter("payment_source")
    public void setPaymentSource(OrderAuthorizeRequestPaymentSource paymentSource) {
        this.paymentSource = paymentSource;
    }

    /**
     * Converts this OrderAuthorizeRequest into string format.
     * @return String representation of this class
     */
    @Override
    public String toString() {
        return "OrderAuthorizeRequest [" + "paymentSource=" + paymentSource + "]";
    }

    /**
     * Builds a new {@link OrderAuthorizeRequest.Builder} object.
     * Creates the instance with the state of the current model.
     * @return a new {@link OrderAuthorizeRequest.Builder} object
     */
    public Builder toBuilder() {
        Builder builder = new Builder()
                .paymentSource(getPaymentSource());
        return builder;
    }

    /**
     * Class to build instances of {@link OrderAuthorizeRequest}.
     */
    public static class Builder {
        private OrderAuthorizeRequestPaymentSource paymentSource;



        /**
         * Setter for paymentSource.
         * @param  paymentSource  OrderAuthorizeRequestPaymentSource value for paymentSource.
         * @return Builder
         */
        public Builder paymentSource(OrderAuthorizeRequestPaymentSource paymentSource) {
            this.paymentSource = paymentSource;
            return this;
        }

        /**
         * Builds a new {@link OrderAuthorizeRequest} object using the set fields.
         * @return {@link OrderAuthorizeRequest}
         */
        public OrderAuthorizeRequest build() {
            return new OrderAuthorizeRequest(paymentSource);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy