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