- Create - Create a Bookmark
- Delete - Delete a Bookmark
- Get - Get a Single Bookmark
- Trigger - Trigger a Bookmark
- Update - Update a Bookmark
Create a new bookmark.
package main
import(
"context"
"log"
"github.com/speakeasy-sdks/hookdeck-go"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/shared"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/operations"
)
func main() {
s := hookdeck.New(
hookdeck.WithSecurity(shared.Security{
BasicAuth: &shared.SchemeBasicAuth{
Password: "",
Username: "",
},
}),
)
ctx := context.Background()
res, err := s.Bookmark.Create(ctx, operations.CreateBookmarkRequestBody{
EventDataID: "nulla",
Label: "corrupti",
Name: hookdeck.String("Ben Mueller"),
WebhookID: "iure",
})
if err != nil {
log.Fatal(err)
}
if res.Bookmark != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.CreateBookmarkRequestBody | ✔️ | The request object to use for the request. |
*operations.CreateBookmarkResponse, error
Delete an existing bookmark
package main
import(
"context"
"log"
"github.com/speakeasy-sdks/hookdeck-go"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/shared"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/operations"
)
func main() {
s := hookdeck.New(
hookdeck.WithSecurity(shared.Security{
BasicAuth: &shared.SchemeBasicAuth{
Password: "",
Username: "",
},
}),
)
id := "magnam"
ctx := context.Background()
res, err := s.Bookmark.Delete(ctx, id)
if err != nil {
log.Fatal(err)
}
if res.DeletedBookmarkResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
id |
string | ✔️ | N/A |
*operations.DeleteBookmarkResponse, error
Retrieve an existing bookmark details.
package main
import(
"context"
"log"
"github.com/speakeasy-sdks/hookdeck-go"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/shared"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/operations"
)
func main() {
s := hookdeck.New(
hookdeck.WithSecurity(shared.Security{
BasicAuth: &shared.SchemeBasicAuth{
Password: "",
Username: "",
},
}),
)
id := "debitis"
ctx := context.Background()
res, err := s.Bookmark.Get(ctx, id)
if err != nil {
log.Fatal(err)
}
if res.Bookmark != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
id |
string | ✔️ | N/A |
*operations.GetBookmarkResponse, error
Trigger a bookmark operation to store and replay a specific request.
package main
import(
"context"
"log"
"github.com/speakeasy-sdks/hookdeck-go"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/shared"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/operations"
)
func main() {
s := hookdeck.New(
hookdeck.WithSecurity(shared.Security{
BasicAuth: &shared.SchemeBasicAuth{
Password: "",
Username: "",
},
}),
)
requestBody := operations.TriggerBookmarkRequestBody{
Target: operations.TriggerBookmarkRequestBodyTargetHTTP.ToPointer(),
}
id := "delectus"
ctx := context.Background()
res, err := s.Bookmark.Trigger(ctx, requestBody, id)
if err != nil {
log.Fatal(err)
}
if res.EventArray != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
requestBody |
operations.TriggerBookmarkRequestBody | ✔️ | N/A |
id |
string | ✔️ | N/A |
*operations.TriggerBookmarkResponse, error
Update an existing bookmark information.
package main
import(
"context"
"log"
"github.com/speakeasy-sdks/hookdeck-go"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/shared"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/operations"
)
func main() {
s := hookdeck.New(
hookdeck.WithSecurity(shared.Security{
BasicAuth: &shared.SchemeBasicAuth{
Password: "",
Username: "",
},
}),
)
requestBody := operations.UpdateBookmarkRequestBody{
EventDataID: hookdeck.String("tempora"),
Label: hookdeck.String("suscipit"),
Name: hookdeck.String("Alexandra Schulist"),
WebhookID: hookdeck.String("excepturi"),
}
id := "nisi"
ctx := context.Background()
res, err := s.Bookmark.Update(ctx, requestBody, id)
if err != nil {
log.Fatal(err)
}
if res.Bookmark != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
requestBody |
operations.UpdateBookmarkRequestBody | ✔️ | N/A |
id |
string | ✔️ | N/A |