Skip to content

Latest commit

 

History

History
executable file
·
73 lines (55 loc) · 2.93 KB

README.md

File metadata and controls

executable file
·
73 lines (55 loc) · 2.93 KB

Connections

Overview

A connection lets you route webhooks from a source to a destination, using a ruleset.

Available Operations

  • Get - Get connections

Get

Get connections

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"
	"github.com/speakeasy-sdks/hookdeck-go/pkg/types"
)

func main() {
    s := hookdeck.New(
        hookdeck.WithSecurity(shared.Security{
            BasicAuth: &shared.SchemeBasicAuth{
                Password: "",
                Username: "",
            },
        }),
    )

    ctx := context.Background()
    res, err := s.Connections.Get(ctx, operations.GetConnectionsRequest{
        Archived: hookdeck.Bool(false),
        ArchivedAt: &operations.GetConnectionsArchivedAt{},
        DestinationID: &operations.GetConnectionsDestinationID{},
        Dir: &operations.GetConnectionsDir{},
        FullName: hookdeck.String("deserunt"),
        ID: &operations.GetConnectionsID{},
        Name: &operations.GetConnectionsName{},
        OrderBy: &operations.GetConnectionsOrderBy{},
        PausedAt: &operations.GetConnectionsPausedAt{},
        SourceID: &operations.GetConnectionsSourceID{},
    })
    if err != nil {
        log.Fatal(err)
    }

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

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.GetConnectionsRequest ✔️ The request object to use for the request.

Response

*operations.GetConnectionsResponse, error