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

package v1

// ImagePolicyPKIRootOfTrustApplyConfiguration represents a declarative configuration of the ImagePolicyPKIRootOfTrust type for use
// with apply.
//
// ImagePolicyPKIRootOfTrust defines the root of trust based on Root CA(s) and corresponding intermediate certificates.
type ImagePolicyPKIRootOfTrustApplyConfiguration struct {
	// caRootsData contains base64-encoded data of a certificate bundle PEM file, which contains one or more CA roots in the PEM format. The total length of the data must not exceed 8192 characters.
	CertificateAuthorityRootsData []byte `json:"caRootsData,omitempty"`
	// caIntermediatesData contains base64-encoded data of a certificate bundle PEM file, which contains one or more intermediate certificates in the PEM format. The total length of the data must not exceed 8192 characters.
	// caIntermediatesData requires caRootsData to be set.
	CertificateAuthorityIntermediatesData []byte `json:"caIntermediatesData,omitempty"`
	// pkiCertificateSubject defines the requirements imposed on the subject to which the certificate was issued.
	PKICertificateSubject *PKICertificateSubjectApplyConfiguration `json:"pkiCertificateSubject,omitempty"`
}

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

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

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

// WithPKICertificateSubject sets the PKICertificateSubject 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 PKICertificateSubject field is set to the value of the last call.
func (b *ImagePolicyPKIRootOfTrustApplyConfiguration) WithPKICertificateSubject(value *PKICertificateSubjectApplyConfiguration) *ImagePolicyPKIRootOfTrustApplyConfiguration {
	b.PKICertificateSubject = value
	return b
}
