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

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