/*
Copyright The cert-manager Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

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

package v1

// CAIssuerApplyConfiguration represents a declarative configuration of the CAIssuer type for use
// with apply.
type CAIssuerApplyConfiguration struct {
	// SecretName is the name of the secret used to sign Certificates issued
	// by this Issuer.
	SecretName *string `json:"secretName,omitempty"`
	// The CRL distribution points is an X.509 v3 certificate extension which identifies
	// the location of the CRL from which the revocation of this certificate can be checked.
	// If not set, certificates will be issued without distribution points set.
	CRLDistributionPoints []string `json:"crlDistributionPoints,omitempty"`
	// The OCSP server list is an X.509 v3 extension that defines a list of
	// URLs of OCSP responders. The OCSP responders can be queried for the
	// revocation status of an issued certificate. If not set, the
	// certificate will be issued with no OCSP servers set. For example, an
	// OCSP server URL could be "http://ocsp.int-x3.letsencrypt.org".
	OCSPServers []string `json:"ocspServers,omitempty"`
	// IssuingCertificateURLs is a list of URLs which this issuer should embed into certificates
	// it creates. See https://www.rfc-editor.org/rfc/rfc5280#section-4.2.2.1 for more details.
	// As an example, such a URL might be "http://ca.domain.com/ca.crt".
	IssuingCertificateURLs []string `json:"issuingCertificateURLs,omitempty"`
}

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

// WithSecretName sets the SecretName 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 SecretName field is set to the value of the last call.
func (b *CAIssuerApplyConfiguration) WithSecretName(value string) *CAIssuerApplyConfiguration {
	b.SecretName = &value
	return b
}

// WithCRLDistributionPoints adds the given value to the CRLDistributionPoints 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 CRLDistributionPoints field.
func (b *CAIssuerApplyConfiguration) WithCRLDistributionPoints(values ...string) *CAIssuerApplyConfiguration {
	for i := range values {
		b.CRLDistributionPoints = append(b.CRLDistributionPoints, values[i])
	}
	return b
}

// WithOCSPServers adds the given value to the OCSPServers 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 OCSPServers field.
func (b *CAIssuerApplyConfiguration) WithOCSPServers(values ...string) *CAIssuerApplyConfiguration {
	for i := range values {
		b.OCSPServers = append(b.OCSPServers, values[i])
	}
	return b
}

// WithIssuingCertificateURLs adds the given value to the IssuingCertificateURLs 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 IssuingCertificateURLs field.
func (b *CAIssuerApplyConfiguration) WithIssuingCertificateURLs(values ...string) *CAIssuerApplyConfiguration {
	for i := range values {
		b.IssuingCertificateURLs = append(b.IssuingCertificateURLs, values[i])
	}
	return b
}
