diff --git a/GoCardless/Resources/BillingRequest.cs b/GoCardless/Resources/BillingRequest.cs index 5c9ad7e..c466efc 100644 --- a/GoCardless/Resources/BillingRequest.cs +++ b/GoCardless/Resources/BillingRequest.cs @@ -114,12 +114,6 @@ public class BillingRequest /// [JsonProperty("status")] public string Status { get; set; } - - /// - /// Request for a subscription - /// - [JsonProperty("subscription_request")] - public BillingRequestSubscriptionRequest SubscriptionRequest { get; set; } } /// @@ -472,12 +466,6 @@ public class BillingRequestLinks /// [JsonProperty("payment_request_payment")] public string PaymentRequestPayment { get; set; } - - /// - /// (Optional) ID of the associated subscription request - /// - [JsonProperty("subscription_request")] - public string SubscriptionRequest { get; set; } } /// @@ -1361,183 +1349,4 @@ public enum BillingRequestStatus { Cancelled, } - /// - /// Represents a billing request subscription request resource. - /// - /// Request for a subscription - /// - public class BillingRequestSubscriptionRequest - { - /// - /// Amount in the lowest denomination for the currency (e.g. pence in - /// GBP, cents in EUR). - /// - [JsonProperty("amount")] - public int? Amount { get; set; } - - /// - /// The amount to be deducted from each payment as an app fee, to be - /// paid to the partner integration which created the subscription, in - /// the lowest denomination for the currency (e.g. pence in GBP, cents - /// in EUR). - /// - [JsonProperty("app_fee")] - public int? AppFee { get; set; } - - /// - /// The total number of payments that should be taken by this - /// subscription. - /// - [JsonProperty("count")] - public int? Count { get; set; } - - /// - /// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes) - /// currency code. Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", - /// "SEK" and "USD" are supported. - /// - [JsonProperty("currency")] - public string Currency { get; set; } - - /// - /// As per RFC 2445. The day of the month to charge customers on. - /// `1`-`28` or `-1` to indicate the last day of the month. - /// - [JsonProperty("day_of_month")] - public int? DayOfMonth { get; set; } - - /// - /// Number of `interval_units` between customer charge dates. Must be - /// greater than or equal to `1`. Must result in at least one charge - /// date per year. Defaults to `1`. - /// - [JsonProperty("interval")] - public int? Interval { get; set; } - - /// - /// The unit of time between customer charge dates. One of `weekly`, - /// `monthly` or `yearly`. - /// - [JsonProperty("interval_unit")] - public BillingRequestSubscriptionRequestIntervalUnit? IntervalUnit { get; set; } - - /// - /// Key-value store of custom data. Up to 3 keys are permitted, with key - /// names up to 50 characters and values up to 500 characters. - /// - [JsonProperty("metadata")] - public IDictionary Metadata { get; set; } - - /// - /// Name of the month on which to charge a customer. Must be lowercase. - /// Only applies - /// when the interval_unit is `yearly`. - /// - /// - [JsonProperty("month")] - public BillingRequestSubscriptionRequestMonth? Month { get; set; } - - /// - /// Optional name for the subscription. This will be set as the - /// description on each payment created. Must not exceed 255 characters. - /// - [JsonProperty("name")] - public string Name { get; set; } - - /// - /// An optional payment reference. This will be set as the reference on - /// each payment - /// created and will appear on your customer's bank statement. See the - /// documentation for - /// the [create payment endpoint](#payments-create-a-payment) for more - /// details. - ///
- ///

Restricted: You need - /// your own Service User Number to specify a payment reference for Bacs - /// payments.

