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