Skip to content

Latest commit

 

History

History
executable file
·
79 lines (61 loc) · 3 KB

README.md

File metadata and controls

executable file
·
79 lines (61 loc) · 3 KB

Rulesets

Overview

A ruleset defines a group of rules that can be used across many connections.

Available Operations

  • Get - Get rulesets

Get

Get rulesets

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.Rulesets.Get(ctx, operations.GetRulesetsRequest{
        Archived: hookdeck.Bool(false),
        ArchivedAt: &operations.GetRulesetsArchivedAt{},
        Dir: &operations.GetRulesetsDir{},
        ID: &operations.GetRulesetsID{},
        Limit: hookdeck.Int64(311796),
        Name: &operations.GetRulesetsName2{
            Any: hookdeck.Bool(false),
            Contains: &operations.GetRulesetsName2Contains{},
            Gt: &operations.GetRulesetsName2Gt{},
            Gte: &operations.GetRulesetsName2Gte{},
            Le: &operations.GetRulesetsName2Le{},
            Lte: &operations.GetRulesetsName2Lte{},
        },
        Next: hookdeck.String("quidem"),
        OrderBy: &operations.GetRulesetsOrderBy{},
        Prev: hookdeck.String("voluptatibus"),
    })
    if err != nil {
        log.Fatal(err)
    }

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

Parameters

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

Response

*operations.GetRulesetsResponse, error