github.com/goharbor/go-client@v0.210.0/pkg/sdk/v2.0/client/schedule/schedule_client.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package schedule 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 schedule client 19 type API interface { 20 /* 21 GetSchedulePaused Get scheduler paused status*/ 22 GetSchedulePaused(ctx context.Context, params *GetSchedulePausedParams) (*GetSchedulePausedOK, error) 23 /* 24 ListSchedules List schedules*/ 25 ListSchedules(ctx context.Context, params *ListSchedulesParams) (*ListSchedulesOK, error) 26 } 27 28 // New creates a new schedule 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 schedule API 39 */ 40 type Client struct { 41 transport runtime.ClientTransport 42 formats strfmt.Registry 43 authInfo runtime.ClientAuthInfoWriter 44 } 45 46 /* 47 GetSchedulePaused Get scheduler paused status 48 */ 49 func (a *Client) GetSchedulePaused(ctx context.Context, params *GetSchedulePausedParams) (*GetSchedulePausedOK, error) { 50 51 result, err := a.transport.Submit(&runtime.ClientOperation{ 52 ID: "getSchedulePaused", 53 Method: "GET", 54 PathPattern: "/schedules/{job_type}/paused", 55 ProducesMediaTypes: []string{"application/json"}, 56 ConsumesMediaTypes: []string{"application/json"}, 57 Schemes: []string{"http", "https"}, 58 Params: params, 59 Reader: &GetSchedulePausedReader{formats: a.formats}, 60 AuthInfo: a.authInfo, 61 Context: ctx, 62 Client: params.HTTPClient, 63 }) 64 if err != nil { 65 return nil, err 66 } 67 return result.(*GetSchedulePausedOK), nil 68 69 } 70 71 /* 72 ListSchedules List schedules 73 */ 74 func (a *Client) ListSchedules(ctx context.Context, params *ListSchedulesParams) (*ListSchedulesOK, error) { 75 76 result, err := a.transport.Submit(&runtime.ClientOperation{ 77 ID: "listSchedules", 78 Method: "GET", 79 PathPattern: "/schedules", 80 ProducesMediaTypes: []string{"application/json"}, 81 ConsumesMediaTypes: []string{"application/json"}, 82 Schemes: []string{"http", "https"}, 83 Params: params, 84 Reader: &ListSchedulesReader{formats: a.formats}, 85 AuthInfo: a.authInfo, 86 Context: ctx, 87 Client: params.HTTPClient, 88 }) 89 if err != nil { 90 return nil, err 91 } 92 return result.(*ListSchedulesOK), nil 93 94 }