github.com/goharbor/go-client@v0.210.0/pkg/sdk/v2.0/client/robotv1/delete_robot_v1_parameters.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package robotv1 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 // NewDeleteRobotV1Params creates a new DeleteRobotV1Params 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 NewDeleteRobotV1Params() *DeleteRobotV1Params { 27 return &DeleteRobotV1Params{ 28 timeout: cr.DefaultTimeout, 29 } 30 } 31 32 // NewDeleteRobotV1ParamsWithTimeout creates a new DeleteRobotV1Params object 33 // with the ability to set a timeout on a request. 34 func NewDeleteRobotV1ParamsWithTimeout(timeout time.Duration) *DeleteRobotV1Params { 35 return &DeleteRobotV1Params{ 36 timeout: timeout, 37 } 38 } 39 40 // NewDeleteRobotV1ParamsWithContext creates a new DeleteRobotV1Params object 41 // with the ability to set a context for a request. 42 func NewDeleteRobotV1ParamsWithContext(ctx context.Context) *DeleteRobotV1Params { 43 return &DeleteRobotV1Params{ 44 Context: ctx, 45 } 46 } 47 48 // NewDeleteRobotV1ParamsWithHTTPClient creates a new DeleteRobotV1Params object 49 // with the ability to set a custom HTTPClient for a request. 50 func NewDeleteRobotV1ParamsWithHTTPClient(client *http.Client) *DeleteRobotV1Params { 51 return &DeleteRobotV1Params{ 52 HTTPClient: client, 53 } 54 } 55 56 /* 57 DeleteRobotV1Params contains all the parameters to send to the API endpoint 58 59 for the delete robot v1 operation. 60 61 Typically these are written to a http.Request. 62 */ 63 type DeleteRobotV1Params struct { 64 65 /* XIsResourceName. 66 67 The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. 68 */ 69 XIsResourceName *bool 70 71 /* XRequestID. 72 73 An unique ID for the request 74 */ 75 XRequestID *string 76 77 /* ProjectNameOrID. 78 79 The name or id of the project 80 */ 81 ProjectNameOrID string 82 83 /* RobotID. 84 85 Robot ID 86 */ 87 RobotID int64 88 89 timeout time.Duration 90 Context context.Context 91 HTTPClient *http.Client 92 } 93 94 // WithDefaults hydrates default values in the delete robot v1 params (not the query body). 95 // 96 // All values with no default are reset to their zero value. 97 func (o *DeleteRobotV1Params) WithDefaults() *DeleteRobotV1Params { 98 o.SetDefaults() 99 return o 100 } 101 102 // SetDefaults hydrates default values in the delete robot v1 params (not the query body). 103 // 104 // All values with no default are reset to their zero value. 105 func (o *DeleteRobotV1Params) SetDefaults() { 106 var ( 107 xIsResourceNameDefault = bool(false) 108 ) 109 110 val := DeleteRobotV1Params{ 111 XIsResourceName: &xIsResourceNameDefault, 112 } 113 114 val.timeout = o.timeout 115 val.Context = o.Context 116 val.HTTPClient = o.HTTPClient 117 *o = val 118 } 119 120 // WithTimeout adds the timeout to the delete robot v1 params 121 func (o *DeleteRobotV1Params) WithTimeout(timeout time.Duration) *DeleteRobotV1Params { 122 o.SetTimeout(timeout) 123 return o 124 } 125 126 // SetTimeout adds the timeout to the delete robot v1 params 127 func (o *DeleteRobotV1Params) SetTimeout(timeout time.Duration) { 128 o.timeout = timeout 129 } 130 131 // WithContext adds the context to the delete robot v1 params 132 func (o *DeleteRobotV1Params) WithContext(ctx context.Context) *DeleteRobotV1Params { 133 o.SetContext(ctx) 134 return o 135 } 136 137 // SetContext adds the context to the delete robot v1 params 138 func (o *DeleteRobotV1Params) SetContext(ctx context.Context) { 139 o.Context = ctx 140 } 141 142 // WithHTTPClient adds the HTTPClient to the delete robot v1 params 143 func (o *DeleteRobotV1Params) WithHTTPClient(client *http.Client) *DeleteRobotV1Params { 144 o.SetHTTPClient(client) 145 return o 146 } 147 148 // SetHTTPClient adds the HTTPClient to the delete robot v1 params 149 func (o *DeleteRobotV1Params) SetHTTPClient(client *http.Client) { 150 o.HTTPClient = client 151 } 152 153 // WithXIsResourceName adds the xIsResourceName to the delete robot v1 params 154 func (o *DeleteRobotV1Params) WithXIsResourceName(xIsResourceName *bool) *DeleteRobotV1Params { 155 o.SetXIsResourceName(xIsResourceName) 156 return o 157 } 158 159 // SetXIsResourceName adds the xIsResourceName to the delete robot v1 params 160 func (o *DeleteRobotV1Params) SetXIsResourceName(xIsResourceName *bool) { 161 o.XIsResourceName = xIsResourceName 162 } 163 164 // WithXRequestID adds the xRequestID to the delete robot v1 params 165 func (o *DeleteRobotV1Params) WithXRequestID(xRequestID *string) *DeleteRobotV1Params { 166 o.SetXRequestID(xRequestID) 167 return o 168 } 169 170 // SetXRequestID adds the xRequestId to the delete robot v1 params 171 func (o *DeleteRobotV1Params) SetXRequestID(xRequestID *string) { 172 o.XRequestID = xRequestID 173 } 174 175 // WithProjectNameOrID adds the projectNameOrID to the delete robot v1 params 176 func (o *DeleteRobotV1Params) WithProjectNameOrID(projectNameOrID string) *DeleteRobotV1Params { 177 o.SetProjectNameOrID(projectNameOrID) 178 return o 179 } 180 181 // SetProjectNameOrID adds the projectNameOrId to the delete robot v1 params 182 func (o *DeleteRobotV1Params) SetProjectNameOrID(projectNameOrID string) { 183 o.ProjectNameOrID = projectNameOrID 184 } 185 186 // WithRobotID adds the robotID to the delete robot v1 params 187 func (o *DeleteRobotV1Params) WithRobotID(robotID int64) *DeleteRobotV1Params { 188 o.SetRobotID(robotID) 189 return o 190 } 191 192 // SetRobotID adds the robotId to the delete robot v1 params 193 func (o *DeleteRobotV1Params) SetRobotID(robotID int64) { 194 o.RobotID = robotID 195 } 196 197 // WriteToRequest writes these params to a swagger request 198 func (o *DeleteRobotV1Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 199 200 if err := r.SetTimeout(o.timeout); err != nil { 201 return err 202 } 203 var res []error 204 205 if o.XIsResourceName != nil { 206 207 // header param X-Is-Resource-Name 208 if err := r.SetHeaderParam("X-Is-Resource-Name", swag.FormatBool(*o.XIsResourceName)); err != nil { 209 return err 210 } 211 } 212 213 if o.XRequestID != nil { 214 215 // header param X-Request-Id 216 if err := r.SetHeaderParam("X-Request-Id", *o.XRequestID); err != nil { 217 return err 218 } 219 } 220 221 // path param project_name_or_id 222 if err := r.SetPathParam("project_name_or_id", o.ProjectNameOrID); err != nil { 223 return err 224 } 225 226 // path param robot_id 227 if err := r.SetPathParam("robot_id", swag.FormatInt64(o.RobotID)); err != nil { 228 return err 229 } 230 231 if len(res) > 0 { 232 return errors.CompositeValidationError(res...) 233 } 234 return nil 235 }