/// <summary> /// Initializes a new instance of the <see cref="Subscription" /> class. /// </summary> /// <param name="cancelAtPeriodEnd">cancelAtPeriodEnd (required).</param> /// <param name="currentPeriodStart">currentPeriodStart (required).</param> /// <param name="currentPeriodEnd">currentPeriodEnd (required).</param> /// <param name="customer">customer (required).</param> /// <param name="items">items (required).</param> /// <param name="latestInvoice">latestInvoice (required).</param> /// <param name="defaultPaymentMethod">defaultPaymentMethod.</param> /// <param name="schedule">schedule.</param> /// <param name="discount">discount.</param> /// <param name="id">id (required).</param> /// <param name="metadata">metadata.</param> public Subscription ( string id, bool cancelAtPeriodEnd, DateTime currentPeriodStart, DateTime currentPeriodEnd, string customer, SubscriptionItemList items, string latestInvoice, // Required parameters Object metadata = default, string defaultPaymentMethod = default, string schedule = default, Discount discount = default // Optional parameters ) : base(id: id, metadata: metadata) // BaseClass { this.CancelAtPeriodEnd = cancelAtPeriodEnd; this.CurrentPeriodStart = currentPeriodStart; this.CurrentPeriodEnd = currentPeriodEnd; // to ensure "customer" is required (not null) this.Customer = customer ?? throw new ArgumentNullException("customer is a required property for Subscription and cannot be null"); // to ensure "items" is required (not null) this.Items = items ?? throw new ArgumentNullException("items is a required property for Subscription and cannot be null"); // to ensure "latestInvoice" is required (not null) this.LatestInvoice = latestInvoice ?? throw new ArgumentNullException("latestInvoice is a required property for Subscription and cannot be null"); this.DefaultPaymentMethod = defaultPaymentMethod; this.Schedule = schedule; this.Discount = discount; // Set non-required readonly properties with defaultValue this.Type = "Subscription"; }
/// <summary> /// Initializes a new instance of the <see cref="PollinationSubscription" /> class. /// </summary> /// <param name="accountId">The ID of the account this subscription applies to (required).</param> /// <param name="subscriptionPlan">A subscription plan (required).</param> /// <param name="externalId">The ID of this subscription.</param> /// <param name="quotaExtensions">A list of quota extension plans for a given subscription.</param> /// <param name="id">id (required).</param> /// <param name="metadata">metadata.</param> /// <param name="cancelAtPeriodEnd">cancelAtPeriodEnd (required).</param> /// <param name="currentPeriodStart">currentPeriodStart (required).</param> /// <param name="currentPeriodEnd">currentPeriodEnd (required).</param> /// <param name="customer">customer (required).</param> /// <param name="items">items (required).</param> /// <param name="latestInvoice">latestInvoice (required).</param> /// <param name="defaultPaymentMethod">defaultPaymentMethod.</param> /// <param name="schedule">schedule.</param> /// <param name="discount">discount.</param> public PollinationSubscription ( string id, bool cancelAtPeriodEnd, DateTime currentPeriodStart, DateTime currentPeriodEnd, string customer, SubscriptionItemList items, string latestInvoice, Guid accountId, SubscriptionPlan subscriptionPlan, // Required parameters Object metadata = default, string defaultPaymentMethod = default, string schedule = default, Discount discount = default, string externalId = default, List <QuotaExtension> quotaExtensions = default // Optional parameters ) : base(id: id, metadata: metadata, cancelAtPeriodEnd: cancelAtPeriodEnd, currentPeriodStart: currentPeriodStart, currentPeriodEnd: currentPeriodEnd, customer: customer, items: items, latestInvoice: latestInvoice, defaultPaymentMethod: defaultPaymentMethod, schedule: schedule, discount: discount) // BaseClass { this.AccountId = accountId; // to ensure "subscriptionPlan" is required (not null) this.SubscriptionPlan = subscriptionPlan ?? throw new ArgumentNullException("subscriptionPlan is a required property for PollinationSubscription and cannot be null"); this.ExternalId = externalId; this.QuotaExtensions = quotaExtensions; // Set non-required readonly properties with defaultValue this.Type = "PollinationSubscription"; }