github.com/kubearmor/cilium@v1.6.12/api/v1/client/endpoint/put_endpoint_id_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  // NewPutEndpointIDParams creates a new PutEndpointIDParams object
    23  // with the default values initialized.
    24  func NewPutEndpointIDParams() *PutEndpointIDParams {
    25  	var ()
    26  	return &PutEndpointIDParams{
    27  
    28  		timeout: cr.DefaultTimeout,
    29  	}
    30  }
    31  
    32  // NewPutEndpointIDParamsWithTimeout creates a new PutEndpointIDParams object
    33  // with the default values initialized, and the ability to set a timeout on a request
    34  func NewPutEndpointIDParamsWithTimeout(timeout time.Duration) *PutEndpointIDParams {
    35  	var ()
    36  	return &PutEndpointIDParams{
    37  
    38  		timeout: timeout,
    39  	}
    40  }
    41  
    42  // NewPutEndpointIDParamsWithContext creates a new PutEndpointIDParams object
    43  // with the default values initialized, and the ability to set a context for a request
    44  func NewPutEndpointIDParamsWithContext(ctx context.Context) *PutEndpointIDParams {
    45  	var ()
    46  	return &PutEndpointIDParams{
    47  
    48  		Context: ctx,
    49  	}
    50  }
    51  
    52  // NewPutEndpointIDParamsWithHTTPClient creates a new PutEndpointIDParams object
    53  // with the default values initialized, and the ability to set a custom HTTPClient for a request
    54  func NewPutEndpointIDParamsWithHTTPClient(client *http.Client) *PutEndpointIDParams {
    55  	var ()
    56  	return &PutEndpointIDParams{
    57  		HTTPClient: client,
    58  	}
    59  }
    60  
    61  /*PutEndpointIDParams contains all the parameters to send to the API endpoint
    62  for the put endpoint ID operation typically these are written to a http.Request
    63  */
    64  type PutEndpointIDParams struct {
    65  
    66  	/*Endpoint*/
    67  	Endpoint *models.EndpointChangeRequest
    68  	/*ID
    69  	  String describing an endpoint with the format ``[prefix:]id``. If no prefix
    70  	is specified, a prefix of ``cilium-local:`` is assumed. Not all endpoints
    71  	will be addressable by all endpoint ID prefixes with the exception of the
    72  	local Cilium UUID which is assigned to all endpoints.
    73  
    74  	Supported endpoint id prefixes:
    75  	  - cilium-local: Local Cilium endpoint UUID, e.g. cilium-local:3389595
    76  	  - cilium-global: Global Cilium endpoint UUID, e.g. cilium-global:cluster1:nodeX:452343
    77  	  - container-id: Container runtime ID, e.g. container-id:22222
    78  	  - container-name: Container name, e.g. container-name:foobar
    79  	  - pod-name: pod name for this container if K8s is enabled, e.g. pod-name:default:foobar
    80  	  - docker-endpoint: Docker libnetwork endpoint ID, e.g. docker-endpoint:4444
    81  
    82  
    83  	*/
    84  	ID string
    85  
    86  	timeout    time.Duration
    87  	Context    context.Context
    88  	HTTPClient *http.Client
    89  }
    90  
    91  // WithTimeout adds the timeout to the put endpoint ID params
    92  func (o *PutEndpointIDParams) WithTimeout(timeout time.Duration) *PutEndpointIDParams {
    93  	o.SetTimeout(timeout)
    94  	return o
    95  }
    96  
    97  // SetTimeout adds the timeout to the put endpoint ID params
    98  func (o *PutEndpointIDParams) SetTimeout(timeout time.Duration) {
    99  	o.timeout = timeout
   100  }
   101  
   102  // WithContext adds the context to the put endpoint ID params
   103  func (o *PutEndpointIDParams) WithContext(ctx context.Context) *PutEndpointIDParams {
   104  	o.SetContext(ctx)
   105  	return o
   106  }
   107  
   108  // SetContext adds the context to the put endpoint ID params
   109  func (o *PutEndpointIDParams) SetContext(ctx context.Context) {
   110  	o.Context = ctx
   111  }
   112  
   113  // WithHTTPClient adds the HTTPClient to the put endpoint ID params
   114  func (o *PutEndpointIDParams) WithHTTPClient(client *http.Client) *PutEndpointIDParams {
   115  	o.SetHTTPClient(client)
   116  	return o
   117  }
   118  
   119  // SetHTTPClient adds the HTTPClient to the put endpoint ID params
   120  func (o *PutEndpointIDParams) SetHTTPClient(client *http.Client) {
   121  	o.HTTPClient = client
   122  }
   123  
   124  // WithEndpoint adds the endpoint to the put endpoint ID params
   125  func (o *PutEndpointIDParams) WithEndpoint(endpoint *models.EndpointChangeRequest) *PutEndpointIDParams {
   126  	o.SetEndpoint(endpoint)
   127  	return o
   128  }
   129  
   130  // SetEndpoint adds the endpoint to the put endpoint ID params
   131  func (o *PutEndpointIDParams) SetEndpoint(endpoint *models.EndpointChangeRequest) {
   132  	o.Endpoint = endpoint
   133  }
   134  
   135  // WithID adds the id to the put endpoint ID params
   136  func (o *PutEndpointIDParams) WithID(id string) *PutEndpointIDParams {
   137  	o.SetID(id)
   138  	return o
   139  }
   140  
   141  // SetID adds the id to the put endpoint ID params
   142  func (o *PutEndpointIDParams) SetID(id string) {
   143  	o.ID = id
   144  }
   145  
   146  // WriteToRequest writes these params to a swagger request
   147  func (o *PutEndpointIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
   148  
   149  	if err := r.SetTimeout(o.timeout); err != nil {
   150  		return err
   151  	}
   152  	var res []error
   153  
   154  	if o.Endpoint != nil {
   155  		if err := r.SetBodyParam(o.Endpoint); err != nil {
   156  			return err
   157  		}
   158  	}
   159  
   160  	// path param id
   161  	if err := r.SetPathParam("id", o.ID); err != nil {
   162  		return err
   163  	}
   164  
   165  	if len(res) > 0 {
   166  		return errors.CompositeValidationError(res...)
   167  	}
   168  	return nil
   169  }