// CreateTargetHTTPSProxy creates a TargetHttpsProxy
969528
func (g *Cloud) CreateTargetHTTPSProxy(proxy *compute.TargetHttpsProxy) error {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()

	mc := newTargetProxyMetricContext("create")
	return mc.Observe(g.c.TargetHttpsProxies().Insert(ctx, meta.GlobalKey(proxy.Name), proxy))
}
1049655
func (s *ReviewActionDetail) SetTargetType(v string) *ReviewActionDetail {
	s.TargetType = &v
	return s
}
10645
func (g *Cloud) GetTargetHTTPProxy(name string) (*compute.TargetHttpProxy, error) {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()

	mc := newTargetProxyMetricContext("get")
	v, err := g.c.TargetHttpProxies().Get(ctx, meta.GlobalKey(name))
	return v, mc.Observe(err)
}
545662
func (s *S3CopyObjectOperation) SetTargetKeyPrefix(v string) *S3CopyObjectOperation {
	s.TargetKeyPrefix = &v
	return s
}
553113
func NewHTTPProxy(
	c collector.EventCollector,
	puContext string,
	caPool *x509.CertPool,
	applicationProxy bool,
	mark int,
	secrets secrets.Secrets,
	registry *serviceregistry.Registry,
) *Config {

	return &Config{
		collector:        c,
		puContext:        puContext,
		ca:               caPool,
		applicationProxy: applicationProxy,
		mark:             mark,
		secrets:          secrets,
		localIPs:         markedconn.GetInterfaces(),
		registry:         registry,
		tlsClientConfig: &tls.Config{
			RootCAs: caPool,
		},
	}
}
303800
func (s *ProxyInfo) SetTargetNetworks(cfg *runtime.Configuration) error {
	resp := &rpcwrapper.Response{}
	request := &rpcwrapper.Request{
		Payload: &rpcwrapper.SetTargetNetworksPayload{
			Configuration: cfg,
		},
	}

	var allErrors string

	for _, contextID := range s.rpchdl.ContextList() {
		if err := s.rpchdl.RemoteCall(contextID, remoteenforcer.SetTargetNetworks, request, resp); err != nil {
			allErrors = allErrors + " contextID " + contextID + ":" + err.Error()
		}
	}

	s.Lock()
	s.cfg = cfg
	s.Unlock()

	if len(allErrors) > 0 {
		return fmt.Errorf("Remote enforcers failed: %s", allErrors)
	}

	return nil
}
169215
func (gce *Cloud) SetURLMapForTargetHTTPSProxy(proxy *compute.TargetHttpsProxy, urlMap *compute.UrlMap) error {
	op, err := gce.service.TargetHttpsProxies.SetUrlMap(gce.projectID, proxy.Name, &compute.UrlMapReference{UrlMap: urlMap.SelfLink}).Do()
	if err != nil {
		return err
	}
	return gce.waitForGlobalOp(op)
}
321481
func (g *Cloud) DeleteTargetHTTPProxy(name string) error {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()

	mc := newTargetProxyMetricContext("delete")
	return mc.Observe(g.c.TargetHttpProxies().Delete(ctx, meta.GlobalKey(name)))
}
899084
func (s *InstanceFleet) SetTargetSpotCapacity(v int64) *InstanceFleet {
	s.TargetSpotCapacity = &v
	return s
}
517620
func (s *InstanceFleetModifyConfig) SetTargetSpotCapacity(v int64) *InstanceFleetModifyConfig {
	s.TargetSpotCapacity = &v
	return s
}
994119
func NewProxy(target *url.URL) *WebsocketProxy {
	backend := func(r *http.Request) *url.URL {
		// Shallow copy
		u := *target
		u.Fragment = r.URL.Fragment
		u.Path = r.URL.Path
		u.RawQuery = r.URL.RawQuery
		return &u
	}
	return &WebsocketProxy{Backend: backend}
}
79504
func addDefaultTargetFilter(chCtx context.Channel, ft filter.EndpointType) RequestOption {
	return func(ctx context.Client, o *requestOptions) error {
		if len(o.Targets) == 0 && o.TargetFilter == nil {
			return WithTargetFilter(filter.NewEndpointFilter(chCtx, ft))(ctx, o)
		}
		return nil
	}
}
169780
func (g *Cloud) SetURLMapForTargetHTTPProxy(proxy *compute.TargetHttpProxy, urlMapLink string) error {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()

	ref := &compute.UrlMapReference{UrlMap: urlMapLink}
	mc := newTargetProxyMetricContext("set_url_map")
	return mc.Observe(g.c.TargetHttpProxies().SetUrlMap(ctx, meta.GlobalKey(proxy.Name), ref))
}
123751
func (d *DevTools) CreateURL(ctx context.Context, openURL string) (*Target, error) {
	var escapedQueryURL string

	if openURL != "" {
		if parsed, err := url.Parse(openURL); err != nil || !parsed.IsAbs() {
			return nil, errors.New("devtool: CreateURL: invalid openURL: " + openURL)
		}
		escapedQueryURL = "?" + url.QueryEscape(openURL)
	}

	resp, err := d.httpGet(ctx, "/json/new"+escapedQueryURL)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()

	switch resp.StatusCode {
	// Returned by Headless Chrome that does
	// not support the "/json/new" endpoint.
	case http.StatusInternalServerError:
		err2 := parseError("CreateUrl: StatusInternalServerError", resp.Body)

		v, err := d.Version(ctx)
		if err != nil {
			return nil, err2
		}

		if v.WebSocketDebuggerURL != "" {
			// This version is too new since it has a debugger URL set.
			return nil, err2
		}

		return fallbackHeadlessCreateURL(ctx, d, openURL)

	case http.StatusOK:
		t := new(Target)
		return t, json.NewDecoder(resp.Body).Decode(t)

	default:
		return nil, parseError("CreateURL", resp.Body)
	}
}
279957
func (c *Config) AptHTTPProxy() string {
	return addSchemeIfMissing("http", c.getWithFallback(AptHTTPProxyKey, JujuHTTPProxyKey, HTTPProxyKey))
}
1236406
func WithTargetEndpoints(keys ...string) RequestOption {
	return func(ctx context.Client, opts *requestOptions) error {

		var targets []fab.Peer

		for _, url := range keys {

			peerCfg, err := comm.NetworkPeerConfig(ctx.EndpointConfig(), url)
			if err != nil {
				return err
			}

			peer, err := ctx.InfraProvider().CreatePeerFromConfig(peerCfg)
			if err != nil {
				return errors.WithMessage(err, "creating peer from config failed")
			}

			targets = append(targets, peer)
		}

		return WithTargets(targets...)(ctx, opts)
	}
}
663729
func (s *GetRouteOutput) SetTarget(v string) *GetRouteOutput {
	s.Target = &v
	return s
}