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