com.paypal.sdk.models.CapturesRefundInput 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 CapturesRefundInput type.
*/
public class CapturesRefundInput {
private String captureId;
private String contentType;
private String payPalRequestId;
private String prefer;
private String payPalAuthAssertion;
private RefundRequest body;
/**
* Default constructor.
*/
public CapturesRefundInput() {
contentType = "application/json";
prefer = "return=minimal";
}
/**
* Initialization constructor.
* @param captureId String value for captureId.
* @param contentType String value for contentType.
* @param payPalRequestId String value for payPalRequestId.
* @param prefer String value for prefer.
* @param payPalAuthAssertion String value for payPalAuthAssertion.
* @param body RefundRequest value for body.
*/
public CapturesRefundInput(
String captureId,
String contentType,
String payPalRequestId,
String prefer,
String payPalAuthAssertion,
RefundRequest body) {
this.captureId = captureId;
this.contentType = contentType;
this.payPalRequestId = payPalRequestId;
this.prefer = prefer;
this.payPalAuthAssertion = payPalAuthAssertion;
this.body = body;
}
/**
* Getter for CaptureId.
* The PayPal-generated ID for the captured payment to refund.
* @return Returns the String
*/
@JsonGetter("capture_id")
public String getCaptureId() {
return captureId;
}
/**
* Setter for CaptureId.
* The PayPal-generated ID for the captured payment to refund.
* @param captureId Value for String
*/
@JsonSetter("capture_id")
public void setCaptureId(String captureId) {
this.captureId = captureId;
}
/**
* Getter for ContentType.
* @return Returns the String
*/
@JsonGetter("Content-Type")
public String getContentType() {
return contentType;
}
/**
* Setter for ContentType.
* @param contentType Value for String
*/
@JsonSetter("Content-Type")
private void setContentType(String contentType) {
this.contentType = contentType;
}
/**
* Getter for PayPalRequestId.
* The server stores keys for 45 days.
* @return Returns the String
*/
@JsonGetter("PayPal-Request-Id")
@JsonInclude(JsonInclude.Include.NON_NULL)
public String getPayPalRequestId() {
return payPalRequestId;
}
/**
* Setter for PayPalRequestId.
* The server stores keys for 45 days.
* @param payPalRequestId Value for String
*/
@JsonSetter("PayPal-Request-Id")
public void setPayPalRequestId(String payPalRequestId) {
this.payPalRequestId = payPalRequestId;
}
/**
* 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;
}
/**
* 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 Body.
* @return Returns the RefundRequest
*/
@JsonGetter("body")
@JsonInclude(JsonInclude.Include.NON_NULL)
public RefundRequest getBody() {
return body;
}
/**
* Setter for Body.
* @param body Value for RefundRequest
*/
@JsonSetter("body")
public void setBody(RefundRequest body) {
this.body = body;
}
/**
* Converts this CapturesRefundInput into string format.
* @return String representation of this class
*/
@Override
public String toString() {
return "CapturesRefundInput [" + "captureId=" + captureId + ", contentType=" + contentType
+ ", payPalRequestId=" + payPalRequestId + ", prefer=" + prefer
+ ", payPalAuthAssertion=" + payPalAuthAssertion + ", body=" + body + "]";
}
/**
* Builds a new {@link CapturesRefundInput.Builder} object.
* Creates the instance with the state of the current model.
* @return a new {@link CapturesRefundInput.Builder} object
*/
public Builder toBuilder() {
Builder builder = new Builder(captureId, contentType)
.payPalRequestId(getPayPalRequestId())
.prefer(getPrefer())
.payPalAuthAssertion(getPayPalAuthAssertion())
.body(getBody());
return builder;
}
/**
* Class to build instances of {@link CapturesRefundInput}.
*/
public static class Builder {
private String captureId;
private String contentType = "application/json";
private String payPalRequestId;
private String prefer = "return=minimal";
private String payPalAuthAssertion;
private RefundRequest body;
/**
* Initialization constructor.
*/
public Builder() {
}
/**
* Initialization constructor.
* @param captureId String value for captureId.
* @param contentType String value for contentType.
*/
public Builder(String captureId, String contentType) {
this.captureId = captureId;
this.contentType = contentType;
}
/**
* Setter for captureId.
* @param captureId String value for captureId.
* @return Builder
*/
public Builder captureId(String captureId) {
this.captureId = captureId;
return this;
}
/**
* Setter for contentType.
* @param contentType String value for contentType.
* @return Builder
*/
public Builder contentType(String contentType) {
this.contentType = contentType;
return this;
}
/**
* Setter for payPalRequestId.
* @param payPalRequestId String value for payPalRequestId.
* @return Builder
*/
public Builder payPalRequestId(String payPalRequestId) {
this.payPalRequestId = payPalRequestId;
return this;
}
/**
* Setter for prefer.
* @param prefer String value for prefer.
* @return Builder
*/
public Builder prefer(String prefer) {
this.prefer = prefer;
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 body.
* @param body RefundRequest value for body.
* @return Builder
*/
public Builder body(RefundRequest body) {
this.body = body;
return this;
}
/**
* Builds a new {@link CapturesRefundInput} object using the set fields.
* @return {@link CapturesRefundInput}
*/
public CapturesRefundInput build() {
return new CapturesRefundInput(captureId, contentType, payPalRequestId, prefer,
payPalAuthAssertion, body);
}
}
}