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