Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HybridTransaction" /> class.
 /// </summary>
 /// <param name="id">id (required).</param>
 /// <param name="date">The transaction date in ISO format (e.g. 2016-12-01) (required).</param>
 /// <param name="amount">The transaction amount in milliunits format (required).</param>
 /// <param name="memo">memo.</param>
 /// <param name="cleared">The cleared status of the transaction (required).</param>
 /// <param name="approved">Whether or not the transaction is approved (required).</param>
 /// <param name="flagColor">The transaction flag.</param>
 /// <param name="accountId">accountId (required).</param>
 /// <param name="payeeId">payeeId.</param>
 /// <param name="categoryId">categoryId.</param>
 /// <param name="transferAccountId">If a transfer transaction, the account to which it transfers.</param>
 /// <param name="transferTransactionId">If a transfer transaction, the id of transaction on the other side of the transfer.</param>
 /// <param name="matchedTransactionId">If transaction is matched, the id of the matched transaction.</param>
 /// <param name="importId">If the Transaction was imported, this field is a unique (by account) import identifier.  If this transaction was imported through File Based Import or Direct Import and not through the API, the import_id will have the format: &#39;YNAB:[milliunit_amount]:[iso_date]:[occurrence]&#39;.  For example, a transaction dated 2015-12-30 in the amount of -$294.23 USD would have an import_id of &#39;YNAB:-294230:2015-12-30:1&#39;.  If a second transaction on the same account was imported and had the same date and same amount, its import_id would be &#39;YNAB:-294230:2015-12-30:2&#39;..</param>
 /// <param name="deleted">Whether or not the transaction has been deleted.  Deleted transactions will only be included in delta requests. (required).</param>
 /// <param name="type">Whether the hybrid transaction represents a regular transaction or a subtransaction (required).</param>
 /// <param name="parentTransactionId">For subtransaction types, this is the id of the parent transaction.  For transaction types, this id will be always be null..</param>
 /// <param name="accountName">accountName (required).</param>
 /// <param name="payeeName">payeeName.</param>
 /// <param name="categoryName">categoryName.</param>
 public HybridTransaction(string id = default(string), DateTime date = default(DateTime), long amount = default(long), string memo = default(string), ClearedEnum cleared = default(ClearedEnum), bool approved = default(bool), FlagColorEnum?flagColor = default(FlagColorEnum?), Guid accountId = default(Guid), Guid payeeId = default(Guid), Guid categoryId = default(Guid), Guid transferAccountId = default(Guid), string transferTransactionId = default(string), string matchedTransactionId = default(string), string importId = default(string), bool deleted = default(bool), TypeEnum type = default(TypeEnum), string parentTransactionId = default(string), string accountName = default(string), string payeeName = default(string), string categoryName = default(string))
 {
     // to ensure "id" is required (not null)
     this.Id        = id ?? throw new ArgumentNullException("id is a required property for HybridTransaction and cannot be null");
     this.Date      = date;
     this.Amount    = amount;
     this.Cleared   = cleared;
     this.Approved  = approved;
     this.AccountId = accountId;
     this.Deleted   = deleted;
     this.Type      = type;
     // to ensure "accountName" is required (not null)
     this.AccountName           = accountName ?? throw new ArgumentNullException("accountName is a required property for HybridTransaction and cannot be null");
     this.Memo                  = memo;
     this.FlagColor             = flagColor;
     this.PayeeId               = payeeId;
     this.CategoryId            = categoryId;
     this.TransferAccountId     = transferAccountId;
     this.TransferTransactionId = transferTransactionId;
     this.MatchedTransactionId  = matchedTransactionId;
     this.ImportId              = importId;
     this.ParentTransactionId   = parentTransactionId;
     this.PayeeName             = payeeName;
     this.CategoryName          = categoryName;
 }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TransactionDetail" /> class.
        /// </summary>
        /// <param name="id">id (required).</param>
        /// <param name="date">The transaction date in ISO format (e.g. 2016-12-01) (required).</param>
        /// <param name="amount">The transaction amount in milliunits format (required).</param>
        /// <param name="memo">memo.</param>
        /// <param name="cleared">The cleared status of the transaction (required).</param>
        /// <param name="approved">Whether or not the transaction is approved (required).</param>
        /// <param name="flagColor">The transaction flag.</param>
        /// <param name="accountId">accountId (required).</param>
        /// <param name="payeeId">payeeId.</param>
        /// <param name="categoryId">categoryId.</param>
        /// <param name="transferAccountId">If a transfer transaction, the account to which it transfers.</param>
        /// <param name="transferTransactionId">If a transfer transaction, the id of transaction on the other side of the transfer.</param>
        /// <param name="matchedTransactionId">If transaction is matched, the id of the matched transaction.</param>
        /// <param name="importId">If the Transaction was imported, this field is a unique (by account) import identifier.  If this transaction was imported through File Based Import or Direct Import and not through the API, the import_id will have the format: &#39;YNAB:[milliunit_amount]:[iso_date]:[occurrence]&#39;.  For example, a transaction dated 2015-12-30 in the amount of -$294.23 USD would have an import_id of &#39;YNAB:-294230:2015-12-30:1&#39;.  If a second transaction on the same account was imported and had the same date and same amount, its import_id would be &#39;YNAB:-294230:2015-12-30:2&#39;..</param>
        /// <param name="deleted">Whether or not the transaction has been deleted.  Deleted transactions will only be included in delta requests. (required).</param>
        /// <param name="accountName">accountName (required).</param>
        /// <param name="payeeName">payeeName.</param>
        /// <param name="categoryName">categoryName.</param>
        /// <param name="subtransactions">If a split transaction, the subtransactions. (required).</param>
        public TransactionDetail(string id = default(string), DateTime date = default(DateTime), long amount = default(long), string memo = default(string), ClearedEnum cleared = default(ClearedEnum), bool approved = default(bool), FlagColorEnum?flagColor = default(FlagColorEnum?), Guid accountId = default(Guid), Guid?payeeId = default(Guid?), Guid?categoryId = default(Guid?), Guid?transferAccountId = default(Guid?), string transferTransactionId = default(string), string matchedTransactionId = default(string), string importId = default(string), bool deleted = default(bool), string accountName = default(string), string payeeName = default(string), string categoryName = default(string), List <SubTransaction> subtransactions = default(List <SubTransaction>))
        {
            // to ensure "id" is required (not null)
            if (id == null)
            {
                throw new InvalidDataException("id is a required property for TransactionDetail and cannot be null");
            }
            else
            {
                this.Id = id;
            }

            // to ensure "date" is required (not null)
            if (date == null)
            {
                throw new InvalidDataException("date is a required property for TransactionDetail and cannot be null");
            }
            else
            {
                this.Date = date;
            }

            // to ensure "amount" is required (not null)
            if (amount == null)
            {
                throw new InvalidDataException("amount is a required property for TransactionDetail and cannot be null");
            }
            else
            {
                this.Amount = amount;
            }

            this.Cleared = cleared;
            // to ensure "approved" is required (not null)
            if (approved == null)
            {
                throw new InvalidDataException("approved is a required property for TransactionDetail and cannot be null");
            }
            else
            {
                this.Approved = approved;
            }

            // to ensure "accountId" is required (not null)
            if (accountId == null)
            {
                throw new InvalidDataException("accountId is a required property for TransactionDetail and cannot be null");
            }
            else
            {
                this.AccountId = accountId;
            }

            // to ensure "deleted" is required (not null)
            if (deleted == null)
            {
                throw new InvalidDataException("deleted is a required property for TransactionDetail and cannot be null");
            }
            else
            {
                this.Deleted = deleted;
            }

            // to ensure "accountName" is required (not null)
            if (accountName == null)
            {
                throw new InvalidDataException("accountName is a required property for TransactionDetail and cannot be null");
            }
            else
            {
                this.AccountName = accountName;
            }

            // to ensure "subtransactions" is required (not null)
            if (subtransactions == null)
            {
                throw new InvalidDataException("subtransactions is a required property for TransactionDetail and cannot be null");
            }
            else
            {
                this.Subtransactions = subtransactions;
            }

            this.Memo                  = memo;
            this.FlagColor             = flagColor;
            this.PayeeId               = payeeId;
            this.CategoryId            = categoryId;
            this.TransferAccountId     = transferAccountId;
            this.TransferTransactionId = transferTransactionId;
            this.MatchedTransactionId  = matchedTransactionId;
            this.ImportId              = importId;
            this.PayeeName             = payeeName;
            this.CategoryName          = categoryName;
        }