github.com/goharbor/go-client@v0.210.0/pkg/sdk/v2.0/client/systeminfo/get_system_info_parameters.go (about)

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