Skip to content

Commit

Permalink
Release v0.0.37
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Apr 16, 2024
1 parent a3cd6b4 commit 42d7592
Show file tree
Hide file tree
Showing 21 changed files with 2,199 additions and 1,237 deletions.
8 changes: 4 additions & 4 deletions attempt/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ func NewClient(opts ...core.ClientOption) *Client {
}

func (c *Client) List(ctx context.Context, request *hookdeckgosdk.AttemptListRequest) (*hookdeckgosdk.EventAttemptPaginatedResult, error) {
baseURL := "https://api.hookdeck.com"
baseURL := "https://api.hookdeck.com/2024-03-01"
if c.baseURL != "" {
baseURL = c.baseURL
}
endpointURL := baseURL + "/" + "2023-07-01/attempts"
endpointURL := baseURL + "/" + "attempts"

queryParams := make(url.Values)
if request.EventId != nil {
Expand Down Expand Up @@ -107,11 +107,11 @@ func (c *Client) List(ctx context.Context, request *hookdeckgosdk.AttemptListReq
}

func (c *Client) Retrieve(ctx context.Context, id string) (*hookdeckgosdk.EventAttempt, error) {
baseURL := "https://api.hookdeck.com"
baseURL := "https://api.hookdeck.com/2024-03-01"
if c.baseURL != "" {
baseURL = c.baseURL
}
endpointURL := fmt.Sprintf(baseURL+"/"+"2023-07-01/attempts/%v", id)
endpointURL := fmt.Sprintf(baseURL+"/"+"attempts/%v", id)

errorDecoder := func(statusCode int, body io.Reader) error {
raw, err := io.ReadAll(body)
Expand Down
28 changes: 14 additions & 14 deletions bookmark/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ func NewClient(opts ...core.ClientOption) *Client {
}

func (c *Client) List(ctx context.Context, request *hookdeckgosdk.BookmarkListRequest) (*hookdeckgosdk.BookmarkPaginatedResult, error) {
baseURL := "https://api.hookdeck.com"
baseURL := "https://api.hookdeck.com/2024-03-01"
if c.baseURL != "" {
baseURL = c.baseURL
}
endpointURL := baseURL + "/" + "2023-07-01/bookmarks"
endpointURL := baseURL + "/" + "bookmarks"

queryParams := make(url.Values)
if request.Id != nil {
Expand Down Expand Up @@ -123,11 +123,11 @@ func (c *Client) List(ctx context.Context, request *hookdeckgosdk.BookmarkListRe
}

func (c *Client) Create(ctx context.Context, request *hookdeckgosdk.BookmarkCreateRequest) (*hookdeckgosdk.Bookmark, error) {
baseURL := "https://api.hookdeck.com"
baseURL := "https://api.hookdeck.com/2024-03-01"
if c.baseURL != "" {
baseURL = c.baseURL
}
endpointURL := baseURL + "/" + "2023-07-01/bookmarks"
endpointURL := baseURL + "/" + "bookmarks"

errorDecoder := func(statusCode int, body io.Reader) error {
raw, err := io.ReadAll(body)
Expand Down Expand Up @@ -173,11 +173,11 @@ func (c *Client) Create(ctx context.Context, request *hookdeckgosdk.BookmarkCrea
}

func (c *Client) Retrieve(ctx context.Context, id string) (*hookdeckgosdk.Bookmark, error) {
baseURL := "https://api.hookdeck.com"
baseURL := "https://api.hookdeck.com/2024-03-01"
if c.baseURL != "" {
baseURL = c.baseURL
}
endpointURL := fmt.Sprintf(baseURL+"/"+"2023-07-01/bookmarks/%v", id)
endpointURL := fmt.Sprintf(baseURL+"/"+"bookmarks/%v", id)

errorDecoder := func(statusCode int, body io.Reader) error {
raw, err := io.ReadAll(body)
Expand Down Expand Up @@ -216,11 +216,11 @@ func (c *Client) Retrieve(ctx context.Context, id string) (*hookdeckgosdk.Bookma
}

func (c *Client) Update(ctx context.Context, id string, request *hookdeckgosdk.BookmarkUpdateRequest) (*hookdeckgosdk.Bookmark, error) {
baseURL := "https://api.hookdeck.com"
baseURL := "https://api.hookdeck.com/2024-03-01"
if c.baseURL != "" {
baseURL = c.baseURL
}
endpointURL := fmt.Sprintf(baseURL+"/"+"2023-07-01/bookmarks/%v", id)
endpointURL := fmt.Sprintf(baseURL+"/"+"bookmarks/%v", id)

errorDecoder := func(statusCode int, body io.Reader) error {
raw, err := io.ReadAll(body)
Expand Down Expand Up @@ -273,11 +273,11 @@ func (c *Client) Update(ctx context.Context, id string, request *hookdeckgosdk.B
}

func (c *Client) Delete(ctx context.Context, id string) (*hookdeckgosdk.DeletedBookmarkResponse, error) {
baseURL := "https://api.hookdeck.com"
baseURL := "https://api.hookdeck.com/2024-03-01"
if c.baseURL != "" {
baseURL = c.baseURL
}
endpointURL := fmt.Sprintf(baseURL+"/"+"2023-07-01/bookmarks/%v", id)
endpointURL := fmt.Sprintf(baseURL+"/"+"bookmarks/%v", id)

errorDecoder := func(statusCode int, body io.Reader) error {
raw, err := io.ReadAll(body)
Expand Down Expand Up @@ -316,11 +316,11 @@ func (c *Client) Delete(ctx context.Context, id string) (*hookdeckgosdk.DeletedB
}

func (c *Client) RetrieveBody(ctx context.Context, id string) (*hookdeckgosdk.RawBody, error) {
baseURL := "https://api.hookdeck.com"
baseURL := "https://api.hookdeck.com/2024-03-01"
if c.baseURL != "" {
baseURL = c.baseURL
}
endpointURL := fmt.Sprintf(baseURL+"/"+"2023-07-01/bookmarks/%v/raw_body", id)
endpointURL := fmt.Sprintf(baseURL+"/"+"bookmarks/%v/raw_body", id)

errorDecoder := func(statusCode int, body io.Reader) error {
raw, err := io.ReadAll(body)
Expand Down Expand Up @@ -359,11 +359,11 @@ func (c *Client) RetrieveBody(ctx context.Context, id string) (*hookdeckgosdk.Ra
}

func (c *Client) Trigger(ctx context.Context, id string, request *hookdeckgosdk.BookmarkTriggerRequest) (hookdeckgosdk.EventArray, error) {
baseURL := "https://api.hookdeck.com"
baseURL := "https://api.hookdeck.com/2024-03-01"
if c.baseURL != "" {
baseURL = c.baseURL
}
endpointURL := fmt.Sprintf(baseURL+"/"+"2023-07-01/bookmarks/%v/trigger", id)
endpointURL := fmt.Sprintf(baseURL+"/"+"bookmarks/%v/trigger", id)

errorDecoder := func(statusCode int, body io.Reader) error {
raw, err := io.ReadAll(body)
Expand Down
8 changes: 4 additions & 4 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
type ConnectionCountRequest struct {
DestinationId *string `json:"-"`
SourceId *string `json:"-"`
Archived *bool `json:"-"`
ArchivedAt *time.Time `json:"-"`
Disabled *bool `json:"-"`
DisabledAt *time.Time `json:"-"`
PausedAt *time.Time `json:"-"`
}

Expand All @@ -37,8 +37,8 @@ type ConnectionListRequest struct {
Name *string `json:"-"`
DestinationId *string `json:"-"`
SourceId *string `json:"-"`
Archived *bool `json:"-"`
ArchivedAt *time.Time `json:"-"`
Disabled *bool `json:"-"`
DisabledAt *time.Time `json:"-"`
FullName *string `json:"-"`
PausedAt *time.Time `json:"-"`
OrderBy *ConnectionListRequestOrderBy `json:"-"`
Expand Down
64 changes: 32 additions & 32 deletions connection/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ func NewClient(opts ...core.ClientOption) *Client {
}

func (c *Client) List(ctx context.Context, request *hookdeckgosdk.ConnectionListRequest) (*hookdeckgosdk.ConnectionPaginatedResult, error) {
baseURL := "https://api.hookdeck.com"
baseURL := "https://api.hookdeck.com/2024-03-01"
if c.baseURL != "" {
baseURL = c.baseURL
}
endpointURL := baseURL + "/" + "2023-07-01/connections"
endpointURL := baseURL + "/" + "connections"

queryParams := make(url.Values)
if request.Id != nil {
Expand All @@ -54,11 +54,11 @@ func (c *Client) List(ctx context.Context, request *hookdeckgosdk.ConnectionList
if request.SourceId != nil {
queryParams.Add("source_id", fmt.Sprintf("%v", *request.SourceId))
}
if request.Archived != nil {
queryParams.Add("archived", fmt.Sprintf("%v", *request.Archived))
if request.Disabled != nil {
queryParams.Add("disabled", fmt.Sprintf("%v", *request.Disabled))
}
if request.ArchivedAt != nil {
queryParams.Add("archived_at", fmt.Sprintf("%v", request.ArchivedAt.Format(time.RFC3339)))
if request.DisabledAt != nil {
queryParams.Add("disabled_at", fmt.Sprintf("%v", request.DisabledAt.Format(time.RFC3339)))
}
if request.FullName != nil {
queryParams.Add("full_name", fmt.Sprintf("%v", *request.FullName))
Expand Down Expand Up @@ -129,11 +129,11 @@ func (c *Client) List(ctx context.Context, request *hookdeckgosdk.ConnectionList
}

func (c *Client) Create(ctx context.Context, request *hookdeckgosdk.ConnectionCreateRequest) (*hookdeckgosdk.Connection, error) {
baseURL := "https://api.hookdeck.com"
baseURL := "https://api.hookdeck.com/2024-03-01"
if c.baseURL != "" {
baseURL = c.baseURL
}
endpointURL := baseURL + "/" + "2023-07-01/connections"
endpointURL := baseURL + "/" + "connections"

errorDecoder := func(statusCode int, body io.Reader) error {
raw, err := io.ReadAll(body)
Expand Down Expand Up @@ -179,11 +179,11 @@ func (c *Client) Create(ctx context.Context, request *hookdeckgosdk.ConnectionCr
}

func (c *Client) Upsert(ctx context.Context, request *hookdeckgosdk.ConnectionUpsertRequest) (*hookdeckgosdk.Connection, error) {
baseURL := "https://api.hookdeck.com"
baseURL := "https://api.hookdeck.com/2024-03-01"
if c.baseURL != "" {
baseURL = c.baseURL
}
endpointURL := baseURL + "/" + "2023-07-01/connections"
endpointURL := baseURL + "/" + "connections"

errorDecoder := func(statusCode int, body io.Reader) error {
raw, err := io.ReadAll(body)
Expand Down Expand Up @@ -229,11 +229,11 @@ func (c *Client) Upsert(ctx context.Context, request *hookdeckgosdk.ConnectionUp
}

func (c *Client) Count(ctx context.Context, request *hookdeckgosdk.ConnectionCountRequest) (*hookdeckgosdk.ConnectionCountResponse, error) {
baseURL := "https://api.hookdeck.com"
baseURL := "https://api.hookdeck.com/2024-03-01"
if c.baseURL != "" {
baseURL = c.baseURL
}
endpointURL := baseURL + "/" + "2023-07-01/connections/count"
endpointURL := baseURL + "/" + "connections/count"

queryParams := make(url.Values)
if request.DestinationId != nil {
Expand All @@ -242,11 +242,11 @@ func (c *Client) Count(ctx context.Context, request *hookdeckgosdk.ConnectionCou
if request.SourceId != nil {
queryParams.Add("source_id", fmt.Sprintf("%v", *request.SourceId))
}
if request.Archived != nil {
queryParams.Add("archived", fmt.Sprintf("%v", *request.Archived))
if request.Disabled != nil {
queryParams.Add("disabled", fmt.Sprintf("%v", *request.Disabled))
}
if request.ArchivedAt != nil {
queryParams.Add("archived_at", fmt.Sprintf("%v", request.ArchivedAt.Format(time.RFC3339)))
if request.DisabledAt != nil {
queryParams.Add("disabled_at", fmt.Sprintf("%v", request.DisabledAt.Format(time.RFC3339)))
}
if request.PausedAt != nil {
queryParams.Add("paused_at", fmt.Sprintf("%v", request.PausedAt.Format(time.RFC3339)))
Expand Down Expand Up @@ -299,11 +299,11 @@ func (c *Client) Count(ctx context.Context, request *hookdeckgosdk.ConnectionCou
}

func (c *Client) Retrieve(ctx context.Context, id string) (*hookdeckgosdk.Connection, error) {
baseURL := "https://api.hookdeck.com"
baseURL := "https://api.hookdeck.com/2024-03-01"
if c.baseURL != "" {
baseURL = c.baseURL
}
endpointURL := fmt.Sprintf(baseURL+"/"+"2023-07-01/connections/%v", id)
endpointURL := fmt.Sprintf(baseURL+"/"+"connections/%v", id)

errorDecoder := func(statusCode int, body io.Reader) error {
raw, err := io.ReadAll(body)
Expand Down Expand Up @@ -342,11 +342,11 @@ func (c *Client) Retrieve(ctx context.Context, id string) (*hookdeckgosdk.Connec
}

func (c *Client) Update(ctx context.Context, id string, request *hookdeckgosdk.ConnectionUpdateRequest) (*hookdeckgosdk.Connection, error) {
baseURL := "https://api.hookdeck.com"
baseURL := "https://api.hookdeck.com/2024-03-01"
if c.baseURL != "" {
baseURL = c.baseURL
}
endpointURL := fmt.Sprintf(baseURL+"/"+"2023-07-01/connections/%v", id)
endpointURL := fmt.Sprintf(baseURL+"/"+"connections/%v", id)

errorDecoder := func(statusCode int, body io.Reader) error {
raw, err := io.ReadAll(body)
Expand Down Expand Up @@ -399,11 +399,11 @@ func (c *Client) Update(ctx context.Context, id string, request *hookdeckgosdk.C
}

func (c *Client) Delete(ctx context.Context, id string) (*hookdeckgosdk.ConnectionDeleteResponse, error) {
baseURL := "https://api.hookdeck.com"
baseURL := "https://api.hookdeck.com/2024-03-01"
if c.baseURL != "" {
baseURL = c.baseURL
}
endpointURL := fmt.Sprintf(baseURL+"/"+"2023-07-01/connections/%v", id)
endpointURL := fmt.Sprintf(baseURL+"/"+"connections/%v", id)

errorDecoder := func(statusCode int, body io.Reader) error {
raw, err := io.ReadAll(body)
Expand Down Expand Up @@ -441,12 +441,12 @@ func (c *Client) Delete(ctx context.Context, id string) (*hookdeckgosdk.Connecti
return response, nil
}

func (c *Client) Archive(ctx context.Context, id string) (*hookdeckgosdk.Connection, error) {
baseURL := "https://api.hookdeck.com"
func (c *Client) Disable(ctx context.Context, id string) (*hookdeckgosdk.Connection, error) {
baseURL := "https://api.hookdeck.com/2024-03-01"
if c.baseURL != "" {
baseURL = c.baseURL
}
endpointURL := fmt.Sprintf(baseURL+"/"+"2023-07-01/connections/%v/archive", id)
endpointURL := fmt.Sprintf(baseURL+"/"+"connections/%v/archive", id)

errorDecoder := func(statusCode int, body io.Reader) error {
raw, err := io.ReadAll(body)
Expand Down Expand Up @@ -484,12 +484,12 @@ func (c *Client) Archive(ctx context.Context, id string) (*hookdeckgosdk.Connect
return response, nil
}

func (c *Client) Unarchive(ctx context.Context, id string) (*hookdeckgosdk.Connection, error) {
baseURL := "https://api.hookdeck.com"
func (c *Client) Enable(ctx context.Context, id string) (*hookdeckgosdk.Connection, error) {
baseURL := "https://api.hookdeck.com/2024-03-01"
if c.baseURL != "" {
baseURL = c.baseURL
}
endpointURL := fmt.Sprintf(baseURL+"/"+"2023-07-01/connections/%v/unarchive", id)
endpointURL := fmt.Sprintf(baseURL+"/"+"connections/%v/unarchive", id)

errorDecoder := func(statusCode int, body io.Reader) error {
raw, err := io.ReadAll(body)
Expand Down Expand Up @@ -528,11 +528,11 @@ func (c *Client) Unarchive(ctx context.Context, id string) (*hookdeckgosdk.Conne
}

func (c *Client) Pause(ctx context.Context, id string) (*hookdeckgosdk.Connection, error) {
baseURL := "https://api.hookdeck.com"
baseURL := "https://api.hookdeck.com/2024-03-01"
if c.baseURL != "" {
baseURL = c.baseURL
}
endpointURL := fmt.Sprintf(baseURL+"/"+"2023-07-01/connections/%v/pause", id)
endpointURL := fmt.Sprintf(baseURL+"/"+"connections/%v/pause", id)

errorDecoder := func(statusCode int, body io.Reader) error {
raw, err := io.ReadAll(body)
Expand Down Expand Up @@ -571,11 +571,11 @@ func (c *Client) Pause(ctx context.Context, id string) (*hookdeckgosdk.Connectio
}

func (c *Client) Unpause(ctx context.Context, id string) (*hookdeckgosdk.Connection, error) {
baseURL := "https://api.hookdeck.com"
baseURL := "https://api.hookdeck.com/2024-03-01"
if c.baseURL != "" {
baseURL = c.baseURL
}
endpointURL := fmt.Sprintf(baseURL+"/"+"2023-07-01/connections/%v/unpause", id)
endpointURL := fmt.Sprintf(baseURL+"/"+"connections/%v/unpause", id)

errorDecoder := func(statusCode int, body io.Reader) error {
raw, err := io.ReadAll(body)
Expand Down
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", "v0.0.36")
headers.Set("X-Fern-SDK-Version", "v0.0.37")
return headers
}
18 changes: 9 additions & 9 deletions customdomain/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ func NewClient(opts ...core.ClientOption) *Client {
}
}

func (c *Client) List(ctx context.Context, teamId string) (hookdeckgosdk.ListCustomDomainSchema, error) {
baseURL := "https://api.hookdeck.com"
func (c *Client) List(ctx context.Context) (hookdeckgosdk.ListCustomDomainSchema, error) {
baseURL := "https://api.hookdeck.com/2024-03-01"
if c.baseURL != "" {
baseURL = c.baseURL
}
endpointURL := fmt.Sprintf(baseURL+"/"+"2023-07-01/teams/%v/custom_domains", teamId)
endpointURL := baseURL + "/" + "teams/current/custom_domains"

var response hookdeckgosdk.ListCustomDomainSchema
if err := core.DoRequest(
Expand All @@ -52,12 +52,12 @@ func (c *Client) List(ctx context.Context, teamId string) (hookdeckgosdk.ListCus
return response, nil
}

func (c *Client) Create(ctx context.Context, teamId string, request *hookdeckgosdk.AddCustomHostname) (*hookdeckgosdk.AddCustomHostname, error) {
baseURL := "https://api.hookdeck.com"
func (c *Client) Create(ctx context.Context, request *hookdeckgosdk.AddCustomHostname) (*hookdeckgosdk.AddCustomHostname, error) {
baseURL := "https://api.hookdeck.com/2024-03-01"
if c.baseURL != "" {
baseURL = c.baseURL
}
endpointURL := fmt.Sprintf(baseURL+"/"+"2023-07-01/teams/%v/custom_domains", teamId)
endpointURL := baseURL + "/" + "teams/current/custom_domains"

var response *hookdeckgosdk.AddCustomHostname
if err := core.DoRequest(
Expand All @@ -76,12 +76,12 @@ func (c *Client) Create(ctx context.Context, teamId string, request *hookdeckgos
return response, nil
}

func (c *Client) Delete(ctx context.Context, teamId string, domainId string) (*hookdeckgosdk.DeleteCustomDomainSchema, error) {
baseURL := "https://api.hookdeck.com"
func (c *Client) Delete(ctx context.Context, domainId string) (*hookdeckgosdk.DeleteCustomDomainSchema, error) {
baseURL := "https://api.hookdeck.com/2024-03-01"
if c.baseURL != "" {
baseURL = c.baseURL
}
endpointURL := fmt.Sprintf(baseURL+"/"+"2023-07-01/teams/%v/custom_domains/%v", teamId, domainId)
endpointURL := fmt.Sprintf(baseURL+"/"+"teams/current/custom_domains/%v", domainId)

var response *hookdeckgosdk.DeleteCustomDomainSchema
if err := core.DoRequest(
Expand Down
Loading

0 comments on commit 42d7592

Please sign in to comment.