This commit is contained in:
2024-04-16 14:26:06 +03:00
parent bc264c4d90
commit e7c968797b
298 changed files with 11066 additions and 398 deletions

View File

@@ -12,6 +12,22 @@ type GetAuditRequest struct {
// Required: false
Username string `url:"username,omitempty" json:"username,omitempty"`
// Find by api call.
// Required: false
Call string `url:"call,omitempty" json:"call,omitempty"`
// Find by HTTP status code
// Required: false
StatusCode uint64 `url:"statuscode,omitempty" json:"statuscode,omitempty"`
// Find all audits after point in time (unixtime)
// Required: false
TimestampAt uint64 `url:"timestampAt,omitempty" json:"timestampAt,omitempty"`
// Find all audits before point in time (unixtime)
// Required: false
TimestampTo uint64 `url:"timestampTo,omitempty" json:"timestampTo,omitempty"`
// Page number.
// Required: false
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
@@ -27,14 +43,14 @@ func (u User) GetAudit(ctx context.Context, req GetAuditRequest) (ListAudits, er
res, err := u.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return nil, err
return ListAudits{}, err
}
list := ListAudits{}
err = json.Unmarshal(res, &list)
if err != nil {
return nil, err
return ListAudits{}, err
}
return list, nil