- ///
- [JsonProperty("payment_reference")] - public string PaymentReference { get; set; } - - /// - /// The date on which the first payment should be charged. Must be on or - /// after the [mandate](#core-endpoints-mandates)'s - /// `next_possible_charge_date`. When left blank and `month` or - /// `day_of_month` are provided, this will be set to the date of the - /// first payment. If created without `month` or `day_of_month` this - /// will be set as the mandate's `next_possible_charge_date` - /// - [JsonProperty("start_date")] - public string StartDate { get; set; } - } - - /// - /// The unit of time between customer charge dates. One of `weekly`, `monthly` or `yearly`. - /// - [JsonConverter(typeof(GcStringEnumConverter), (int)Unknown)] - public enum BillingRequestSubscriptionRequestIntervalUnit { - /// Unknown status - [EnumMember(Value = "unknown")] - Unknown = 0, - - /// `interval_unit` with a value of "weekly" - [EnumMember(Value = "weekly")] - Weekly, - /// `interval_unit` with a value of "monthly" - [EnumMember(Value = "monthly")] - Monthly, - /// `interval_unit` with a value of "yearly" - [EnumMember(Value = "yearly")] - Yearly, - } - - /// - /// Name of the month on which to charge a customer. Must be lowercase. Only applies - /// when the interval_unit is `yearly`. - /// - /// - [JsonConverter(typeof(GcStringEnumConverter), (int)Unknown)] - public enum BillingRequestSubscriptionRequestMonth { - /// Unknown status - [EnumMember(Value = "unknown")] - Unknown = 0, - - /// `month` with a value of "january" - [EnumMember(Value = "january")] - January, - /// `month` with a value of "february" - [EnumMember(Value = "february")] - February, - /// `month` with a value of "march" - [EnumMember(Value = "march")] - March, - /// `month` with a value of "april" - [EnumMember(Value = "april")] - April, - /// `month` with a value of "may" - [EnumMember(Value = "may")] - May, - /// `month` with a value of "june" - [EnumMember(Value = "june")] - June, - /// `month` with a value of "july" - [EnumMember(Value = "july")] - July, - /// `month` with a value of "august" - [EnumMember(Value = "august")] - August, - /// `month` with a value of "september" - [EnumMember(Value = "september")] - September, - /// `month` with a value of "october" - [EnumMember(Value = "october")] - October, - /// `month` with a value of "november" - [EnumMember(Value = "november")] - November, - /// `month` with a value of "december" - [EnumMember(Value = "december")] - December, - } - } diff --git a/GoCardless/Services/BillingRequestService.cs b/GoCardless/Services/BillingRequestService.cs index 43b4b5c..fec7025 100644 --- a/GoCardless/Services/BillingRequestService.cs +++ b/GoCardless/Services/BillingRequestService.cs @@ -916,183 +916,6 @@ public enum BillingRequestPurposeCode Other, } - [JsonProperty("subscription_request")] - public BillingRequestSubscriptionRequest SubscriptionRequest { get; set; } - /// - /// - /// - public class BillingRequestSubscriptionRequest - { - - /// - /// Amount in the lowest denomination for the currency (e.g. pence - /// in GBP, cents in EUR). - /// - [JsonProperty("amount")] - public int? Amount { get; set; } - - /// - /// The amount to be deducted from each payment as an app fee, to be - /// paid to the partner integration which created the subscription, - /// in the lowest denomination for the currency (e.g. pence in GBP, - /// cents in EUR). - /// - [JsonProperty("app_fee")] - public int? AppFee { get; set; } - - /// - /// The total number of payments that should be taken by this - /// subscription. - /// - [JsonProperty("count")] - public int? Count { get; set; } - - /// - /// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes) - /// currency code. Currently "AUD", "CAD", "DKK", "EUR", "GBP", - /// "NZD", "SEK" and "USD" are supported. - /// - [JsonProperty("currency")] - public string Currency { get; set; } - - /// - /// As per RFC 2445. The day of the month to charge customers on. - /// `1`-`28` or `-1` to indicate the last day of the month. - /// - [JsonProperty("day_of_month")] - public int? DayOfMonth { get; set; } - - /// - /// Number of `interval_units` between customer charge dates. Must - /// be greater than or equal to `1`. Must result in at least one - /// charge date per year. Defaults to `1`. - /// - [JsonProperty("interval")] - public int? Interval { get; set; } - - /// - /// The unit of time between customer charge dates. One of `weekly`, - /// `monthly` or `yearly`. - /// - [JsonProperty("interval_unit")] - public BillingRequestIntervalUnit? IntervalUnit { get; set; } - /// - /// The unit of time between customer charge dates. One of `weekly`, - /// `monthly` or `yearly`. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum BillingRequestIntervalUnit - { - - /// `interval_unit` with a value of "weekly" - [EnumMember(Value = "weekly")] - Weekly, - /// `interval_unit` with a value of "monthly" - [EnumMember(Value = "monthly")] - Monthly, - /// `interval_unit` with a value of "yearly" - [EnumMember(Value = "yearly")] - Yearly, - } - - /// - /// Key-value store of custom data. Up to 3 keys are permitted, with - /// key names up to 50 characters and values up to 500 characters. - /// - [JsonProperty("metadata")] - public IDictionary Metadata { get; set; } - - /// - /// Name of the month on which to charge a customer. Must be - /// lowercase. Only applies - /// when the interval_unit is `yearly`. - /// - /// - [JsonProperty("month")] - public BillingRequestMonth? Month { get; set; } - /// - /// Name of the month on which to charge a customer. Must be lowercase. - /// Only applies - /// when the interval_unit is `yearly`. - /// - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum BillingRequestMonth - { - - /// `month` with a value of "january" - [EnumMember(Value = "january")] - January, - /// `month` with a value of "february" - [EnumMember(Value = "february")] - February, - /// `month` with a value of "march" - [EnumMember(Value = "march")] - March, - /// `month` with a value of "april" - [EnumMember(Value = "april")] - April, - /// `month` with a value of "may" - [EnumMember(Value = "may")] - May, - /// `month` with a value of "june" - [EnumMember(Value = "june")] - June, - /// `month` with a value of "july" - [EnumMember(Value = "july")] - July, - /// `month` with a value of "august" - [EnumMember(Value = "august")] - August, - /// `month` with a value of "september" - [EnumMember(Value = "september")] - September, - /// `month` with a value of "october" - [EnumMember(Value = "october")] - October, - /// `month` with a value of "november" - [EnumMember(Value = "november")] - November, - /// `month` with a value of "december" - [EnumMember(Value = "december")] - December, - } - - /// - /// Optional name for the subscription. This will be set as the - /// description on each payment created. Must not exceed 255 - /// characters. - /// - [JsonProperty("name")] - public string Name { get; set; } - - /// - /// An optional payment reference. This will be set as the reference - /// on each payment - /// created and will appear on your customer's bank statement. See - /// the documentation for - /// the [create payment endpoint](#payments-create-a-payment) for - /// more details. - ///
- ///

Restricted: You - /// need your own Service User Number to specify a payment reference - /// for Bacs payments.

- ///
- [JsonProperty("payment_reference")] - public string PaymentReference { get; set; } - - /// - /// The date on which the first payment should be charged. Must be - /// on or after the [mandate](#core-endpoints-mandates)'s - /// `next_possible_charge_date`. When left blank and `month` or - /// `day_of_month` are provided, this will be set to the date of the - /// first payment. If created without `month` or `day_of_month` this - /// will be set as the mandate's `next_possible_charge_date` - /// - [JsonProperty("start_date")] - public string StartDate { get; set; } - } - /// /// A unique key to ensure that this request only succeeds once, allowing you to safely retry request errors such as network failures. /// Any requests, where supported, to create a resource with a key that has previously been used will not succeed.