1/*
2Copyright The Kubernetes Authors.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8    http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17// Code generated by applyconfiguration-gen. DO NOT EDIT.
18
19package v1alpha1
20
21// ImageReviewSpecApplyConfiguration represents an declarative configuration of the ImageReviewSpec type for use
22// with apply.
23type ImageReviewSpecApplyConfiguration struct {
24	Containers  []ImageReviewContainerSpecApplyConfiguration `json:"containers,omitempty"`
25	Annotations map[string]string                            `json:"annotations,omitempty"`
26	Namespace   *string                                      `json:"namespace,omitempty"`
27}
28
29// ImageReviewSpecApplyConfiguration constructs an declarative configuration of the ImageReviewSpec type for use with
30// apply.
31func ImageReviewSpec() *ImageReviewSpecApplyConfiguration {
32	return &ImageReviewSpecApplyConfiguration{}
33}
34
35// WithContainers adds the given value to the Containers field in the declarative configuration
36// and returns the receiver, so that objects can be build by chaining "With" function invocations.
37// If called multiple times, values provided by each call will be appended to the Containers field.
38func (b *ImageReviewSpecApplyConfiguration) WithContainers(values ...*ImageReviewContainerSpecApplyConfiguration) *ImageReviewSpecApplyConfiguration {
39	for i := range values {
40		if values[i] == nil {
41			panic("nil value passed to WithContainers")
42		}
43		b.Containers = append(b.Containers, *values[i])
44	}
45	return b
46}
47
48// WithAnnotations puts the entries into the Annotations field in the declarative configuration
49// and returns the receiver, so that objects can be build by chaining "With" function invocations.
50// If called multiple times, the entries provided by each call will be put on the Annotations field,
51// overwriting an existing map entries in Annotations field with the same key.
52func (b *ImageReviewSpecApplyConfiguration) WithAnnotations(entries map[string]string) *ImageReviewSpecApplyConfiguration {
53	if b.Annotations == nil && len(entries) > 0 {
54		b.Annotations = make(map[string]string, len(entries))
55	}
56	for k, v := range entries {
57		b.Annotations[k] = v
58	}
59	return b
60}
61
62// WithNamespace sets the Namespace field in the declarative configuration to the given value
63// and returns the receiver, so that objects can be built by chaining "With" function invocations.
64// If called multiple times, the Namespace field is set to the value of the last call.
65func (b *ImageReviewSpecApplyConfiguration) WithNamespace(value string) *ImageReviewSpecApplyConfiguration {
66	b.Namespace = &value
67	return b
68}
69