Skip to content

Latest commit

 

History

History
91 lines (71 loc) · 4.47 KB

File metadata and controls

91 lines (71 loc) · 4.47 KB

AuditLogs

Overview

Available Operations

  • List - List audit log entries

List

Returns a list of activity by dashboard users.

Example Usage

package main

import(
	"context"
	"os"
	gr4vygo "github.com/gr4vy/gr4vy-go"
	"github.com/gr4vy/gr4vy-go/models/components"
	"github.com/gr4vy/gr4vy-go/models/operations"
	"log"
)

func main() {
    ctx := context.Background()

    s := gr4vygo.New(
        gr4vygo.WithMerchantAccountID("default"),
        gr4vygo.WithSecurity(os.Getenv("GR4VY_BEARER_AUTH")),
    )

    res, err := s.AuditLogs.List(ctx, operations.ListAuditLogsRequest{
        Cursor: gr4vygo.Pointer("ZXhhbXBsZTE"),
        Action: components.AuditLogActionCreated.ToPointer(),
        UserID: gr4vygo.Pointer("14b7b8c5-a6ba-4fb6-bbab-52d43c7f37ef"),
        ResourceType: gr4vygo.Pointer("user"),
    })
    if err != nil {
        log.Fatal(err)
    }
    if res != 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.
request operations.ListAuditLogsRequest ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.ListAuditLogsResponse, error

Errors

Error Type Status Code Content Type
apierrors.Error400 400 application/json
apierrors.Error401 401 application/json
apierrors.Error403 403 application/json
apierrors.Error404 404 application/json
apierrors.Error405 405 application/json
apierrors.Error409 409 application/json
apierrors.HTTPValidationError 422 application/json
apierrors.Error425 425 application/json
apierrors.Error429 429 application/json
apierrors.Error500 500 application/json
apierrors.Error502 502 application/json
apierrors.Error504 504 application/json
apierrors.APIError 4XX, 5XX */*