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

com.paypal.sdk.models.AuthorizationsVoidInput 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 AuthorizationsVoidInput type.
 */
public class AuthorizationsVoidInput {
    private String authorizationId;
    private String payPalAuthAssertion;
    private String prefer;

    /**
     * Default constructor.
     */
    public AuthorizationsVoidInput() {
        prefer = "return=minimal";
    }

    /**
     * Initialization constructor.
     * @param  authorizationId  String value for authorizationId.
     * @param  payPalAuthAssertion  String value for payPalAuthAssertion.
     * @param  prefer  String value for prefer.
     */
    public AuthorizationsVoidInput(
            String authorizationId,
            String payPalAuthAssertion,
            String prefer) {
        this.authorizationId = authorizationId;
        this.payPalAuthAssertion = payPalAuthAssertion;
        this.prefer = prefer;
    }

    /**
     * Getter for AuthorizationId.
     * The PayPal-generated ID for the authorized payment to void.
     * @return Returns the String
     */
    @JsonGetter("authorization_id")
    public String getAuthorizationId() {
        return authorizationId;
    }

    /**
     * Setter for AuthorizationId.
     * The PayPal-generated ID for the authorized payment to void.
     * @param authorizationId Value for String
     */
    @JsonSetter("authorization_id")
    public void setAuthorizationId(String authorizationId) {
        this.authorizationId = authorizationId;
    }

    /**
     * Getter for PayPalAuthAssertion.
     * An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For
     * details, see
     * [PayPal-Auth-Assertion](/docs/api/reference/api-requests/#paypal-auth-assertion).<blockquote><strong>Note:</strong>For
     * three party transactions in which a partner is managing the API calls on behalf of a
     * merchant, the partner must identify the merchant using either a PayPal-Auth-Assertion header
     * or an access token with target_subject.</blockquote>
     * @return Returns the String
     */
    @JsonGetter("PayPal-Auth-Assertion")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public String getPayPalAuthAssertion() {
        return payPalAuthAssertion;
    }

    /**
     * Setter for PayPalAuthAssertion.
     * An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For
     * details, see
     * [PayPal-Auth-Assertion](/docs/api/reference/api-requests/#paypal-auth-assertion).<blockquote><strong>Note:</strong>For
     * three party transactions in which a partner is managing the API calls on behalf of a
     * merchant, the partner must identify the merchant using either a PayPal-Auth-Assertion header
     * or an access token with target_subject.</blockquote>
     * @param payPalAuthAssertion Value for String
     */
    @JsonSetter("PayPal-Auth-Assertion")
    public void setPayPalAuthAssertion(String payPalAuthAssertion) {
        this.payPalAuthAssertion = payPalAuthAssertion;
    }

    /**
     * Getter for Prefer.
     * The preferred server response upon successful completion of the request. Value
     * is:<ul><li><code>return=minimal</code>. The server returns a minimal response to optimize
     * communication between the API caller and the server. A minimal response includes the
     * <code>id</code>, <code>status</code> and HATEOAS
     * links.</li><li><code>return=representation</code>. The server returns a complete resource
     * representation, including the current state of the resource.</li></ul>
     * @return Returns the String
     */
    @JsonGetter("Prefer")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public String getPrefer() {
        return prefer;
    }

    /**
     * Setter for Prefer.
     * The preferred server response upon successful completion of the request. Value
     * is:<ul><li><code>return=minimal</code>. The server returns a minimal response to optimize
     * communication between the API caller and the server. A minimal response includes the
     * <code>id</code>, <code>status</code> and HATEOAS
     * links.</li><li><code>return=representation</code>. The server returns a complete resource
     * representation, including the current state of the resource.</li></ul>
     * @param prefer Value for String
     */
    @JsonSetter("Prefer")
    public void setPrefer(String prefer) {
        this.prefer = prefer;
    }

    /**
     * Converts this AuthorizationsVoidInput into string format.
     * @return String representation of this class
     */
    @Override
    public String toString() {
        return "AuthorizationsVoidInput [" + "authorizationId=" + authorizationId
                + ", payPalAuthAssertion=" + payPalAuthAssertion + ", prefer=" + prefer + "]";
    }

    /**
     * Builds a new {@link AuthorizationsVoidInput.Builder} object.
     * Creates the instance with the state of the current model.
     * @return a new {@link AuthorizationsVoidInput.Builder} object
     */
    public Builder toBuilder() {
        Builder builder = new Builder(authorizationId)
                .payPalAuthAssertion(getPayPalAuthAssertion())
                .prefer(getPrefer());
        return builder;
    }

    /**
     * Class to build instances of {@link AuthorizationsVoidInput}.
     */
    public static class Builder {
        private String authorizationId;
        private String payPalAuthAssertion;
        private String prefer = "return=minimal";

        /**
         * Initialization constructor.
         */
        public Builder() {
        }

        /**
         * Initialization constructor.
         * @param  authorizationId  String value for authorizationId.
         */
        public Builder(String authorizationId) {
            this.authorizationId = authorizationId;
        }

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

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

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

        /**
         * Builds a new {@link AuthorizationsVoidInput} object using the set fields.
         * @return {@link AuthorizationsVoidInput}
         */
        public AuthorizationsVoidInput build() {
            return new AuthorizationsVoidInput(authorizationId, payPalAuthAssertion, prefer);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy