github.com/cilium/cilium@v1.16.2/api/v1/kvstoremesh/client/cluster/get_cluster_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 cluster
     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  // NewGetClusterParams creates a new GetClusterParams 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 NewGetClusterParams() *GetClusterParams {
    29  	return &GetClusterParams{
    30  		timeout: cr.DefaultTimeout,
    31  	}
    32  }
    33  
    34  // NewGetClusterParamsWithTimeout creates a new GetClusterParams object
    35  // with the ability to set a timeout on a request.
    36  func NewGetClusterParamsWithTimeout(timeout time.Duration) *GetClusterParams {
    37  	return &GetClusterParams{
    38  		timeout: timeout,
    39  	}
    40  }
    41  
    42  // NewGetClusterParamsWithContext creates a new GetClusterParams object
    43  // with the ability to set a context for a request.
    44  func NewGetClusterParamsWithContext(ctx context.Context) *GetClusterParams {
    45  	return &GetClusterParams{
    46  		Context: ctx,
    47  	}
    48  }
    49  
    50  // NewGetClusterParamsWithHTTPClient creates a new GetClusterParams object
    51  // with the ability to set a custom HTTPClient for a request.
    52  func NewGetClusterParamsWithHTTPClient(client *http.Client) *GetClusterParams {
    53  	return &GetClusterParams{
    54  		HTTPClient: client,
    55  	}
    56  }
    57  
    58  /*
    59  GetClusterParams contains all the parameters to send to the API endpoint
    60  
    61  	for the get cluster operation.
    62  
    63  	Typically these are written to a http.Request.
    64  */
    65  type GetClusterParams struct {
    66  	timeout    time.Duration
    67  	Context    context.Context
    68  	HTTPClient *http.Client
    69  }
    70  
    71  // WithDefaults hydrates default values in the get cluster params (not the query body).
    72  //
    73  // All values with no default are reset to their zero value.
    74  func (o *GetClusterParams) WithDefaults() *GetClusterParams {
    75  	o.SetDefaults()
    76  	return o
    77  }
    78  
    79  // SetDefaults hydrates default values in the get cluster params (not the query body).
    80  //
    81  // All values with no default are reset to their zero value.
    82  func (o *GetClusterParams) SetDefaults() {
    83  	// no default values defined for this parameter
    84  }
    85  
    86  // WithTimeout adds the timeout to the get cluster params
    87  func (o *GetClusterParams) WithTimeout(timeout time.Duration) *GetClusterParams {
    88  	o.SetTimeout(timeout)
    89  	return o
    90  }
    91  
    92  // SetTimeout adds the timeout to the get cluster params
    93  func (o *GetClusterParams) SetTimeout(timeout time.Duration) {
    94  	o.timeout = timeout
    95  }
    96  
    97  // WithContext adds the context to the get cluster params
    98  func (o *GetClusterParams) WithContext(ctx context.Context) *GetClusterParams {
    99  	o.SetContext(ctx)
   100  	return o
   101  }
   102  
   103  // SetContext adds the context to the get cluster params
   104  func (o *GetClusterParams) SetContext(ctx context.Context) {
   105  	o.Context = ctx
   106  }
   107  
   108  // WithHTTPClient adds the HTTPClient to the get cluster params
   109  func (o *GetClusterParams) WithHTTPClient(client *http.Client) *GetClusterParams {
   110  	o.SetHTTPClient(client)
   111  	return o
   112  }
   113  
   114  // SetHTTPClient adds the HTTPClient to the get cluster params
   115  func (o *GetClusterParams) SetHTTPClient(client *http.Client) {
   116  	o.HTTPClient = client
   117  }
   118  
   119  // WriteToRequest writes these params to a swagger request
   120  func (o *GetClusterParams) 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  }