github.com/goharbor/go-client@v0.210.0/pkg/sdk/v2.0/client/robot/delete_robot_parameters.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package robot 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 "net/http" 11 "time" 12 13 "github.com/go-openapi/errors" 14 "github.com/go-openapi/runtime" 15 cr "github.com/go-openapi/runtime/client" 16 "github.com/go-openapi/strfmt" 17 "github.com/go-openapi/swag" 18 ) 19 20 // NewDeleteRobotParams creates a new DeleteRobotParams object, 21 // with the default timeout for this client. 22 // 23 // Default values are not hydrated, since defaults are normally applied by the API server side. 24 // 25 // To enforce default values in parameter, use SetDefaults or WithDefaults. 26 func NewDeleteRobotParams() *DeleteRobotParams { 27 return &DeleteRobotParams{ 28 timeout: cr.DefaultTimeout, 29 } 30 } 31 32 // NewDeleteRobotParamsWithTimeout creates a new DeleteRobotParams object 33 // with the ability to set a timeout on a request. 34 func NewDeleteRobotParamsWithTimeout(timeout time.Duration) *DeleteRobotParams { 35 return &DeleteRobotParams{ 36 timeout: timeout, 37 } 38 } 39 40 // NewDeleteRobotParamsWithContext creates a new DeleteRobotParams object 41 // with the ability to set a context for a request. 42 func NewDeleteRobotParamsWithContext(ctx context.Context) *DeleteRobotParams { 43 return &DeleteRobotParams{ 44 Context: ctx, 45 } 46 } 47 48 // NewDeleteRobotParamsWithHTTPClient creates a new DeleteRobotParams object 49 // with the ability to set a custom HTTPClient for a request. 50 func NewDeleteRobotParamsWithHTTPClient(client *http.Client) *DeleteRobotParams { 51 return &DeleteRobotParams{ 52 HTTPClient: client, 53 } 54 } 55 56 /* 57 DeleteRobotParams contains all the parameters to send to the API endpoint 58 59 for the delete robot operation. 60 61 Typically these are written to a http.Request. 62 */ 63 type DeleteRobotParams struct { 64 65 /* XRequestID. 66 67 An unique ID for the request 68 */ 69 XRequestID *string 70 71 /* RobotID. 72 73 Robot ID 74 */ 75 RobotID int64 76 77 timeout time.Duration 78 Context context.Context 79 HTTPClient *http.Client 80 } 81 82 // WithDefaults hydrates default values in the delete robot params (not the query body). 83 // 84 // All values with no default are reset to their zero value. 85 func (o *DeleteRobotParams) WithDefaults() *DeleteRobotParams { 86 o.SetDefaults() 87 return o 88 } 89 90 // SetDefaults hydrates default values in the delete robot params (not the query body). 91 // 92 // All values with no default are reset to their zero value. 93 func (o *DeleteRobotParams) SetDefaults() { 94 // no default values defined for this parameter 95 } 96 97 // WithTimeout adds the timeout to the delete robot params 98 func (o *DeleteRobotParams) WithTimeout(timeout time.Duration) *DeleteRobotParams { 99 o.SetTimeout(timeout) 100 return o 101 } 102 103 // SetTimeout adds the timeout to the delete robot params 104 func (o *DeleteRobotParams) SetTimeout(timeout time.Duration) { 105 o.timeout = timeout 106 } 107 108 // WithContext adds the context to the delete robot params 109 func (o *DeleteRobotParams) WithContext(ctx context.Context) *DeleteRobotParams { 110 o.SetContext(ctx) 111 return o 112 } 113 114 // SetContext adds the context to the delete robot params 115 func (o *DeleteRobotParams) SetContext(ctx context.Context) { 116 o.Context = ctx 117 } 118 119 // WithHTTPClient adds the HTTPClient to the delete robot params 120 func (o *DeleteRobotParams) WithHTTPClient(client *http.Client) *DeleteRobotParams { 121 o.SetHTTPClient(client) 122 return o 123 } 124 125 // SetHTTPClient adds the HTTPClient to the delete robot params 126 func (o *DeleteRobotParams) SetHTTPClient(client *http.Client) { 127 o.HTTPClient = client 128 } 129 130 // WithXRequestID adds the xRequestID to the delete robot params 131 func (o *DeleteRobotParams) WithXRequestID(xRequestID *string) *DeleteRobotParams { 132 o.SetXRequestID(xRequestID) 133 return o 134 } 135 136 // SetXRequestID adds the xRequestId to the delete robot params 137 func (o *DeleteRobotParams) SetXRequestID(xRequestID *string) { 138 o.XRequestID = xRequestID 139 } 140 141 // WithRobotID adds the robotID to the delete robot params 142 func (o *DeleteRobotParams) WithRobotID(robotID int64) *DeleteRobotParams { 143 o.SetRobotID(robotID) 144 return o 145 } 146 147 // SetRobotID adds the robotId to the delete robot params 148 func (o *DeleteRobotParams) SetRobotID(robotID int64) { 149 o.RobotID = robotID 150 } 151 152 // WriteToRequest writes these params to a swagger request 153 func (o *DeleteRobotParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 154 155 if err := r.SetTimeout(o.timeout); err != nil { 156 return err 157 } 158 var res []error 159 160 if o.XRequestID != nil { 161 162 // header param X-Request-Id 163 if err := r.SetHeaderParam("X-Request-Id", *o.XRequestID); err != nil { 164 return err 165 } 166 } 167 168 // path param robot_id 169 if err := r.SetPathParam("robot_id", swag.FormatInt64(o.RobotID)); err != nil { 170 return err 171 } 172 173 if len(res) > 0 { 174 return errors.CompositeValidationError(res...) 175 } 176 return nil 177 }