github.com/goharbor/go-client@v0.210.0/pkg/sdk/v2.0/client/webhookjob/webhookjob_client.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package webhookjob 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 webhookjob client 19 type API interface { 20 /* 21 ListWebhookJobs lists project webhook jobs 22 23 This endpoint returns webhook jobs of a project. 24 */ 25 ListWebhookJobs(ctx context.Context, params *ListWebhookJobsParams) (*ListWebhookJobsOK, error) 26 } 27 28 // New creates a new webhookjob 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 webhookjob API 39 */ 40 type Client struct { 41 transport runtime.ClientTransport 42 formats strfmt.Registry 43 authInfo runtime.ClientAuthInfoWriter 44 } 45 46 /* 47 ListWebhookJobs lists project webhook jobs 48 49 This endpoint returns webhook jobs of a project. 50 */ 51 func (a *Client) ListWebhookJobs(ctx context.Context, params *ListWebhookJobsParams) (*ListWebhookJobsOK, error) { 52 53 result, err := a.transport.Submit(&runtime.ClientOperation{ 54 ID: "ListWebhookJobs", 55 Method: "GET", 56 PathPattern: "/projects/{project_name_or_id}/webhook/jobs", 57 ProducesMediaTypes: []string{"application/json"}, 58 ConsumesMediaTypes: []string{"application/json"}, 59 Schemes: []string{"http", "https"}, 60 Params: params, 61 Reader: &ListWebhookJobsReader{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.(*ListWebhookJobsOK), nil 70 71 }