コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="InvoicePreview" /> class.
        /// </summary>
        /// <param name="collectionMethod">collectionMethod (required).</param>
        /// <param name="currency">currency (required).</param>
        /// <param name="customer">customer (required).</param>
        /// <param name="lines">lines (required).</param>
        /// <param name="periodStart">periodStart (required).</param>
        /// <param name="periodEnd">periodEnd (required).</param>
        /// <param name="status">status (required).</param>
        /// <param name="statusTransitions">statusTransitions (required).</param>
        /// <param name="subtotal">subtotal (required).</param>
        /// <param name="total">total (required).</param>
        /// <param name="autoAdvance">autoAdvance.</param>
        /// <param name="description">description.</param>
        /// <param name="hostedInvoiceUrl">hostedInvoiceUrl.</param>
        /// <param name="subscription">subscription.</param>
        /// <param name="discount">discount.</param>
        /// <param name="totalDiscountAmounts">totalDiscountAmounts.</param>
        /// <param name="paymentMethod">The payment method that will be billed when this invoice is due..</param>
        public InvoicePreview
        (
            string collectionMethod, string currency, string customer, LineItemList lines, DateTime periodStart, DateTime periodEnd, InvoiceStatus status, InvoiceStatusTransitions statusTransitions, int subtotal, int total,                               // Required parameters
            bool autoAdvance = default, string description = default, string hostedInvoiceUrl = default, string subscription = default, Discount discount = default, List <DiscountAmount> totalDiscountAmounts = default, CardPublic paymentMethod = default // Optional parameters
        ) : base()                                                                                                                                                                                                                                            // BaseClass
        {
            // to ensure "collectionMethod" is required (not null)
            this.CollectionMethod = collectionMethod ?? throw new ArgumentNullException("collectionMethod is a required property for InvoicePreview and cannot be null");
            // to ensure "currency" is required (not null)
            this.Currency = currency ?? throw new ArgumentNullException("currency is a required property for InvoicePreview and cannot be null");
            // to ensure "customer" is required (not null)
            this.Customer = customer ?? throw new ArgumentNullException("customer is a required property for InvoicePreview and cannot be null");
            // to ensure "lines" is required (not null)
            this.Lines       = lines ?? throw new ArgumentNullException("lines is a required property for InvoicePreview and cannot be null");
            this.PeriodStart = periodStart;
            this.PeriodEnd   = periodEnd;
            this.Status      = status;
            // to ensure "statusTransitions" is required (not null)
            this.StatusTransitions    = statusTransitions ?? throw new ArgumentNullException("statusTransitions is a required property for InvoicePreview and cannot be null");
            this.Subtotal             = subtotal;
            this.Total                = total;
            this.AutoAdvance          = autoAdvance;
            this.Description          = description;
            this.HostedInvoiceUrl     = hostedInvoiceUrl;
            this.Subscription         = subscription;
            this.Discount             = discount;
            this.TotalDiscountAmounts = totalDiscountAmounts;
            this.PaymentMethod        = paymentMethod;

            // Set non-required readonly properties with defaultValue
            this.Type = "InvoicePreview";
        }
コード例 #2
0
        /// <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";
        }