Tabnine Logo
QueryParams
Code IndexAdd Tabnine to your IDE (free)

How to use
QueryParams
in
com.ning.billing.recurly

Best Java code snippets using com.ning.billing.recurly.QueryParams (Showing top 20 results out of 315)

origin: killbilling/recurly-java-library

/**
 * Lookup all coupon redemptions on an account.
 *
 * @param accountCode recurly account id
 * @return the coupon redemptions for this account on success, null otherwise
 */
public Redemptions getCouponRedemptionsByAccount(final String accountCode) {
  return doGET(Accounts.ACCOUNTS_RESOURCE + "/" + accountCode + Redemption.REDEMPTIONS_RESOURCE,
      Redemptions.class, new QueryParams());
}
origin: killbilling/recurly-java-library

public QueryParams() {
  params = new HashMap<String, String>();
  Integer pageSize;
  try {
    pageSize = new Integer(System.getProperty(RECURLY_PAGE_SIZE_KEY));
  } catch (NumberFormatException nfex) {
    pageSize = DEFAULT_PAGE_SIZE;
  }
  setPerPage(pageSize);
}
origin: killbilling/recurly-java-library

public void setEndTime(final DateTime endTime) {
  params.put("end_time", formatDate(endTime));
}
origin: killbilling/recurly-java-library

/**
 * Get the subscriptions for an account.
 * This is deprecated. Please use getAccountSubscriptions(String, Subscriptions.State, QueryParams)
 * <p>
 * Returns information about a single account.
 *
 * @param accountCode recurly account id
 * @param status      Only accounts in this status will be returned
 * @return Subscriptions on the account
 */
@Deprecated
public Subscriptions getAccountSubscriptions(final String accountCode, final String status) {
  final QueryParams params = new QueryParams();
  if (status != null) params.put("state", status);
  return doGET(Account.ACCOUNT_RESOURCE
          + "/" + accountCode
          + Subscriptions.SUBSCRIPTIONS_RESOURCE,
      Subscriptions.class, params);
}
origin: com.ning.billing/recurly-java-library

@Test(groups = "integration")
public void testBulkCoupons() throws Exception {
  final Coupon couponData = TestUtils.createRandomCoupon();
  couponData.setType(Coupon.Type.bulk);
  couponData.setUniqueCodeTemplate(String.format("'%s'99999", couponData.getCouponCode()));
  Coupon coupon = recurlyClient.createCoupon(couponData);
  Coupon genCouponData = new Coupon();
  genCouponData.setNumberOfUniqueCodes(50);
  recurlyClient.generateUniqueCodes(coupon.getCouponCode(), genCouponData);
  QueryParams qp = new QueryParams();
  qp.setPerPage(50);
  Coupons coupons = recurlyClient.getUniqueCouponCodes(couponData.getCouponCode(), qp);
  Assert.assertEquals(coupons.size(), 50);
}
origin: com.ning.billing/recurly-java-library

@Test(groups = "integration")
public void testCounts() throws Exception {
  final QueryParams qp = new QueryParams();
  qp.setBeginTime(new DateTime("2017-01-01T00:00:00Z"));
  Integer accountCount = recurlyClient.getAccountsCount(qp);
  Assert.assertNotNull(accountCount);
  Integer couponsCount = recurlyClient.getCouponsCount(qp);
  Assert.assertNotNull(couponsCount);
  Integer transactionsCount = recurlyClient.getTransactionsCount(qp);
  Assert.assertNotNull(transactionsCount);
  Integer plansCount = recurlyClient.getPlansCount(qp);
  Assert.assertNotNull(plansCount);
  Integer giftCardsCount = recurlyClient.getGiftCardsCount(qp);
  Assert.assertNotNull(giftCardsCount);
}
origin: killbilling/recurly-java-library

/**
 * Get Account Adjustments
 * <p>
 *
 * @param accountCode recurly account id
 * @param type {@link com.ning.billing.recurly.model.Adjustments.AdjustmentType}
 * @param state {@link com.ning.billing.recurly.model.Adjustments.AdjustmentState}
 * @param params {@link QueryParams}
 * @return the adjustments on the account
 */
public Adjustments getAccountAdjustments(final String accountCode, final Adjustments.AdjustmentType type, final Adjustments.AdjustmentState state, final QueryParams params) {
  final String url = Account.ACCOUNT_RESOURCE + "/" + accountCode + Adjustments.ADJUSTMENTS_RESOURCE;
  if (type != null) params.put("type", type.getType());
  if (state != null) params.put("state", state.getState());
  return doGET(url, Adjustments.class, params);
}
origin: killbilling/recurly-java-library

private String constructGetUrl(final String resource, QueryParams params) {
  return baseUrl + resource + params.toString();
}
origin: killbilling/recurly-java-library

@Test(groups = "integration")
public void testBulkCoupons() throws Exception {
  final Coupon couponData = TestUtils.createRandomCoupon();
  couponData.setType(Coupon.Type.bulk);
  couponData.setUniqueCodeTemplate(String.format("'%s'99999", couponData.getCouponCode()));
  Coupon coupon = recurlyClient.createCoupon(couponData);
  Coupon genCouponData = new Coupon();
  genCouponData.setNumberOfUniqueCodes(50);
  recurlyClient.generateUniqueCodes(coupon.getCouponCode(), genCouponData);
  QueryParams qp = new QueryParams();
  qp.setPerPage(50);
  Coupons coupons = recurlyClient.getUniqueCouponCodes(couponData.getCouponCode(), qp);
  Assert.assertEquals(coupons.size(), 50);
}
origin: killbilling/recurly-java-library

