Skip to content

Commit

Permalink
Release v0.0.28
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Aug 23, 2023
1 parent 0a03968 commit e3110b9
Show file tree
Hide file tree
Showing 33 changed files with 681 additions and 680 deletions.
27 changes: 11 additions & 16 deletions attempts/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,25 @@ import (
url "net/url"
)

type Client interface {
GetAttempts(ctx context.Context, request *hookdeckgosdk.GetAttemptsRequest) (*hookdeckgosdk.EventAttemptPaginatedResult, error)
GetAttempt(ctx context.Context, id string) (*hookdeckgosdk.EventAttempt, error)
type Client struct {
baseURL string
httpClient core.HTTPClient
header http.Header
}

func NewClient(opts ...core.ClientOption) Client {
func NewClient(opts ...core.ClientOption) *Client {
options := core.NewClientOptions()
for _, opt := range opts {
opt(options)
}
return &client{
return &Client{
baseURL: options.BaseURL,
httpClient: options.HTTPClient,
header: options.ToHeader(),
}
}

type client struct {
baseURL string
httpClient core.HTTPClient
header http.Header
}

func (c *client) GetAttempts(ctx context.Context, request *hookdeckgosdk.GetAttemptsRequest) (*hookdeckgosdk.EventAttemptPaginatedResult, error) {
func (c *Client) GetAttempts(ctx context.Context, request *hookdeckgosdk.GetAttemptsRequest) (*hookdeckgosdk.EventAttemptPaginatedResult, error) {
baseURL := "https://api.hookdeck.com/2023-07-01"
if c.baseURL != "" {
baseURL = c.baseURL
Expand Down Expand Up @@ -80,14 +75,14 @@ func (c *client) GetAttempts(ctx context.Context, request *hookdeckgosdk.GetAtte
value := new(hookdeckgosdk.BadRequestError)
value.APIError = apiError
if err := decoder.Decode(value); err != nil {
return err
return apiError
}
return value
case 422:
value := new(hookdeckgosdk.UnprocessableEntityError)
value.APIError = apiError
if err := decoder.Decode(value); err != nil {
return err
return apiError
}
return value
}
Expand All @@ -111,7 +106,7 @@ func (c *client) GetAttempts(ctx context.Context, request *hookdeckgosdk.GetAtte
return response, nil
}

func (c *client) GetAttempt(ctx context.Context, id string) (*hookdeckgosdk.EventAttempt, error) {
func (c *Client) GetAttempt(ctx context.Context, id string) (*hookdeckgosdk.EventAttempt, error) {
baseURL := "https://api.hookdeck.com/2023-07-01"
if c.baseURL != "" {
baseURL = c.baseURL
Expand All @@ -130,7 +125,7 @@ func (c *client) GetAttempt(ctx context.Context, id string) (*hookdeckgosdk.Even
value := new(hookdeckgosdk.NotFoundError)
value.APIError = apiError
if err := decoder.Decode(value); err != nil {
return err
return apiError
}
return value
}
Expand Down
13 changes: 7 additions & 6 deletions bookmarks.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package api

import (
core "github.com/hookdeck/hookdeck-go-sdk/core"
time "time"
)

Expand All @@ -14,7 +15,7 @@ type CreateBookmarkRequest struct {
// Descriptive name of the bookmark <span style="white-space: nowrap">`<= 255 characters`</span>
Label string `json:"label"`
// A unique, human-friendly name for the bookmark <span style="white-space: nowrap">`<= 155 characters`</span>
Name *string `json:"name,omitempty"`
Name *core.Optional[string] `json:"name,omitempty"`
}

type GetBookmarksRequest struct {
Expand All @@ -33,16 +34,16 @@ type GetBookmarksRequest struct {

type TriggerBookmarkRequest struct {
// Bookmark target
Target *TriggerBookmarkRequestTarget `json:"target,omitempty"`
Target *core.Optional[TriggerBookmarkRequestTarget] `json:"target,omitempty"`
}

type UpdateBookmarkRequest struct {
// ID of the event data to bookmark <span style="white-space: nowrap">`<= 255 characters`</span>
EventDataId *string `json:"event_data_id,omitempty"`
EventDataId *core.Optional[string] `json:"event_data_id,omitempty"`
// ID of the associated connection <span style="white-space: nowrap">`<= 255 characters`</span>
WebhookId *string `json:"webhook_id,omitempty"`
WebhookId *core.Optional[string] `json:"webhook_id,omitempty"`
// Descriptive name of the bookmark <span style="white-space: nowrap">`<= 255 characters`</span>
Label *string `json:"label,omitempty"`
Label *core.Optional[string] `json:"label,omitempty"`
// A unique, human-friendly name for the bookmark <span style="white-space: nowrap">`<= 155 characters`</span>
Name *string `json:"name,omitempty"`
Name *core.Optional[string] `json:"name,omitempty"`
}
57 changes: 24 additions & 33 deletions bookmarks/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,25 @@ import (
time "time"
)

type Client interface {
GetBookmarks(ctx context.Context, request *hookdeckgosdk.GetBookmarksRequest) (*hookdeckgosdk.BookmarkPaginatedResult, error)
CreateBookmark(ctx context.Context, request *hookdeckgosdk.CreateBookmarkRequest) (*hookdeckgosdk.Bookmark, error)
GetBookmark(ctx context.Context, id string) (*hookdeckgosdk.Bookmark, error)
UpdateBookmark(ctx context.Context, id string, request *hookdeckgosdk.UpdateBookmarkRequest) (*hookdeckgosdk.Bookmark, error)
DeleteBookmark(ctx context.Context, id string) (*hookdeckgosdk.DeletedBookmarkResponse, error)
TriggerBookmark(ctx context.Context, id string, request *hookdeckgosdk.TriggerBookmarkRequest) (hookdeckgosdk.EventArray, error)
type Client struct {
baseURL string
httpClient core.HTTPClient
header http.Header
}

func NewClient(opts ...core.ClientOption) Client {
func NewClient(opts ...core.ClientOption) *Client {
options := core.NewClientOptions()
for _, opt := range opts {
opt(options)
}
return &client{
return &Client{
baseURL: options.BaseURL,
httpClient: options.HTTPClient,
header: options.ToHeader(),
}
}

type client struct {
baseURL string
httpClient core.HTTPClient
header http.Header
}

func (c *client) GetBookmarks(ctx context.Context, request *hookdeckgosdk.GetBookmarksRequest) (*hookdeckgosdk.BookmarkPaginatedResult, error) {
func (c *Client) GetBookmarks(ctx context.Context, request *hookdeckgosdk.GetBookmarksRequest) (*hookdeckgosdk.BookmarkPaginatedResult, error) {
baseURL := "https://api.hookdeck.com/2023-07-01"
if c.baseURL != "" {
baseURL = c.baseURL
Expand Down Expand Up @@ -100,14 +91,14 @@ func (c *client) GetBookmarks(ctx context.Context, request *hookdeckgosdk.GetBoo
value := new(hookdeckgosdk.BadRequestError)
value.APIError = apiError
if err := decoder.Decode(value); err != nil {
return err
return apiError
}
return value
case 422:
value := new(hookdeckgosdk.UnprocessableEntityError)
value.APIError = apiError
if err := decoder.Decode(value); err != nil {
return err
return apiError
}
return value
}
Expand All @@ -131,7 +122,7 @@ func (c *client) GetBookmarks(ctx context.Context, request *hookdeckgosdk.GetBoo
return response, nil
}

func (c *client) CreateBookmark(ctx context.Context, request *hookdeckgosdk.CreateBookmarkRequest) (*hookdeckgosdk.Bookmark, error) {
func (c *Client) CreateBookmark(ctx context.Context, request *hookdeckgosdk.CreateBookmarkRequest) (*hookdeckgosdk.Bookmark, error) {
baseURL := "https://api.hookdeck.com/2023-07-01"
if c.baseURL != "" {
baseURL = c.baseURL
Expand All @@ -150,14 +141,14 @@ func (c *client) CreateBookmark(ctx context.Context, request *hookdeckgosdk.Crea
value := new(hookdeckgosdk.BadRequestError)
value.APIError = apiError
if err := decoder.Decode(value); err != nil {
return err
return apiError
}
return value
case 422:
value := new(hookdeckgosdk.UnprocessableEntityError)
value.APIError = apiError
if err := decoder.Decode(value); err != nil {
return err
return apiError
}
return value
}
Expand All @@ -181,7 +172,7 @@ func (c *client) CreateBookmark(ctx context.Context, request *hookdeckgosdk.Crea
return response, nil
}

func (c *client) GetBookmark(ctx context.Context, id string) (*hookdeckgosdk.Bookmark, error) {
func (c *Client) GetBookmark(ctx context.Context, id string) (*hookdeckgosdk.Bookmark, error) {
baseURL := "https://api.hookdeck.com/2023-07-01"
if c.baseURL != "" {
baseURL = c.baseURL
Expand All @@ -200,7 +191,7 @@ func (c *client) GetBookmark(ctx context.Context, id string) (*hookdeckgosdk.Boo
value := new(hookdeckgosdk.NotFoundError)
value.APIError = apiError
if err := decoder.Decode(value); err != nil {
return err
return apiError
}
return value
}
Expand All @@ -224,7 +215,7 @@ func (c *client) GetBookmark(ctx context.Context, id string) (*hookdeckgosdk.Boo
return response, nil
}

func (c *client) UpdateBookmark(ctx context.Context, id string, request *hookdeckgosdk.UpdateBookmarkRequest) (*hookdeckgosdk.Bookmark, error) {
func (c *Client) UpdateBookmark(ctx context.Context, id string, request *hookdeckgosdk.UpdateBookmarkRequest) (*hookdeckgosdk.Bookmark, error) {
baseURL := "https://api.hookdeck.com/2023-07-01"
if c.baseURL != "" {
baseURL = c.baseURL
Expand All @@ -243,21 +234,21 @@ func (c *client) UpdateBookmark(ctx context.Context, id string, request *hookdec
value := new(hookdeckgosdk.BadRequestError)
value.APIError = apiError
if err := decoder.Decode(value); err != nil {
return err
return apiError
}
return value
case 404:
value := new(hookdeckgosdk.NotFoundError)
value.APIError = apiError
if err := decoder.Decode(value); err != nil {
return err
return apiError
}
return value
case 422:
value := new(hookdeckgosdk.UnprocessableEntityError)
value.APIError = apiError
if err := decoder.Decode(value); err != nil {
return err
return apiError
}
return value
}
Expand All @@ -281,7 +272,7 @@ func (c *client) UpdateBookmark(ctx context.Context, id string, request *hookdec
return response, nil
}

func (c *client) DeleteBookmark(ctx context.Context, id string) (*hookdeckgosdk.DeletedBookmarkResponse, error) {
func (c *Client) DeleteBookmark(ctx context.Context, id string) (*hookdeckgosdk.DeletedBookmarkResponse, error) {
baseURL := "https://api.hookdeck.com/2023-07-01"
if c.baseURL != "" {
baseURL = c.baseURL
Expand All @@ -300,7 +291,7 @@ func (c *client) DeleteBookmark(ctx context.Context, id string) (*hookdeckgosdk.
value := new(hookdeckgosdk.NotFoundError)
value.APIError = apiError
if err := decoder.Decode(value); err != nil {
return err
return apiError
}
return value
}
Expand All @@ -324,7 +315,7 @@ func (c *client) DeleteBookmark(ctx context.Context, id string) (*hookdeckgosdk.
return response, nil
}

func (c *client) TriggerBookmark(ctx context.Context, id string, request *hookdeckgosdk.TriggerBookmarkRequest) (hookdeckgosdk.EventArray, error) {
func (c *Client) TriggerBookmark(ctx context.Context, id string, request *hookdeckgosdk.TriggerBookmarkRequest) (hookdeckgosdk.EventArray, error) {
baseURL := "https://api.hookdeck.com/2023-07-01"
if c.baseURL != "" {
baseURL = c.baseURL
Expand All @@ -343,21 +334,21 @@ func (c *client) TriggerBookmark(ctx context.Context, id string, request *hookde
value := new(hookdeckgosdk.BadRequestError)
value.APIError = apiError
if err := decoder.Decode(value); err != nil {
return err
return apiError
}
return value
case 404:
value := new(hookdeckgosdk.NotFoundError)
value.APIError = apiError
if err := decoder.Decode(value); err != nil {
return err
return apiError
}
return value
case 422:
value := new(hookdeckgosdk.UnprocessableEntityError)
value.APIError = apiError
if err := decoder.Decode(value); err != nil {
return err
return apiError
}
return value
}
Expand Down
3 changes: 2 additions & 1 deletion bulk_retry_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
package api

import (
core "github.com/hookdeck/hookdeck-go-sdk/core"
time "time"
)

type CreateEventBulkRetryRequest struct {
// Filter properties for the events to be included in the bulk retry
Query *CreateEventBulkRetryRequestQuery `json:"query,omitempty"`
Query *core.Optional[CreateEventBulkRetryRequestQuery] `json:"query,omitempty"`
}

type GetEventBulkRetriesRequest struct {
Expand Down
3 changes: 2 additions & 1 deletion bulk_retry_ignored_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
package api

import (
core "github.com/hookdeck/hookdeck-go-sdk/core"
time "time"
)

type CreateIgnoredEventBulkRetryRequest struct {
// Filter by the bulk retry ignored event query object
Query *CreateIgnoredEventBulkRetryRequestQuery `json:"query,omitempty"`
Query *core.Optional[CreateIgnoredEventBulkRetryRequestQuery] `json:"query,omitempty"`
}

type GetIgnoredEventBulkRetriesRequest struct {
Expand Down
3 changes: 2 additions & 1 deletion bulk_retry_requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
package api

import (
core "github.com/hookdeck/hookdeck-go-sdk/core"
time "time"
)

type CreateRequestBulkRetryRequest struct {
// Filter properties for the events to be included in the bulk retry, use query parameters of [Requests](#requests)
Query *CreateRequestBulkRetryRequestQuery `json:"query,omitempty"`
Query *core.Optional[CreateRequestBulkRetryRequestQuery] `json:"query,omitempty"`
}

type GetRequestBulkRetriesRequest struct {
Expand Down
Loading

0 comments on commit e3110b9

Please sign in to comment.