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

package v1

import (
	configv1 "github.com/openshift/api/config/v1"
)

// PolicyMatchRemapIdentityApplyConfiguration represents a declarative configuration of the PolicyMatchRemapIdentity type for use
// with apply.
type PolicyMatchRemapIdentityApplyConfiguration struct {
	// prefix is required if matchPolicy is set to "RemapIdentity".
	// prefix is the prefix of the image identity to be matched.
	// If the image identity matches the specified prefix, that prefix is replaced by the specified “signedPrefix” (otherwise it is used as unchanged and no remapping takes place).
	// This is useful when verifying signatures for a mirror of some other repository namespace that preserves the vendor’s repository structure.
	// The prefix and signedPrefix values can be either host[:port] values (matching exactly the same host[:port], string), repository namespaces,
	// or repositories (i.e. they must not contain tags/digests), and match as prefixes of the fully expanded form.
	// For example, docker.io/library/busybox (not busybox) to specify that single repository, or docker.io/library (not an empty string) to specify the parent namespace of docker.io/library/busybox.
	Prefix *configv1.IdentityRepositoryPrefix `json:"prefix,omitempty"`
	// signedPrefix is required if matchPolicy is set to "RemapIdentity".
	// signedPrefix is the prefix of the image identity to be matched in the signature. The format is the same as "prefix". The values can be either host[:port] values (matching exactly the same host[:port], string), repository namespaces,
	// or repositories (i.e. they must not contain tags/digests), and match as prefixes of the fully expanded form.
	// For example, docker.io/library/busybox (not busybox) to specify that single repository, or docker.io/library (not an empty string) to specify the parent namespace of docker.io/library/busybox.
	SignedPrefix *configv1.IdentityRepositoryPrefix `json:"signedPrefix,omitempty"`
}

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

// WithPrefix sets the Prefix 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 Prefix field is set to the value of the last call.
func (b *PolicyMatchRemapIdentityApplyConfiguration) WithPrefix(value configv1.IdentityRepositoryPrefix) *PolicyMatchRemapIdentityApplyConfiguration {
	b.Prefix = &value
	return b
}

// WithSignedPrefix sets the SignedPrefix 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 SignedPrefix field is set to the value of the last call.
func (b *PolicyMatchRemapIdentityApplyConfiguration) WithSignedPrefix(value configv1.IdentityRepositoryPrefix) *PolicyMatchRemapIdentityApplyConfiguration {
	b.SignedPrefix = &value
	return b
}
