Skip to content

Latest commit

 

History

History
86 lines (66 loc) · 5.35 KB

README.md

File metadata and controls

86 lines (66 loc) · 5.35 KB

EventLogs

(Webhook.EventLogs)

Overview

Available Operations

  • List - List event logs

List

List event logs

Example Usage

package main

import(
	"context"
	"os"
	sdkgo "github.com/apideck-libraries/sdk-go"
	"github.com/apideck-libraries/sdk-go/models/components"
	"log"
)

func main() {
    ctx := context.Background()
    
    s := sdkgo.New(
        sdkgo.WithSecurity(os.Getenv("APIDECK_API_KEY")),
        sdkgo.WithConsumerID("test-consumer"),
        sdkgo.WithAppID("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"),
    )

    res, err := s.Webhook.EventLogs.List(ctx, nil, nil, &components.WebhookEventLogsFilter{
        ExcludeApis: sdkgo.String("vault,proxy"),
        ConsumerID: sdkgo.String("test_user_id"),
        EntityType: sdkgo.String("Connection"),
        EventType: sdkgo.String("vault.connection.callable"),
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.GetWebhookEventLogsResponse != nil {
        for {
            // handle items

            res, err = res.Next()

            if err != nil {
                // handle error
            }

            if res == nil {
                break
            }
        }
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
cursor *string Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response.
limit *int64 Number of results to return. Minimum 1, Maximum 200, Default 20
filter *components.WebhookEventLogsFilter Filter results
opts []operations.Option The options for this request.

Response

*operations.WebhookEventLogsAllResponse, error

Errors

Error Type Status Code Content Type
apierrors.BadRequestResponse 400 application/json
apierrors.UnauthorizedResponse 401 application/json
apierrors.PaymentRequiredResponse 402 application/json
apierrors.NotFoundResponse 404 application/json
apierrors.UnprocessableResponse 422 application/json
apierrors.APIError 4XX, 5XX */*