Skip to content

Latest commit

 

History

History
executable file
·
166 lines (122 loc) · 5.33 KB

README.md

File metadata and controls

executable file
·
166 lines (122 loc) · 5.33 KB

Event

Available Operations

Get

Retrieve a request that Hookdeck receives from a source.

Example Usage

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 := "nam"

    ctx := context.Background()
    res, err := s.Event.Get(ctx, id)
    if err != nil {
        log.Fatal(err)
    }

    if res.Event != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
id string ✔️ N/A

Response

*operations.GetEventResponse, error

MuteEvent

Mute a request that Hookdeck receives from a specific source.

Example Usage

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 := "id"

    ctx := context.Background()
    res, err := s.Event.MuteEvent(ctx, id)
    if err != nil {
        log.Fatal(err)
    }

    if res.Event != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
id string ✔️ N/A

Response

*operations.MuteEventResponse, error

Retry

Retry the operation to retrieve a request that Hookdeck receives from a specific source.

Example Usage

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 := "blanditiis"

    ctx := context.Background()
    res, err := s.Event.Retry(ctx, id)
    if err != nil {
        log.Fatal(err)
    }

    if res.RetriedEvent != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
id string ✔️ N/A

Response

*operations.RetryEventResponse, error