From 72ce8f5e52766ba8ac5150481d9cb3ff1aa902a5 Mon Sep 17 00:00:00 2001 From: Stainless Bot Date: Fri, 1 Sep 2023 22:54:59 +0000 Subject: [PATCH] feat(api): add user defined id - Add `user_defined_id` property to ExternalBankAccount --- externalbankaccount.go | 27 +++++++++++++++++++-------- externalbankaccount_test.go | 2 ++ externalbankaccountmicrodeposit.go | 6 ++++-- transaction.go | 6 +++--- 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/externalbankaccount.go b/externalbankaccount.go index f9a8ebf..b0627f4 100644 --- a/externalbankaccount.go +++ b/externalbankaccount.go @@ -182,8 +182,9 @@ type ExternalBankAccountNewResponse struct { Dob time.Time `json:"dob" format:"date"` DoingBusinessAs string `json:"doing_business_as"` // The nickname given to this record of External Bank Account - Name string `json:"name"` - JSON externalBankAccountNewResponseJSON + Name string `json:"name"` + UserDefinedID string `json:"user_defined_id"` + JSON externalBankAccountNewResponseJSON } // externalBankAccountNewResponseJSON contains the JSON metadata for the struct @@ -207,6 +208,7 @@ type externalBankAccountNewResponseJSON struct { Dob apijson.Field DoingBusinessAs apijson.Field Name apijson.Field + UserDefinedID apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -292,8 +294,9 @@ type ExternalBankAccountGetResponse struct { Dob time.Time `json:"dob" format:"date"` DoingBusinessAs string `json:"doing_business_as"` // The nickname given to this record of External Bank Account - Name string `json:"name"` - JSON externalBankAccountGetResponseJSON + Name string `json:"name"` + UserDefinedID string `json:"user_defined_id"` + JSON externalBankAccountGetResponseJSON } // externalBankAccountGetResponseJSON contains the JSON metadata for the struct @@ -317,6 +320,7 @@ type externalBankAccountGetResponseJSON struct { Dob apijson.Field DoingBusinessAs apijson.Field Name apijson.Field + UserDefinedID apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -402,8 +406,9 @@ type ExternalBankAccountUpdateResponse struct { Dob time.Time `json:"dob" format:"date"` DoingBusinessAs string `json:"doing_business_as"` // The nickname given to this record of External Bank Account - Name string `json:"name"` - JSON externalBankAccountUpdateResponseJSON + Name string `json:"name"` + UserDefinedID string `json:"user_defined_id"` + JSON externalBankAccountUpdateResponseJSON } // externalBankAccountUpdateResponseJSON contains the JSON metadata for the struct @@ -427,6 +432,7 @@ type externalBankAccountUpdateResponseJSON struct { Dob apijson.Field DoingBusinessAs apijson.Field Name apijson.Field + UserDefinedID apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -512,8 +518,9 @@ type ExternalBankAccountListResponse struct { Dob time.Time `json:"dob" format:"date"` DoingBusinessAs string `json:"doing_business_as"` // The nickname given to this record of External Bank Account - Name string `json:"name"` - JSON externalBankAccountListResponseJSON + Name string `json:"name"` + UserDefinedID string `json:"user_defined_id"` + JSON externalBankAccountListResponseJSON } // externalBankAccountListResponseJSON contains the JSON metadata for the struct @@ -537,6 +544,7 @@ type externalBankAccountListResponseJSON struct { Dob apijson.Field DoingBusinessAs apijson.Field Name apijson.Field + UserDefinedID apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -600,6 +608,7 @@ type ExternalBankAccountNewParamsPlaidCreateBankAccountAPIRequest struct { // Date of Birth of the Individual that owns the external bank account Dob param.Field[time.Time] `json:"dob" format:"date"` DoingBusinessAs param.Field[string] `json:"doing_business_as"` + UserDefinedID param.Field[string] `json:"user_defined_id"` } func (r ExternalBankAccountNewParamsPlaidCreateBankAccountAPIRequest) MarshalJSON() (data []byte, err error) { @@ -628,6 +637,7 @@ type ExternalBankAccountNewParamsBankVerifiedCreateBankAccountAPIRequest struct Dob param.Field[time.Time] `json:"dob" format:"date"` DoingBusinessAs param.Field[string] `json:"doing_business_as"` Name param.Field[string] `json:"name"` + UserDefinedID param.Field[string] `json:"user_defined_id"` // Indicates whether verification was enforced for a given association record. For // MICRO_DEPOSIT, option to disable verification if the external bank account has // already been verified before. By default, verification will be required unless @@ -661,6 +671,7 @@ type ExternalBankAccountUpdateParams struct { Name param.Field[string] `json:"name"` Owner param.Field[string] `json:"owner"` OwnerType param.Field[OwnerType] `json:"owner_type"` + UserDefinedID param.Field[string] `json:"user_defined_id"` } func (r ExternalBankAccountUpdateParams) MarshalJSON() (data []byte, err error) { diff --git a/externalbankaccount_test.go b/externalbankaccount_test.go index 1252d48..c8204e1 100644 --- a/externalbankaccount_test.go +++ b/externalbankaccount_test.go @@ -30,6 +30,7 @@ func TestExternalBankAccountNewWithOptionalParams(t *testing.T) { CompanyID: lithic.F("x"), Dob: lithic.F(time.Now()), DoingBusinessAs: lithic.F("string"), + UserDefinedID: lithic.F("string"), }) if err != nil { var apierr *lithic.Error @@ -84,6 +85,7 @@ func TestExternalBankAccountUpdateWithOptionalParams(t *testing.T) { Name: lithic.F("x"), Owner: lithic.F("x"), OwnerType: lithic.F(lithic.OwnerTypeIndividual), + UserDefinedID: lithic.F("string"), }, ) if err != nil { diff --git a/externalbankaccountmicrodeposit.go b/externalbankaccountmicrodeposit.go index 015db2e..7192a77 100644 --- a/externalbankaccountmicrodeposit.go +++ b/externalbankaccountmicrodeposit.go @@ -79,8 +79,9 @@ type ExternalBankAccountMicroDepositNewResponse struct { Dob time.Time `json:"dob" format:"date"` DoingBusinessAs string `json:"doing_business_as"` // The nickname given to this record of External Bank Account - Name string `json:"name"` - JSON externalBankAccountMicroDepositNewResponseJSON + Name string `json:"name"` + UserDefinedID string `json:"user_defined_id"` + JSON externalBankAccountMicroDepositNewResponseJSON } // externalBankAccountMicroDepositNewResponseJSON contains the JSON metadata for @@ -104,6 +105,7 @@ type externalBankAccountMicroDepositNewResponseJSON struct { Dob apijson.Field DoingBusinessAs apijson.Field Name apijson.Field + UserDefinedID apijson.Field raw string ExtraFields map[string]apijson.Field } diff --git a/transaction.go b/transaction.go index ced89df..a8fc9e5 100644 --- a/transaction.go +++ b/transaction.go @@ -35,7 +35,7 @@ func NewTransactionService(opts ...option.RequestOption) (r *TransactionService) return } -// Get specific transaction. +// Get specific card transaction. func (r *TransactionService) Get(ctx context.Context, transactionToken string, opts ...option.RequestOption) (res *Transaction, err error) { opts = append(r.Options[:], opts...) path := fmt.Sprintf("transactions/%s", transactionToken) @@ -43,7 +43,7 @@ func (r *TransactionService) Get(ctx context.Context, transactionToken string, o return } -// List transactions. +// List card transactions. func (r *TransactionService) List(ctx context.Context, query TransactionListParams, opts ...option.RequestOption) (res *shared.Page[Transaction], err error) { var raw *http.Response opts = append(r.Options, opts...) @@ -61,7 +61,7 @@ func (r *TransactionService) List(ctx context.Context, query TransactionListPara return res, nil } -// List transactions. +// List card transactions. func (r *TransactionService) ListAutoPaging(ctx context.Context, query TransactionListParams, opts ...option.RequestOption) *shared.PageAutoPager[Transaction] { return shared.NewPageAutoPager(r.List(ctx, query, opts...)) }