Skip to content

Commit

Permalink
feat(api): add user defined id (#114)
Browse files Browse the repository at this point in the history
- Add `user_defined_id` property to ExternalBankAccount
  • Loading branch information
stainless-bot committed Sep 12, 2023
1 parent c902404 commit c54b617
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 13 deletions.
27 changes: 19 additions & 8 deletions externalbankaccount.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down Expand Up @@ -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
Expand All @@ -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
}
Expand Down Expand Up @@ -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
Expand All @@ -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
}
Expand Down Expand Up @@ -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
Expand All @@ -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
}
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions externalbankaccount_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 4 additions & 2 deletions externalbankaccountmicrodeposit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ 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)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
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...)
Expand All @@ -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...))
}
Expand Down

0 comments on commit c54b617

Please sign in to comment.