github.com/kubearmor/cilium@v1.6.12/api/v1/client/endpoint/get_endpoint_parameters.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package endpoint
     4  
     5  // This file was generated by the swagger tool.
     6  // Editing this file might prove futile when you re-run the swagger generate command
     7  
     8  import (
     9  	"context"
    10  	"net/http"
    11  	"time"
    12  
    13  	"github.com/go-openapi/errors"
    14  	"github.com/go-openapi/runtime"
    15  	cr "github.com/go-openapi/runtime/client"
    16  
    17  	strfmt "github.com/go-openapi/strfmt"
    18  
    19  	models "github.com/cilium/cilium/api/v1/models"
    20  )
    21  
    22  // NewGetEndpointParams creates a new GetEndpointParams object
    23  // with the default values initialized.
    24  func NewGetEndpointParams() *GetEndpointParams {
    25  	var ()
    26  	return &GetEndpointParams{
    27  
    28  		timeout: cr.DefaultTimeout,
    29  	}
    30  }
    31  
    32  // NewGetEndpointParamsWithTimeout creates a new GetEndpointParams object
    33  // with the default values initialized, and the ability to set a timeout on a request
    34  func NewGetEndpointParamsWithTimeout(timeout time.Duration) *GetEndpointParams {
    35  	var ()
    36  	return &GetEndpointParams{
    37  
    38  		timeout: timeout,
    39  	}
    40  }
    41  
    42  // NewGetEndpointParamsWithContext creates a new GetEndpointParams object
    43  // with the default values initialized, and the ability to set a context for a request
    44  func NewGetEndpointParamsWithContext(ctx context.Context) *GetEndpointParams {
    45  	var ()
    46  	return &GetEndpointParams{
    47  
    48  		Context: ctx,
    49  	}
    50  }
    51  
    52  // NewGetEndpointParamsWithHTTPClient creates a new GetEndpointParams object
    53  // with the default values initialized, and the ability to set a custom HTTPClient for a request
    54  func NewGetEndpointParamsWithHTTPClient(client *http.Client) *GetEndpointParams {
    55  	var ()
    56  	return &GetEndpointParams{
    57  		HTTPClient: client,
    58  	}
    59  }
    60  
    61  /*GetEndpointParams contains all the parameters to send to the API endpoint
    62  for the get endpoint operation typically these are written to a http.Request
    63  */
    64  type GetEndpointParams struct {
    65  
    66  	/*Labels
    67  	  List of labels
    68  
    69  
    70  	*/
    71  	Labels models.Labels
    72  
    73  	timeout    time.Duration
    74  	Context    context.Context
    75  	HTTPClient *http.Client
    76  }
    77  
    78  // WithTimeout adds the timeout to the get endpoint params
    79  func (o *GetEndpointParams) WithTimeout(timeout time.Duration) *GetEndpointParams {
    80  	o.SetTimeout(timeout)
    81  	return o
    82  }
    83  
    84  // SetTimeout adds the timeout to the get endpoint params
    85  func (o *GetEndpointParams) SetTimeout(timeout time.Duration) {
    86  	o.timeout = timeout
    87  }
    88  
    89  // WithContext adds the context to the get endpoint params
    90  func (o *GetEndpointParams) WithContext(ctx context.Context) *GetEndpointParams {
    91  	o.SetContext(ctx)
    92  	return o
    93  }
    94  
    95  // SetContext adds the context to the get endpoint params
    96  func (o *GetEndpointParams) SetContext(ctx context.Context) {
    97  	o.Context = ctx
    98  }
    99  
   100  // WithHTTPClient adds the HTTPClient to the get endpoint params
   101  func (o *GetEndpointParams) WithHTTPClient(client *http.Client) *GetEndpointParams {
   102  	o.SetHTTPClient(client)
   103  	return o
   104  }
   105  
   106  // SetHTTPClient adds the HTTPClient to the get endpoint params
   107  func (o *GetEndpointParams) SetHTTPClient(client *http.Client) {
   108  	o.HTTPClient = client
   109  }
   110  
   111  // WithLabels adds the labels to the get endpoint params
   112  func (o *GetEndpointParams) WithLabels(labels models.Labels) *GetEndpointParams {
   113  	o.SetLabels(labels)
   114  	return o
   115  }
   116  
   117  // SetLabels adds the labels to the get endpoint params
   118  func (o *GetEndpointParams) SetLabels(labels models.Labels) {
   119  	o.Labels = labels
   120  }
   121  
   122  // WriteToRequest writes these params to a swagger request
   123  func (o *GetEndpointParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
   124  
   125  	if err := r.SetTimeout(o.timeout); err != nil {
   126  		return err
   127  	}
   128  	var res []error
   129  
   130  	if o.Labels != nil {
   131  		if err := r.SetBodyParam(o.Labels); err != nil {
   132  			return err
   133  		}
   134  	}
   135  
   136  	if len(res) > 0 {
   137  		return errors.CompositeValidationError(res...)
   138  	}
   139  	return nil
   140  }