From 5515fc97bb6c0488589e176370490c24b08da59a Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Wed, 15 Jun 2022 09:49:14 -0700 Subject: [PATCH] Codegen for openapi v154 --- testhelperstreasury_receivedcredit.go | 16 +++++++++++ testhelperstreasury_receiveddebit.go | 16 +++++++++++ treasury_outboundtransfer.go | 40 +++++++++++++++++++++++++++ treasury_receivedcredit.go | 24 ++++++++++++++++ treasury_receiveddebit.go | 26 +++++++++++++++++ 5 files changed, 122 insertions(+) diff --git a/testhelperstreasury_receivedcredit.go b/testhelperstreasury_receivedcredit.go index 876e52d7de..8c23743fc2 100644 --- a/testhelperstreasury_receivedcredit.go +++ b/testhelperstreasury_receivedcredit.go @@ -24,6 +24,20 @@ type TestHelpersTreasuryReceivedCreditInitiatingPaymentMethodDetailsParams struc USBankAccount *TestHelpersTreasuryReceivedCreditInitiatingPaymentMethodDetailsUSBankAccountParams `form:"us_bank_account"` } +// Optional fields for `ach`. +type TestHelpersTreasuryReceivedCreditNetworkDetailsAchParams struct { + // ACH Addenda record + Addenda *string `form:"addenda"` +} + +// Details about the network used for the ReceivedCredit. +type TestHelpersTreasuryReceivedCreditNetworkDetailsParams struct { + // Optional fields for `ach`. + Ach *TestHelpersTreasuryReceivedCreditNetworkDetailsAchParams `form:"ach"` + // The type of flow that originated the ReceivedCredit. + Type *string `form:"type"` +} + // Use this endpoint to simulate a test mode ReceivedCredit initiated by a third party. In live mode, you can't directly create ReceivedCredits initiated by third parties. type TestHelpersTreasuryReceivedCreditParams struct { Params `form:"*"` @@ -39,4 +53,6 @@ type TestHelpersTreasuryReceivedCreditParams struct { InitiatingPaymentMethodDetails *TestHelpersTreasuryReceivedCreditInitiatingPaymentMethodDetailsParams `form:"initiating_payment_method_details"` // The rails used for the object. Network *string `form:"network"` + // Details about the network used for the ReceivedCredit. + NetworkDetails *TestHelpersTreasuryReceivedCreditNetworkDetailsParams `form:"network_details"` } diff --git a/testhelperstreasury_receiveddebit.go b/testhelperstreasury_receiveddebit.go index 2786b8ae12..a3f9285438 100644 --- a/testhelperstreasury_receiveddebit.go +++ b/testhelperstreasury_receiveddebit.go @@ -24,6 +24,20 @@ type TestHelpersTreasuryReceivedDebitInitiatingPaymentMethodDetailsParams struct USBankAccount *TestHelpersTreasuryReceivedDebitInitiatingPaymentMethodDetailsUSBankAccountParams `form:"us_bank_account"` } +// Optional fields for `ach`. +type TestHelpersTreasuryReceivedDebitNetworkDetailsAchParams struct { + // Addenda record data associated with this ReceivedDebit. + Addenda *string `form:"addenda"` +} + +// Details about the network used for the ReceivedDebit. +type TestHelpersTreasuryReceivedDebitNetworkDetailsParams struct { + // Optional fields for `ach`. + Ach *TestHelpersTreasuryReceivedDebitNetworkDetailsAchParams `form:"ach"` + // The type of flow that originated the ReceivedDebit. + Type *string `form:"type"` +} + // Use this endpoint to simulate a test mode ReceivedDebit initiated by a third party. In live mode, you can't directly create ReceivedDebits initiated by third parties. type TestHelpersTreasuryReceivedDebitParams struct { Params `form:"*"` @@ -39,4 +53,6 @@ type TestHelpersTreasuryReceivedDebitParams struct { InitiatingPaymentMethodDetails *TestHelpersTreasuryReceivedDebitInitiatingPaymentMethodDetailsParams `form:"initiating_payment_method_details"` // The rails used for the object. Network *string `form:"network"` + // Details about the network used for the ReceivedDebit. + NetworkDetails *TestHelpersTreasuryReceivedDebitNetworkDetailsParams `form:"network_details"` } diff --git a/treasury_outboundtransfer.go b/treasury_outboundtransfer.go index 44a9c8a990..9c421d10db 100644 --- a/treasury_outboundtransfer.go +++ b/treasury_outboundtransfer.go @@ -41,6 +41,14 @@ const ( TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccountNetworkUSDomesticWire TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccountNetwork = "us_domestic_wire" ) +// The type of flow that originated the OutboundTransfer. +type TreasuryOutboundTransferNetworkDetailsType string + +// List of values that TreasuryOutboundTransferNetworkDetailsType can take +const ( + TreasuryOutboundTransferNetworkDetailsTypeAch TreasuryOutboundTransferNetworkDetailsType = "ach" +) + // Reason for the return. type TreasuryOutboundTransferReturnedDetailsCode string @@ -82,6 +90,20 @@ type TreasuryOutboundTransferDestinationPaymentMethodOptionsParams struct { USBankAccount *TreasuryOutboundTransferDestinationPaymentMethodOptionsUSBankAccountParams `form:"us_bank_account"` } +// Optional fields for `ach`. +type TreasuryOutboundTransferNetworkDetailsAchParams struct { + // Addenda record data associated with this OutboundTransfer. + Addenda *string `form:"addenda"` +} + +// Details about the network used for the OutboundTransfer. +type TreasuryOutboundTransferNetworkDetailsParams struct { + // Optional fields for `ach`. + Ach *TreasuryOutboundTransferNetworkDetailsAchParams `form:"ach"` + // The type of flow that originated the OutboundTransfer. + Type *string `form:"type"` +} + // Creates an OutboundTransfer. type TreasuryOutboundTransferParams struct { Params `form:"*"` @@ -97,6 +119,8 @@ type TreasuryOutboundTransferParams struct { DestinationPaymentMethodOptions *TreasuryOutboundTransferDestinationPaymentMethodOptionsParams `form:"destination_payment_method_options"` // The FinancialAccount to pull funds from. FinancialAccount *string `form:"financial_account"` + // Details about the network used for the OutboundTransfer. + NetworkDetails *TreasuryOutboundTransferNetworkDetailsParams `form:"network_details"` // Statement descriptor to be shown on the receiving end of an OutboundTransfer. Maximum 10 characters for `ach` transfers or 140 characters for `wire` transfers. The default value is `transfer`. StatementDescriptor *string `form:"statement_descriptor"` } @@ -144,6 +168,20 @@ type TreasuryOutboundTransferDestinationPaymentMethodDetails struct { USBankAccount *TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccount `json:"us_bank_account"` } +// Details about an ACH transaction. +type TreasuryOutboundTransferNetworkDetailsAch struct { + // ACH Addenda record + Addenda string `json:"addenda"` +} + +// Details about the network used for the OutboundTransfer. +type TreasuryOutboundTransferNetworkDetails struct { + // Details about an ACH transaction. + Ach *TreasuryOutboundTransferNetworkDetailsAch `json:"ach"` + // The type of flow that originated the OutboundTransfer. + Type TreasuryOutboundTransferNetworkDetailsType `json:"type"` +} + // Details about a returned OutboundTransfer. Only set when the status is `returned`. type TreasuryOutboundTransferReturnedDetails struct { // Reason for the return. @@ -192,6 +230,8 @@ type TreasuryOutboundTransfer struct { Livemode bool `json:"livemode"` // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Metadata map[string]string `json:"metadata"` + // Details about the network used for the OutboundTransfer. + NetworkDetails *TreasuryOutboundTransferNetworkDetails `json:"network_details"` // String representing the object's type. Objects of the same type share the same value. Object string `json:"object"` // Details about a returned OutboundTransfer. Only set when the status is `returned`. diff --git a/treasury_receivedcredit.go b/treasury_receivedcredit.go index 2fa10c0bc6..48414fc13f 100644 --- a/treasury_receivedcredit.go +++ b/treasury_receivedcredit.go @@ -66,6 +66,14 @@ const ( TreasuryReceivedCreditNetworkUSDomesticWire TreasuryReceivedCreditNetwork = "us_domestic_wire" ) +// The type of flow that originated the ReceivedCredit. +type TreasuryReceivedCreditNetworkDetailsType string + +// List of values that TreasuryReceivedCreditNetworkDetailsType can take +const ( + TreasuryReceivedCreditNetworkDetailsTypeAch TreasuryReceivedCreditNetworkDetailsType = "ach" +) + // Status of the ReceivedCredit. ReceivedCredits are created either `succeeded` (approved) or `failed` (declined). If a ReceivedCredit is declined, the failure reason can be found in the `failure_code` field. type TreasuryReceivedCreditStatus string @@ -164,6 +172,20 @@ type TreasuryReceivedCreditLinkedFlows struct { SourceFlowType string `json:"source_flow_type"` } +// Details about an ACH transaction. +type TreasuryReceivedCreditNetworkDetailsAch struct { + // ACH Addenda record + Addenda string `json:"addenda"` +} + +// Details specific to the money movement rails. +type TreasuryReceivedCreditNetworkDetails struct { + // Details about an ACH transaction. + Ach *TreasuryReceivedCreditNetworkDetailsAch `json:"ach"` + // The type of flow that originated the ReceivedCredit. + Type TreasuryReceivedCreditNetworkDetailsType `json:"type"` +} + // ReceivedCredits represent funds sent to a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount. type TreasuryReceivedCredit struct { APIResource @@ -187,6 +209,8 @@ type TreasuryReceivedCredit struct { Livemode bool `json:"livemode"` // The rails used to send the funds. Network TreasuryReceivedCreditNetwork `json:"network"` + // Details specific to the money movement rails. + NetworkDetails *TreasuryReceivedCreditNetworkDetails `json:"network_details"` // String representing the object's type. Objects of the same type share the same value. Object string `json:"object"` // Status of the ReceivedCredit. ReceivedCredits are created either `succeeded` (approved) or `failed` (declined). If a ReceivedCredit is declined, the failure reason can be found in the `failure_code` field. diff --git a/treasury_receiveddebit.go b/treasury_receiveddebit.go index 351b006020..47196c336c 100644 --- a/treasury_receiveddebit.go +++ b/treasury_receiveddebit.go @@ -55,6 +55,14 @@ const ( TreasuryReceivedDebitNetworkStripe TreasuryReceivedDebitNetwork = "stripe" ) +// The type of flow that originated the ReceivedDebit. +type TreasuryReceivedDebitNetworkDetailsType string + +// List of values that TreasuryReceivedDebitNetworkDetailsType can take +const ( + TreasuryReceivedDebitNetworkDetailsTypeAch TreasuryReceivedDebitNetworkDetailsType = "ach" +) + // Status of the ReceivedDebit. ReceivedDebits are created with a status of either `succeeded` (approved) or `failed` (declined). The failure reason can be found under the `failure_code`. type TreasuryReceivedDebitStatus string @@ -116,6 +124,22 @@ type TreasuryReceivedDebitLinkedFlows struct { IssuingAuthorization string `json:"issuing_authorization"` // Set if the ReceivedDebit is also viewable as an [Issuing Dispute](https://stripe.com/docs/api#issuing_disputes) object. IssuingTransaction string `json:"issuing_transaction"` + // The ReceivedCredit that Capital withheld from + ReceivedCreditCapitalWithholding string `json:"received_credit_capital_withholding"` +} + +// Details about an ACH transaction. +type TreasuryReceivedDebitNetworkDetailsAch struct { + // ACH Addenda record + Addenda string `json:"addenda"` +} + +// Details specific to the money movement rails. +type TreasuryReceivedDebitNetworkDetails struct { + // Details about an ACH transaction. + Ach *TreasuryReceivedDebitNetworkDetailsAch `json:"ach"` + // The type of flow that originated the ReceivedDebit. + Type TreasuryReceivedDebitNetworkDetailsType `json:"type"` } // ReceivedDebits represent funds pulled from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts). These are not initiated from the FinancialAccount. @@ -141,6 +165,8 @@ type TreasuryReceivedDebit struct { Livemode bool `json:"livemode"` // The network used for the ReceivedDebit. Network TreasuryReceivedDebitNetwork `json:"network"` + // Details specific to the money movement rails. + NetworkDetails *TreasuryReceivedDebitNetworkDetails `json:"network_details"` // String representing the object's type. Objects of the same type share the same value. Object string `json:"object"` // Status of the ReceivedDebit. ReceivedDebits are created with a status of either `succeeded` (approved) or `failed` (declined). The failure reason can be found under the `failure_code`.