github.com/cilium/cilium@v1.16.2/api/v1/client/endpoint/get_endpoint_id_labels_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 endpoint
     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  // NewGetEndpointIDLabelsParams creates a new GetEndpointIDLabelsParams 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 NewGetEndpointIDLabelsParams() *GetEndpointIDLabelsParams {
    29  	return &GetEndpointIDLabelsParams{
    30  		timeout: cr.DefaultTimeout,
    31  	}
    32  }
    33  
    34  // NewGetEndpointIDLabelsParamsWithTimeout creates a new GetEndpointIDLabelsParams object
    35  // with the ability to set a timeout on a request.
    36  func NewGetEndpointIDLabelsParamsWithTimeout(timeout time.Duration) *GetEndpointIDLabelsParams {
    37  	return &GetEndpointIDLabelsParams{
    38  		timeout: timeout,
    39  	}
    40  }
    41  
    42  // NewGetEndpointIDLabelsParamsWithContext creates a new GetEndpointIDLabelsParams object
    43  // with the ability to set a context for a request.
    44  func NewGetEndpointIDLabelsParamsWithContext(ctx context.Context) *GetEndpointIDLabelsParams {
    45  	return &GetEndpointIDLabelsParams{
    46  		Context: ctx,
    47  	}
    48  }
    49  
    50  // NewGetEndpointIDLabelsParamsWithHTTPClient creates a new GetEndpointIDLabelsParams object
    51  // with the ability to set a custom HTTPClient for a request.
    52  func NewGetEndpointIDLabelsParamsWithHTTPClient(client *http.Client) *GetEndpointIDLabelsParams {
    53  	return &GetEndpointIDLabelsParams{
    54  		HTTPClient: client,
    55  	}
    56  }
    57  
    58  /*
    59  GetEndpointIDLabelsParams contains all the parameters to send to the API endpoint
    60  
    61  	for the get endpoint ID labels operation.
    62  
    63  	Typically these are written to a http.Request.
    64  */
    65  type GetEndpointIDLabelsParams struct {
    66  
    67  	/* ID.
    68  
    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  	  - cni-attachment-id: CNI attachment ID, e.g. cni-attachment-id:22222:eth0
    78  	  - container-id: Container runtime ID, e.g. container-id:22222 (deprecated, may not be unique)
    79  	  - container-name: Container name, e.g. container-name:foobar (deprecated, may not be unique)
    80  	  - pod-name: pod name for this container if K8s is enabled, e.g. pod-name:default:foobar (deprecated, may not be unique)
    81  	  - cep-name: cep name for this container if K8s is enabled, e.g. pod-name:default:foobar-net1
    82  	  - docker-endpoint: Docker libnetwork endpoint ID, e.g. docker-endpoint:4444
    83  
    84  	*/
    85  	ID string
    86  
    87  	timeout    time.Duration
    88  	Context    context.Context
    89  	HTTPClient *http.Client
    90  }
    91  
    92  // WithDefaults hydrates default values in the get endpoint ID labels params (not the query body).
    93  //
    94  // All values with no default are reset to their zero value.
    95  func (o *GetEndpointIDLabelsParams) WithDefaults() *GetEndpointIDLabelsParams {
    96  	o.SetDefaults()
    97  	return o
    98  }
    99  
   100  // SetDefaults hydrates default values in the get endpoint ID labels params (not the query body).
   101  //
   102  // All values with no default are reset to their zero value.
   103  func (o *GetEndpointIDLabelsParams) SetDefaults() {
   104  	// no default values defined for this parameter
   105  }
   106  
   107  // WithTimeout adds the timeout to the get endpoint ID labels params
   108  func (o *GetEndpointIDLabelsParams) WithTimeout(timeout time.Duration) *GetEndpointIDLabelsParams {
   109  	o.SetTimeout(timeout)
   110  	return o
   111  }
   112  
   113  // SetTimeout adds the timeout to the get endpoint ID labels params
   114  func (o *GetEndpointIDLabelsParams) SetTimeout(timeout time.Duration) {
   115  	o.timeout = timeout
   116  }
   117  
   118  // WithContext adds the context to the get endpoint ID labels params
   119  func (o *GetEndpointIDLabelsParams) WithContext(ctx context.Context) *GetEndpointIDLabelsParams {
   120  	o.SetContext(ctx)
   121  	return o
   122  }
   123  
   124  // SetContext adds the context to the get endpoint ID labels params
   125  func (o *GetEndpointIDLabelsParams) SetContext(ctx context.Context) {
   126  	o.Context = ctx
   127  }
   128  
   129  // WithHTTPClient adds the HTTPClient to the get endpoint ID labels params
   130  func (o *GetEndpointIDLabelsParams) WithHTTPClient(client *http.Client) *GetEndpointIDLabelsParams {
   131  	o.SetHTTPClient(client)
   132  	return o
   133  }
   134  
   135  // SetHTTPClient adds the HTTPClient to the get endpoint ID labels params
   136  func (o *GetEndpointIDLabelsParams) SetHTTPClient(client *http.Client) {
   137  	o.HTTPClient = client
   138  }
   139  
   140  // WithID adds the id to the get endpoint ID labels params
   141  func (o *GetEndpointIDLabelsParams) WithID(id string) *GetEndpointIDLabelsParams {
   142  	o.SetID(id)
   143  	return o
   144  }
   145  
   146  // SetID adds the id to the get endpoint ID labels params
   147  func (o *GetEndpointIDLabelsParams) SetID(id string) {
   148  	o.ID = id
   149  }
   150  
   151  // WriteToRequest writes these params to a swagger request
   152  func (o *GetEndpointIDLabelsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
   153  
   154  	if err := r.SetTimeout(o.timeout); err != nil {
   155  		return err
   156  	}
   157  	var res []error
   158  
   159  	// path param id
   160  	if err := r.SetPathParam("id", o.ID); err != nil {
   161  		return err
   162  	}
   163  
   164  	if len(res) > 0 {
   165  		return errors.CompositeValidationError(res...)
   166  	}
   167  	return nil
   168  }