<?php
/**
 * WARNING: Do not edit by hand, this file was generated by Crank:
 *
 * https://github.com/gocardless/crank
 */

namespace GoCardlessPro\Resources;

/**
 * A thin wrapper around a instalment_schedule, providing access to its
 * attributes
 *
 * @property-read mixed $created_at
 * @property-read mixed $currency
 * @property-read mixed $id
 * @property-read mixed $links
 * @property-read mixed $metadata
 * @property-read mixed $name
 * @property-read mixed $payment_errors
 * @property-read mixed $status
 * @property-read mixed $total_amount
 */
class InstalmentSchedule extends BaseResource
{
    protected $model_name = "InstalmentSchedule";

    /**
     * Fixed [timestamp](#api-usage-dates-and-times), recording when this
     * resource was created.
     */
    protected $created_at;

    /**
     * [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.
     */
    protected $currency;

    /**
     * Unique identifier, beginning with "IS".
     */
    protected $id;

    /**
     * Links to associated objects
     */
    protected $links;

    /**
     * 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.
     */
    protected $metadata;

    /**
     * Name of the instalment schedule, up to 100 chars. This name will also be
     * copied to the payments of the instalment schedule if you use
     * schedule-based creation.
     */
    protected $name;

    /**
     * If the status is `creation_failed`, this property will be populated with
     * validation
     * failures from the individual payments, arranged by the index of the
     * payment that
     * failed.
     */
    protected $payment_errors;

    /**
     * One of:
     * <ul>
     * <li>`pending`: we're waiting for GC to create the payments</li>
     * <li>`active`: the payments have been created, and the schedule is
     * active</li>
     * <li>`creation_failed`: payment creation failed</li>
     * <li>`completed`: we have passed the date of the final payment and all
     * payments have been collected</li>
     * <li>`cancelled`: the schedule has been cancelled</li>
     * <li>`errored`: one or more payments have failed</li>
     * </ul>
     */
    protected $status;

    /**
     * The total amount of the instalment schedule, defined as the sum of all
     * individual
     * payments, in the lowest denomination for the currency (e.g. pence in GBP,
     * cents in
     * EUR). If the requested payment amounts do not sum up correctly, a
     * validation error
     * will be returned.
     */
    protected $total_amount;

}