@Test(groups = "integration")
public void testCounts() throws Exception {
  final QueryParams qp = new QueryParams();
  qp.setBeginTime(new DateTime("2017-01-01T00:00:00Z"));
  Integer accountCount = recurlyClient.getAccountsCount(qp);
  Assert.assertNotNull(accountCount);
  Integer couponsCount = recurlyClient.getCouponsCount(qp);
  Assert.assertNotNull(couponsCount);
  Integer transactionsCount = recurlyClient.getTransactionsCount(qp);
  Assert.assertNotNull(transactionsCount);
  Integer plansCount = recurlyClient.getPlansCount(qp);
  Assert.assertNotNull(plansCount);
  Integer giftCardsCount = recurlyClient.getGiftCardsCount(qp);
  Assert.assertNotNull(giftCardsCount);
}
origin: killbilling/recurly-java-library

/**
 * Get site's transaction history
 * <p>
 * All transactions on the site
 *
 * @param state {@link TransactionState}
 * @param type {@link TransactionType}
 * @param params {@link QueryParams}
 * @return the transaction history of the site on success, null otherwise
 */
public Transactions getTransactions(final TransactionState state, final TransactionType type, final QueryParams params) {
  if (state != null) params.put("state", state.getType());
  if (type != null) params.put("type", type.getType());
  return doGET(Transactions.TRANSACTIONS_RESOURCE, Transactions.class, params);
}
origin: killbilling/recurly-java-library

/**
 * Lookup all coupon redemptions on an invoice.
 *
 * @param invoiceId String invoice id
 * @return the coupon redemptions for this invoice on success, null otherwise
 */
public Redemptions getCouponRedemptionsByInvoice(final String invoiceId) {
  return getCouponRedemptionsByInvoice(invoiceId, new QueryParams());
}
origin: killbilling/recurly-java-library

/**
 * Lookup an account's transactions history given query params
 * <p>
 * Returns the account's transaction history
 *
 * @param accountCode recurly account id
 * @param state {@link TransactionState}
 * @param type {@link TransactionType}
 * @param params {@link QueryParams}
 * @return the transaction history associated with this account on success, null otherwise
 */
public Transactions getAccountTransactions(final String accountCode, final TransactionState state, final TransactionType type, final QueryParams params) {
  if (state != null) params.put("state", state.getType());
  if (type != null) params.put("type", type.getType());
  return doGET(Accounts.ACCOUNTS_RESOURCE + "/" + accountCode + Transactions.TRANSACTIONS_RESOURCE,
      Transactions.class, params);
}
origin: killbilling/recurly-java-library

public void setBeginTime(final DateTime beginTime) {
  params.put("begin_time", formatDate(beginTime));
}
origin: killbilling/recurly-java-library

/**
 * Get Gift Cards
 * <p>
 * Returns information about all gift cards.
 *
 * @return gitfcards object on success, null otherwise
 */
public GiftCards getGiftCards() {
  return doGET(GiftCards.GIFT_CARDS_RESOURCE, GiftCards.class, new QueryParams());
}
origin: killbilling/recurly-java-library

/**
 * Get all the subscriptions on the site given some sort and filter params.
 * <p>
 * Returns all the subscriptions on the site
 *
 * @param state {@link SubscriptionState}
 * @param params {@link QueryParams}
 * @return Subscriptions on the site
 */
public Subscriptions getSubscriptions(final SubscriptionState state, final QueryParams params) {
  if (state != null) { params.put("state", state.getType()); }
  return doGET(Subscriptions.SUBSCRIPTIONS_RESOURCE,
      Subscriptions.class, params);
}
origin: killbilling/recurly-java-library

public void setStartDateTime(final DateTime startDateTime) {
  params.put("start_datetime", formatDate(startDateTime));
}
origin: killbilling/recurly-java-library

/**
 * Lookup all invoices
 * <p>
 * Returns all invoices on the site
 *
 * @return the invoices associated with this site on success, null otherwise
 */
public Invoices getInvoices() {
  return doGET(Invoices.INVOICES_RESOURCE, Invoices.class, new QueryParams());
}
origin: killbilling/recurly-java-library

/**
 * Lookup an account's invoices given query params
 * <p>
 * Returns the account's invoices
 *
 * @param accountCode recurly account id
 * @param state {@link InvoiceState} state of the invoices
 * @param params {@link QueryParams}
 * @return the invoices associated with this account on success, null otherwise
 */
public Invoices getAccountInvoices(final String accountCode, final InvoiceState state, final QueryParams params) {
  if (state != null) params.put("state", state.getType());
  return doGET(Accounts.ACCOUNTS_RESOURCE + "/" + accountCode + Invoices.INVOICES_RESOURCE,
      Invoices.class, params);
}
origin: killbilling/recurly-java-library

public void setEndDateTime(final DateTime endDateTime) {
  params.put("end_datetime", formatDate(endDateTime));
}
com.ning.billing.recurlyQueryParams

Javadoc

This class is responsible for handling query parameters to pageable resources in the Recurly API. See the pagination docs (https://dev.recurly.com/docs/pagination) for the parameters available on every endpoint.

Most used methods

  • <init>
  • setPerPage
  • formatDate
  • put
  • setBeginTime
  • toString

Popular in Java

  • Making http requests using okhttp
  • getExternalFilesDir (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • ImageIO (javax.imageio)
  • Notification (javax.management)
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now