github.com/cilium/cilium@v1.16.2/api/v1/health/client/connectivity/get_status_parameters.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  // Copyright Authors of Cilium
     4  // SPDX-License-Identifier: Apache-2.0
     5  
     6  package connectivity
     7  
     8  // This file was generated by the swagger tool.
     9  // Editing this file might prove futile when you re-run the swagger generate command
    10  
    11  import (
    12  	"context"
    13  	"net/http"
    14  	"time"
    15  
    16  	"github.com/go-openapi/errors"
    17  	"github.com/go-openapi/runtime"
    18  	cr "github.com/go-openapi/runtime/client"
    19  	"github.com/go-openapi/strfmt"
    20  )
    21  
    22  // NewGetStatusParams creates a new GetStatusParams object,
    23  // with the default timeout for this client.
    24  //
    25  // Default values are not hydrated, since defaults are normally applied by the API server side.
    26  //
    27  // To enforce default values in parameter, use SetDefaults or WithDefaults.
    28  func NewGetStatusParams() *GetStatusParams {
    29  	return &GetStatusParams{
    30  		timeout: cr.DefaultTimeout,
    31  	}
    32  }
    33  
    34  // NewGetStatusParamsWithTimeout creates a new GetStatusParams object
    35  // with the ability to set a timeout on a request.
    36  func NewGetStatusParamsWithTimeout(timeout time.Duration) *GetStatusParams {
    37  	return &GetStatusParams{
    38  		timeout: timeout,
    39  	}
    40  }
    41  
    42  // NewGetStatusParamsWithContext creates a new GetStatusParams object
    43  // with the ability to set a context for a request.
    44  func NewGetStatusParamsWithContext(ctx context.Context) *GetStatusParams {
    45  	return &GetStatusParams{
    46  		Context: ctx,
    47  	}
    48  }
    49  
    50  // NewGetStatusParamsWithHTTPClient creates a new GetStatusParams object
    51  // with the ability to set a custom HTTPClient for a request.
    52  func NewGetStatusParamsWithHTTPClient(client *http.Client) *GetStatusParams {
    53  	return &GetStatusParams{
    54  		HTTPClient: client,
    55  	}
    56  }
    57  
    58  /*
    59  GetStatusParams contains all the parameters to send to the API endpoint
    60  
    61  	for the get status operation.
    62  
    63  	Typically these are written to a http.Request.
    64  */
    65  type GetStatusParams struct {
    66  	timeout    time.Duration
    67  	Context    context.Context
    68  	HTTPClient *http.Client
    69  }
    70  
    71  // WithDefaults hydrates default values in the get status params (not the query body).
    72  //
    73  // All values with no default are reset to their zero value.
    74  func (o *GetStatusParams) WithDefaults() *GetStatusParams {
    75  	o.SetDefaults()
    76  	return o
    77  }
    78  
    79  // SetDefaults hydrates default values in the get status params (not the query body).
    80  //
    81  // All values with no default are reset to their zero value.
    82  func (o *GetStatusParams) SetDefaults() {
    83  	// no default values defined for this parameter
    84  }
    85  
    86  // WithTimeout adds the timeout to the get status params
    87  func (o *GetStatusParams) WithTimeout(timeout time.Duration) *GetStatusParams {
    88  	o.SetTimeout(timeout)
    89  	return o
    90  }
    91  
    92  // SetTimeout adds the timeout to the get status params
    93  func (o *GetStatusParams) SetTimeout(timeout time.Duration) {
    94  	o.timeout = timeout
    95  }
    96  
    97  // WithContext adds the context to the get status params
    98  func (o *GetStatusParams) WithContext(ctx context.Context) *GetStatusParams {
    99  	o.SetContext(ctx)
   100  	return o
   101  }
   102  
   103  // SetContext adds the context to the get status params
   104  func (o *GetStatusParams) SetContext(ctx context.Context) {
   105  	o.Context = ctx
   106  }
   107  
   108  // WithHTTPClient adds the HTTPClient to the get status params
   109  func (o *GetStatusParams) WithHTTPClient(client *http.Client) *GetStatusParams {
   110  	o.SetHTTPClient(client)
   111  	return o
   112  }
   113  
   114  // SetHTTPClient adds the HTTPClient to the get status params
   115  func (o *GetStatusParams) SetHTTPClient(client *http.Client) {
   116  	o.HTTPClient = client
   117  }
   118  
   119  // WriteToRequest writes these params to a swagger request
   120  func (o *GetStatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
   121  
   122  	if err := r.SetTimeout(o.timeout); err != nil {
   123  		return err
   124  	}
   125  	var res []error
   126  
   127  	if len(res) > 0 {
   128  		return errors.CompositeValidationError(res...)
   129  	}
   130  	return nil
   131  }