github.com/stripe/stripe-go/v76@v76.25.0/testhelpers/treasury/receiveddebit/client.go (about) 1 // 2 // 3 // File generated from our OpenAPI spec 4 // 5 // 6 7 // Package receiveddebit provides the /treasury/received_debits APIs 8 package receiveddebit 9 10 import ( 11 "net/http" 12 13 stripe "github.com/stripe/stripe-go/v76" 14 ) 15 16 // Client is used to invoke /treasury/received_debits APIs. 17 type Client struct { 18 B stripe.Backend 19 Key string 20 } 21 22 // New creates a new treasury received debit. 23 func New(params *stripe.TestHelpersTreasuryReceivedDebitParams) (*stripe.TreasuryReceivedDebit, error) { 24 return getC().New(params) 25 } 26 27 // New creates a new treasury received debit. 28 func (c Client) New(params *stripe.TestHelpersTreasuryReceivedDebitParams) (*stripe.TreasuryReceivedDebit, error) { 29 receiveddebit := &stripe.TreasuryReceivedDebit{} 30 err := c.B.Call( 31 http.MethodPost, 32 "/v1/test_helpers/treasury/received_debits", 33 c.Key, 34 params, 35 receiveddebit, 36 ) 37 return receiveddebit, err 38 } 39 40 func getC() Client { 41 return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key} 42 }