Sync SDK DTOs with Unit API docs (automated)#71
Closed
cursor[bot] wants to merge 5 commits into
Closed
Conversation
Per https://docs.unit.co/resources: AchPayment: add expectedCompletionDate, counterpartyVerificationMethod, sameDay, secCode. AchReceivedPayment: add isAdvanceable, direction, originatorEntityId, receivingEntityName. Also assign self.id which was previously missing. Co-authored-by: Avery Kushner <avesk@users.noreply.github.com>
Per https://docs.unit.co/resources: DepositAccount: add updatedAt, freezeReason, fraudReason, dacaStatus, interestTerms. AccountEndOfDay: add overdraftLimit. Co-authored-by: Avery Kushner <avesk@users.noreply.github.com>
Per https://docs.unit.co/resources: IndividualCustomer: add eligibleProducts (Array of Product) and ein (Optional, sole-prop with EIN). BusinessCustomer: add eligibleProducts. Co-authored-by: Avery Kushner <avesk@users.noreply.github.com>
Per https://docs.unit.co/resources, ACH counterparties expose a tags attribute that the DTO was not deserializing. Co-authored-by: Avery Kushner <avesk@users.noreply.github.com>
Per https://docs.unit.co/resources, Dispute exposes an optional updatedAt attribute. Also switch from_json_api to use keyword arguments — the previous positional call assigned attributes to the wrong constructor parameters (createdAt was being passed as 'source', etc.) but happened to work since values were stored in self.attributes by name in __init__. Co-authored-by: Avery Kushner <avesk@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated drift sync against docs.unit.co/resources. Adds optional fields that exist on Unit's live API resources but were missing from the SDK DTOs. All new fields default to
Noneand are passed via keyword arguments so existing call sites continue to work.Drift found and fixed
AchPaymentDTOexpectedCompletionDate,counterpartyVerificationMethod,sameDay,secCodeAchReceivedPaymentDTOisAdvanceable,direction,originatorEntityId,receivingEntityName(also now assignsself.id, which was previously dropped)AccountEndOfDayDTOoverdraftLimitDepositAccountDTOupdatedAt,freezeReason,fraudReason,dacaStatus,interestTermsIndividualCustomerDTOeligibleProducts,einBusinessCustomerDTOeligibleProductsCounterpartyDTOtagsDisputeDTOupdatedAtOther fixes
DisputeDTO.from_json_apiwas passing positional arguments in the wrong order, soself.attributes["source"]was actually getting thecreatedAtvalue, etc. Switched to keyword arguments per the SDK convention to fix it.AchReceivedPaymentDTO.__init__did not assignself.id; now does.Verification
from_json_apiand asserts the new fields land inself.attributes.Out of scope
The Unit docs page lists ~100 resource types. This pass focused on existing DTO drift; entirely missing resources (e.g.
accountHold,wireReceivedPayment,declinedIncomingPayment, account limit overrides, positive-pay resources, credit application resources) were not added. A follow-up can introduce them with codec mappings if/when the API repo needs them.