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

com.braintreegateway.ExchangeRateQuoteRequest Maven / Gradle / Ivy

package com.braintreegateway;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ExchangeRateQuoteRequest extends Request {

    private List quotes = new ArrayList<>();

    public ExchangeRateQuoteInput addExchangeRateQuoteInput() {
        ExchangeRateQuoteInput newInput = new ExchangeRateQuoteInput(this);
        quotes.add(newInput);
        return newInput;
    }

    @Override
    public Map toGraphQLVariables() {

        Map variables = new HashMap<>();
        Map input = new HashMap<>();

        List> quotesList = new ArrayList<>();

        for (ExchangeRateQuoteInput quote : this.quotes) {
            quotesList.add(quote.toGraphQLVariables());
        }

        input.put("quotes", quotesList.toArray());
        variables.put("exchangeRateQuoteRequest", input);

        return variables;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy