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

com.paypal.sdk.models.CaptureIncompleteReason 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.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.TreeMap;


/**
 * CaptureIncompleteReason to be used.
 */
public enum CaptureIncompleteReason {
    BUYER_COMPLAINT,

    CHARGEBACK,

    ECHECK,

    INTERNATIONAL_WITHDRAWAL,

    OTHER,

    PENDING_REVIEW,

    RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION,

    REFUNDED,

    TRANSACTION_APPROVED_AWAITING_FUNDING,

    UNILATERAL,

    VERIFICATION_REQUIRED,

    DECLINED_BY_RISK_FRAUD_FILTERS,

    /**
     * Unknown values will be mapped by this enum member
     */
    _UNKNOWN;


    private static TreeMap valueMap = new TreeMap<>();
    private String value;

    static {
        BUYER_COMPLAINT.value = "BUYER_COMPLAINT";
        CHARGEBACK.value = "CHARGEBACK";
        ECHECK.value = "ECHECK";
        INTERNATIONAL_WITHDRAWAL.value = "INTERNATIONAL_WITHDRAWAL";
        OTHER.value = "OTHER";
        PENDING_REVIEW.value = "PENDING_REVIEW";
        RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION.value = "RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION";
        REFUNDED.value = "REFUNDED";
        TRANSACTION_APPROVED_AWAITING_FUNDING.value = "TRANSACTION_APPROVED_AWAITING_FUNDING";
        UNILATERAL.value = "UNILATERAL";
        VERIFICATION_REQUIRED.value = "VERIFICATION_REQUIRED";
        DECLINED_BY_RISK_FRAUD_FILTERS.value = "DECLINED_BY_RISK_FRAUD_FILTERS";
        _UNKNOWN.value = null;

        valueMap.put("BUYER_COMPLAINT", BUYER_COMPLAINT);
        valueMap.put("CHARGEBACK", CHARGEBACK);
        valueMap.put("ECHECK", ECHECK);
        valueMap.put("INTERNATIONAL_WITHDRAWAL", INTERNATIONAL_WITHDRAWAL);
        valueMap.put("OTHER", OTHER);
        valueMap.put("PENDING_REVIEW", PENDING_REVIEW);
        valueMap.put("RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION", RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION);
        valueMap.put("REFUNDED", REFUNDED);
        valueMap.put("TRANSACTION_APPROVED_AWAITING_FUNDING", TRANSACTION_APPROVED_AWAITING_FUNDING);
        valueMap.put("UNILATERAL", UNILATERAL);
        valueMap.put("VERIFICATION_REQUIRED", VERIFICATION_REQUIRED);
        valueMap.put("DECLINED_BY_RISK_FRAUD_FILTERS", DECLINED_BY_RISK_FRAUD_FILTERS);
    }

    /**
     * Returns the enum member associated with the given string value.
     * @param toConvert String value to get enum member.
     * @return The enum member against the given string value.
     * @throws IOException when provided value is not mapped to any enum member.
     */
    @JsonCreator
    public static CaptureIncompleteReason constructFromString(String toConvert) throws IOException {
        CaptureIncompleteReason enumValue = fromString(toConvert);
        if (enumValue == null) {
            throw new IOException("Unable to create enum instance with value: " + toConvert);
        }
        return enumValue;
    }

    /**
     * Returns the enum member associated with the given string value.
     * @param toConvert String value to get enum member.
     * @return The enum member against the given string value.
     */
    public static CaptureIncompleteReason fromString(String toConvert) {
        if (!valueMap.containsKey(toConvert)) {
            return _UNKNOWN;
        }
        return valueMap.get(toConvert);
    }

    /**
     * Returns the string value associated with the enum member.
     * @return The string value against enum member.
     */
    @JsonValue
    public String value() {
        return value;
    }
        
    /**
     * Get string representation of this enum.
     */
    @Override
    public String toString() {
        if (value == null) {
            return null;
        }
        return value.toString();
    }

    /**
     * Convert list of CaptureIncompleteReason values to list of string values.
     * @param toConvert The list of CaptureIncompleteReason values to convert.
     * @return List of representative string values.
     */
    public static List toValue(List toConvert) {
        if (toConvert == null) {
            return null;
        }
        List convertedValues = new ArrayList<>();
        for (CaptureIncompleteReason enumValue : toConvert) {
            convertedValues.add(enumValue.value);
        }
        return convertedValues;
    }
} 




© 2015 - 2024 Weber Informatics LLC | Privacy Policy