A ruleset defines a group of rules that can be used across many connections.
- Get - Get rulesets
Get rulesets
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
}
}
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. |