// Code generated by applyconfiguration-gen. DO NOT EDIT.

package v1

// ProxySpecApplyConfiguration represents a declarative configuration of the ProxySpec type for use
// with apply.
//
// ProxySpec contains cluster proxy creation configuration.
type ProxySpecApplyConfiguration struct {
	// httpProxy is the URL of the proxy for HTTP requests.  Empty means unset and will not result in an env var.
	HTTPProxy *string `json:"httpProxy,omitempty"`
	// httpsProxy is the URL of the proxy for HTTPS requests.  Empty means unset and will not result in an env var.
	HTTPSProxy *string `json:"httpsProxy,omitempty"`
	// noProxy is a comma-separated list of hostnames and/or CIDRs and/or IPs for which the proxy should not be used.
	// Empty means unset and will not result in an env var.
	NoProxy *string `json:"noProxy,omitempty"`
	// readinessEndpoints is a list of endpoints used to verify readiness of the proxy.
	ReadinessEndpoints []string `json:"readinessEndpoints,omitempty"`
	// trustedCA is a reference to a ConfigMap containing a CA certificate bundle.
	// The trustedCA field should only be consumed by a proxy validator. The
	// validator is responsible for reading the certificate bundle from the required
	// key "ca-bundle.crt", merging it with the system default trust bundle,
	// and writing the merged trust bundle to a ConfigMap named "trusted-ca-bundle"
	// in the "openshift-config-managed" namespace. Clients that expect to make
	// proxy connections must use the trusted-ca-bundle for all HTTPS requests to
	// the proxy, and may use the trusted-ca-bundle for non-proxy HTTPS requests as
	// well.
	//
	// The namespace for the ConfigMap referenced by trustedCA is
	// "openshift-config". Here is an example ConfigMap (in yaml):
	//
	// apiVersion: v1
	// kind: ConfigMap
	// metadata:
	// name: user-ca-bundle
	// namespace: openshift-config
	// data:
	// ca-bundle.crt: |
	// -----BEGIN CERTIFICATE-----
	// Custom CA certificate bundle.
	// -----END CERTIFICATE-----
	TrustedCA *ConfigMapNameReferenceApplyConfiguration `json:"trustedCA,omitempty"`
}

// ProxySpecApplyConfiguration constructs a declarative configuration of the ProxySpec type for use with
// apply.
func ProxySpec() *ProxySpecApplyConfiguration {
	return &ProxySpecApplyConfiguration{}
}

// WithHTTPProxy sets the HTTPProxy field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the HTTPProxy field is set to the value of the last call.
func (b *ProxySpecApplyConfiguration) WithHTTPProxy(value string) *ProxySpecApplyConfiguration {
	b.HTTPProxy = &value
	return b
}

// WithHTTPSProxy sets the HTTPSProxy field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the HTTPSProxy field is set to the value of the last call.
func (b *ProxySpecApplyConfiguration) WithHTTPSProxy(value string) *ProxySpecApplyConfiguration {
	b.HTTPSProxy = &value
	return b
}

// WithNoProxy sets the NoProxy field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the NoProxy field is set to the value of the last call.
func (b *ProxySpecApplyConfiguration) WithNoProxy(value string) *ProxySpecApplyConfiguration {
	b.NoProxy = &value
	return b
}

// WithReadinessEndpoints adds the given value to the ReadinessEndpoints field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the ReadinessEndpoints field.
func (b *ProxySpecApplyConfiguration) WithReadinessEndpoints(values ...string) *ProxySpecApplyConfiguration {
	for i := range values {
		b.ReadinessEndpoints = append(b.ReadinessEndpoints, values[i])
	}
	return b
}

// WithTrustedCA sets the TrustedCA field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the TrustedCA field is set to the value of the last call.
func (b *ProxySpecApplyConfiguration) WithTrustedCA(value *ConfigMapNameReferenceApplyConfiguration) *ProxySpecApplyConfiguration {
	b.TrustedCA = value
	return b
}
