Skip to content
This repository has been archived by the owner on Feb 5, 2025. It is now read-only.

Commit

Permalink
Release v0.0.27
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Aug 17, 2023
1 parent b7be7c3 commit 0a03968
Show file tree
Hide file tree
Showing 4 changed files with 1,184 additions and 2,596 deletions.
47 changes: 47 additions & 0 deletions client/client_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package client

import (
"net/http"
"testing"
"time"

"github.com/stretchr/testify/assert"
)

func TestNewClient(t *testing.T) {
t.Run("default", func(t *testing.T) {
c := NewClient()
assert.Empty(t, c.(*client).baseURL)
assert.Equal(t, http.DefaultClient, c.(*client).httpClient)
})

t.Run("base url", func(t *testing.T) {
c := NewClient(
ClientWithBaseURL("test.co"),
)
assert.Equal(t, "test.co", c.(*client).baseURL)
assert.Equal(t, http.DefaultClient, c.(*client).httpClient)
})

t.Run("http client", func(t *testing.T) {
httpClient := &http.Client{
Timeout: 5 * time.Second,
}
c := NewClient(
ClientWithHTTPClient(httpClient),
)
assert.Empty(t, c.(*client).baseURL)
assert.Equal(t, httpClient, c.(*client).httpClient)
})

t.Run("http header", func(t *testing.T) {
header := make(http.Header)
header.Set("X-API-Tenancy", "test")
c := NewClient(
ClientWithHTTPHeader(header),
)
assert.Empty(t, c.(*client).baseURL)
assert.Equal(t, http.DefaultClient, c.(*client).httpClient)
assert.Equal(t, "test", c.(*client).header.Get("X-API-Tenancy"))
})
}
2 changes: 1 addition & 1 deletion core/client_option.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ func (c *ClientOptions) cloneHeader() http.Header {
headers := c.HTTPHeader.Clone()
headers.Set("X-Fern-Language", "Go")
headers.Set("X-Fern-SDK-Name", "github.com/hookdeck/hookdeck-go-sdk")
headers.Set("X-Fern-SDK-Version", "0.0.26")
headers.Set("X-Fern-SDK-Version", "0.0.27")
return headers
}
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was auto-generated by Fern from our API Definition.

// A transformation represents JavaScript code that will be executed on a connection's requests. Transformations are applied to connections using Rules.
// A request represent a webhook received by Hookdeck.
package api
Loading

0 comments on commit 0a03968

Please sign in to comment.