github.com/goharbor/go-client@v0.210.0/pkg/sdk/v2.0/client/auditlog/auditlog_client.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package auditlog 4 5 // This file was generated by the swagger tool. 6 // Editing this file might prove futile when you re-run the swagger generate command 7 8 import ( 9 "context" 10 11 "github.com/go-openapi/runtime" 12 13 strfmt "github.com/go-openapi/strfmt" 14 ) 15 16 //go:generate mockery -name API -inpkg 17 18 // API is the interface of the auditlog client 19 type API interface { 20 /* 21 ListAuditLogs gets recent logs of the projects which the user is a member of 22 23 This endpoint let user see the recent operation logs of the projects which he is member of 24 */ 25 ListAuditLogs(ctx context.Context, params *ListAuditLogsParams) (*ListAuditLogsOK, error) 26 } 27 28 // New creates a new auditlog API client. 29 func New(transport runtime.ClientTransport, formats strfmt.Registry, authInfo runtime.ClientAuthInfoWriter) *Client { 30 return &Client{ 31 transport: transport, 32 formats: formats, 33 authInfo: authInfo, 34 } 35 } 36 37 /* 38 Client for auditlog API 39 */ 40 type Client struct { 41 transport runtime.ClientTransport 42 formats strfmt.Registry 43 authInfo runtime.ClientAuthInfoWriter 44 } 45 46 /* 47 ListAuditLogs gets recent logs of the projects which the user is a member of 48 49 This endpoint let user see the recent operation logs of the projects which he is member of 50 */ 51 func (a *Client) ListAuditLogs(ctx context.Context, params *ListAuditLogsParams) (*ListAuditLogsOK, error) { 52 53 result, err := a.transport.Submit(&runtime.ClientOperation{ 54 ID: "listAuditLogs", 55 Method: "GET", 56 PathPattern: "/audit-logs", 57 ProducesMediaTypes: []string{"application/json"}, 58 ConsumesMediaTypes: []string{"application/json"}, 59 Schemes: []string{"http", "https"}, 60 Params: params, 61 Reader: &ListAuditLogsReader{formats: a.formats}, 62 AuthInfo: a.authInfo, 63 Context: ctx, 64 Client: params.HTTPClient, 65 }) 66 if err != nil { 67 return nil, err 68 } 69 return result.(*ListAuditLogsOK), nil 70 71 }