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