github.com/stripe/stripe-go/v76@v76.25.0/balance/client.go (about)

     1  //
     2  //
     3  // File generated from our OpenAPI spec
     4  //
     5  //
     6  
     7  // Package balance provides the /balance APIs
     8  package balance
     9  
    10  import (
    11  	"net/http"
    12  
    13  	stripe "github.com/stripe/stripe-go/v76"
    14  )
    15  
    16  // Client is used to invoke /balance APIs.
    17  type Client struct {
    18  	B   stripe.Backend
    19  	Key string
    20  }
    21  
    22  // Get returns the details of a balance.
    23  func Get(params *stripe.BalanceParams) (*stripe.Balance, error) {
    24  	return getC().Get(params)
    25  }
    26  
    27  // Get returns the details of a balance.
    28  func (c Client) Get(params *stripe.BalanceParams) (*stripe.Balance, error) {
    29  	balance := &stripe.Balance{}
    30  	err := c.B.Call(http.MethodGet, "/v1/balance", c.Key, params, balance)
    31  	return balance, err
    32  }
    33  
    34  func getC() Client {
    35  	return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key}
    36  }