Example #1
0
 /// <summary>
 /// Lists transactions by state and type. Defaults to all.
 /// </summary>
 /// <param name="state"></param>
 /// <param name="type"></param>
 /// <returns></returns>
 public static RecurlyList <Transaction> List(TransactionList.TransactionState state = TransactionList.TransactionState.All,
                                              TransactionList.TransactionType type   = TransactionList.TransactionType.All)
 {
     return(new TransactionList("/transactions/" +
                                Build.QueryStringWith(state != TransactionList.TransactionState.All ? "state=" + state.ToString().EnumNameToTransportCase() : "")
                                .AndWith(type != TransactionList.TransactionType.All ? "type=" + type.ToString().EnumNameToTransportCase() : "")
                                ));
 }
Example #2
0
 /// <summary>
 /// Lists usages by status and/or time. Defaults to all.
 /// </summary>
 /// <param name="billingState"></param>
 /// <param name="dateTimeType"></param>
 /// <param name="startDateTime"></param>
 /// <param name="endDateTime"></param>
 /// <returns></returns>
 public static RecurlyList <Usage> List(string subscriptionUuid,
                                        string subscriptionAddOnCode,
                                        UsageList.UsageBillingState billingState = UsageList.UsageBillingState.All,
                                        UsageList.UsageDateTimeType dateTimeType = UsageList.UsageDateTimeType.All,
                                        DateTime?startDateTime = null,
                                        DateTime?endDateTime   = null)
 {
     return(new UsageList("/subscriptions/" + Uri.EscapeUriString(subscriptionUuid) +
                          "/add_ons/" + Uri.EscapeUriString(subscriptionAddOnCode) +
                          "/usage" +
                          Build.QueryStringWith("billing_status=" + billingState.ToString().EnumNameToTransportCase())
                          .AndWith(dateTimeType != UsageList.UsageDateTimeType.All ? "datetime_type=" + dateTimeType.ToString().EnumNameToTransportCase() : "")
                          .AndWith(startDateTime != null ? "start_datetime=" + Uri.EscapeUriString(startDateTime.Value.ToString("s")) : "")
                          .AndWith(endDateTime != null ? "end_datetime=" + Uri.EscapeUriString(endDateTime.Value.ToString("s")) : "")
                          ));
 }