// WithEndpoint sets a config Endpoint value returning a Config pointer for
// chaining.
6831
func (c *Config) WithEndpoint(endpoint string) *Config {
	c.Endpoint = &endpoint
	return c
}
1317209
func (d *datapathHash) sumEndpoint(dp datapath.Datapath, epCfg datapath.EndpointConfiguration, staticData bool) (string, error) {
	result, err := d.Copy()
	if err != nil {
		return "", err
	}
	if staticData {
		dp.WriteEndpointConfig(result, epCfg)
	} else {
		dp.WriteTemplateConfig(result, epCfg)
	}
	return result.String(), nil
}
232170
func WithLocalEndpoint(e *model.Endpoint) TracerOption {
	return func(o *Tracer) error {
		if e == nil {
			o.localEndpoint = nil
			return nil
		}
		ep := *e
		o.localEndpoint = &ep
		return nil
	}
}
909608
func (t *TCPHealthCheck) SetEndpoint(endpoint string) *TCPHealthCheck {
	t.Endpoint = endpoint
	return t
}
1299949
func ServiceWithEndpoint(endpoint *swarmtypes.EndpointSpec) ServiceSpecOpt {
	return func(spec *swarmtypes.ServiceSpec) {
		spec.EndpointSpec = endpoint
	}
}
964808
func WithEndpointAttributes(attrs ...trace.Attribute) EndpointOption {
	return func(o *EndpointOptions) {
		o.Attributes = attrs
	}
}
158789
func (s *Server) SetEndpoint(v string) *Server {
	s.Endpoint = &v
	return s
}
280527
func (m method) JesterEndpoint() string {
	e := strings.Replace(m.Endpoint, "{", "@", -1)
	return strings.Replace(e, "}", "", -1)
}
816418
func (c *Client) SetEndpoint(endpoint string) {
	c.configuration.endpoint = endpoint
	c.Transport.SetEndpoint(endpoint)
}
422055
func (s *Cluster) SetEndpoint(v *Endpoint) *Cluster {
	s.Endpoint = v
	return s
}
556064
func (s *Server) AddEndpointFunc(method, path string, handler func(w http.ResponseWriter, r *http.Request)) {
	s.AddEndpoint(method, path, ApiHandlerFunc(handler))
}
874191
func (r *httpVPackResponse) Endpoint() string {
	u := *r.resp.Request.URL
	u.Path = ""
	return u.String()
}
234742
func (s *RemoteAccessSession) SetEndpoint(v string) *RemoteAccessSession {
	s.Endpoint = &v
	return s
}
330568
func (p *PodContainer) AddEndpoint(endpoint *PodEndpoint) *PodContainer {
	p.Endpoints = append(p.Endpoints, endpoint)
	return p
}
306612
func (c Client) Endpoint() endpoint.Endpoint {
	return func(ctx context.Context, request interface{}) (interface{}, error) {
		ctx, cancel := context.WithCancel(ctx)

		var (
			resp *http.Response
			err  error
		)
		if c.finalizer != nil {
			defer func() {
				if resp != nil {
					ctx = context.WithValue(ctx, ContextKeyResponseHeaders, resp.Header)
					ctx = context.WithValue(ctx, ContextKeyResponseSize, resp.ContentLength)
				}
				for _, f := range c.finalizer {
					f(ctx, err)
				}
			}()
		}

		req, err := http.NewRequest(c.method, c.tgt.String(), nil)
		if err != nil {
			cancel()
			return nil, err
		}

		if err = c.enc(ctx, req, request); err != nil {
			cancel()
			return nil, err
		}

		for _, f := range c.before {
			ctx = f(ctx, req)
		}

		resp, err = c.client.Do(req.WithContext(ctx))

		if err != nil {
			cancel()
			return nil, err
		}

		// If we expect a buffered stream, we don't cancel the context when the endpoint returns.
		// Instead, we should call the cancel func when closing the response body.
		if c.bufferedStream {
			resp.Body = bodyWithCancel{ReadCloser: resp.Body, cancel: cancel}
		} else {
			defer resp.Body.Close()
			defer cancel()
		}

		for _, f := range c.after {
			ctx = f(ctx, resp)
		}

		response, err := c.dec(ctx, resp)
		if err != nil {
			return nil, err
		}

		return response, nil
	}
}
1312859
func (o *PatchEndpointIDLabelsParams) WithConfiguration(configuration *models.LabelConfigurationSpec) *PatchEndpointIDLabelsParams {
	o.SetConfiguration(configuration)
	return o
}
434645
func (s *SourceRegion) SetEndpoint(v string) *SourceRegion {
	s.Endpoint = &v
	return s
}