Add DoCustomRequestV5

This commit is contained in:
Samuel Lorch 2025-03-14 13:28:27 +01:00
parent 2afac57e29
commit 7bc894763c

View file

@ -26,12 +26,22 @@ type APIHeader struct {
} }
// DoCustomRequest Executes a Custom Request and returns a APIResponse // DoCustomRequest Executes a Custom Request and returns a APIResponse
//
// Deprecated: DoCustomRequest is deprecated. Use DoCustomRequestV5 instead
func (c *Client) DoCustomRequest(ctx context.Context, method, path, version string, body interface{}, opts interface{}) (*APIResponse, error) { func (c *Client) DoCustomRequest(ctx context.Context, method, path, version string, body interface{}, opts interface{}) (*APIResponse, error) {
_, response, err := c.DoCustomRequestAndReturnRawResponse(ctx, method, path, version, body, opts) _, response, err := c.DoCustomRequestAndReturnRawResponse(ctx, method, path, version, body, opts)
return response, err return response, err
} }
// DoCustomRequestV5 Executes a Custom Request and returns a APIResponse
func (c *Client) DoCustomRequestV5(ctx context.Context, method, path string, body interface{}, opts interface{}) (*APIResponse, error) {
_, response, err := c.DoCustomRequestAndReturnRawResponseV5(ctx, method, path, body, opts)
return response, err
}
// DoCustomRequestAndReturnRawResponse Executes a Custom Request and returns a APIResponse and the Raw HTTP Response // DoCustomRequestAndReturnRawResponse Executes a Custom Request and returns a APIResponse and the Raw HTTP Response
//
// Deprecated: DoCustomRequestAndReturnRawResponse is deprecated. Use DoCustomRequestAndReturnRawResponseV5 instead
func (c *Client) DoCustomRequestAndReturnRawResponse(ctx context.Context, method, path, version string, body interface{}, opts interface{}) (*http.Response, *APIResponse, error) { func (c *Client) DoCustomRequestAndReturnRawResponse(ctx context.Context, method, path, version string, body interface{}, opts interface{}) (*http.Response, *APIResponse, error) {
// version is no longer used and is ignored. // version is no longer used and is ignored.
return c.DoCustomRequestAndReturnRawResponseV5(ctx, method, path, body, opts) return c.DoCustomRequestAndReturnRawResponseV5(ctx, method, path, body, opts)