github.com/cilium/cilium@v1.16.2/api/v1/client/daemon/get_map_name_events_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  // NewGetMapNameEventsParams creates a new GetMapNameEventsParams 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 NewGetMapNameEventsParams() *GetMapNameEventsParams {
    30  	return &GetMapNameEventsParams{
    31  		timeout: cr.DefaultTimeout,
    32  	}
    33  }
    34  
    35  // NewGetMapNameEventsParamsWithTimeout creates a new GetMapNameEventsParams object
    36  // with the ability to set a timeout on a request.
    37  func NewGetMapNameEventsParamsWithTimeout(timeout time.Duration) *GetMapNameEventsParams {
    38  	return &GetMapNameEventsParams{
    39  		timeout: timeout,
    40  	}
    41  }
    42  
    43  // NewGetMapNameEventsParamsWithContext creates a new GetMapNameEventsParams object
    44  // with the ability to set a context for a request.
    45  func NewGetMapNameEventsParamsWithContext(ctx context.Context) *GetMapNameEventsParams {
    46  	return &GetMapNameEventsParams{
    47  		Context: ctx,
    48  	}
    49  }
    50  
    51  // NewGetMapNameEventsParamsWithHTTPClient creates a new GetMapNameEventsParams object
    52  // with the ability to set a custom HTTPClient for a request.
    53  func NewGetMapNameEventsParamsWithHTTPClient(client *http.Client) *GetMapNameEventsParams {
    54  	return &GetMapNameEventsParams{
    55  		HTTPClient: client,
    56  	}
    57  }
    58  
    59  /*
    60  GetMapNameEventsParams contains all the parameters to send to the API endpoint
    61  
    62  	for the get map name events operation.
    63  
    64  	Typically these are written to a http.Request.
    65  */
    66  type GetMapNameEventsParams struct {
    67  
    68  	/* Follow.
    69  
    70  	   Whether to follow streamed requests
    71  	*/
    72  	Follow *bool
    73  
    74  	/* Name.
    75  
    76  	   Name of map
    77  	*/
    78  	Name string
    79  
    80  	timeout    time.Duration
    81  	Context    context.Context
    82  	HTTPClient *http.Client
    83  }
    84  
    85  // WithDefaults hydrates default values in the get map name events params (not the query body).
    86  //
    87  // All values with no default are reset to their zero value.
    88  func (o *GetMapNameEventsParams) WithDefaults() *GetMapNameEventsParams {
    89  	o.SetDefaults()
    90  	return o
    91  }
    92  
    93  // SetDefaults hydrates default values in the get map name events params (not the query body).
    94  //
    95  // All values with no default are reset to their zero value.
    96  func (o *GetMapNameEventsParams) SetDefaults() {
    97  	// no default values defined for this parameter
    98  }
    99  
   100  // WithTimeout adds the timeout to the get map name events params
   101  func (o *GetMapNameEventsParams) WithTimeout(timeout time.Duration) *GetMapNameEventsParams {
   102  	o.SetTimeout(timeout)
   103  	return o
   104  }
   105  
   106  // SetTimeout adds the timeout to the get map name events params
   107  func (o *GetMapNameEventsParams) SetTimeout(timeout time.Duration) {
   108  	o.timeout = timeout
   109  }
   110  
   111  // WithContext adds the context to the get map name events params
   112  func (o *GetMapNameEventsParams) WithContext(ctx context.Context) *GetMapNameEventsParams {
   113  	o.SetContext(ctx)
   114  	return o
   115  }
   116  
   117  // SetContext adds the context to the get map name events params
   118  func (o *GetMapNameEventsParams) SetContext(ctx context.Context) {
   119  	o.Context = ctx
   120  }
   121  
   122  // WithHTTPClient adds the HTTPClient to the get map name events params
   123  func (o *GetMapNameEventsParams) WithHTTPClient(client *http.Client) *GetMapNameEventsParams {
   124  	o.SetHTTPClient(client)
   125  	return o
   126  }
   127  
   128  // SetHTTPClient adds the HTTPClient to the get map name events params
   129  func (o *GetMapNameEventsParams) SetHTTPClient(client *http.Client) {
   130  	o.HTTPClient = client
   131  }
   132  
   133  // WithFollow adds the follow to the get map name events params
   134  func (o *GetMapNameEventsParams) WithFollow(follow *bool) *GetMapNameEventsParams {
   135  	o.SetFollow(follow)
   136  	return o
   137  }
   138  
   139  // SetFollow adds the follow to the get map name events params
   140  func (o *GetMapNameEventsParams) SetFollow(follow *bool) {
   141  	o.Follow = follow
   142  }
   143  
   144  // WithName adds the name to the get map name events params
   145  func (o *GetMapNameEventsParams) WithName(name string) *GetMapNameEventsParams {
   146  	o.SetName(name)
   147  	return o
   148  }
   149  
   150  // SetName adds the name to the get map name events params
   151  func (o *GetMapNameEventsParams) SetName(name string) {
   152  	o.Name = name
   153  }
   154  
   155  // WriteToRequest writes these params to a swagger request
   156  func (o *GetMapNameEventsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
   157  
   158  	if err := r.SetTimeout(o.timeout); err != nil {
   159  		return err
   160  	}
   161  	var res []error
   162  
   163  	if o.Follow != nil {
   164  
   165  		// query param follow
   166  		var qrFollow bool
   167  
   168  		if o.Follow != nil {
   169  			qrFollow = *o.Follow
   170  		}
   171  		qFollow := swag.FormatBool(qrFollow)
   172  		if qFollow != "" {
   173  
   174  			if err := r.SetQueryParam("follow", qFollow); err != nil {
   175  				return err
   176  			}
   177  		}
   178  	}
   179  
   180  	// path param name
   181  	if err := r.SetPathParam("name", o.Name); err != nil {
   182  		return err
   183  	}
   184  
   185  	if len(res) > 0 {
   186  		return errors.CompositeValidationError(res...)
   187  	}
   188  	return nil
   189  }