...

Source file src/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewspec.go

Documentation: k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1

     1  /*
     2  Copyright The Kubernetes Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  // Code generated by applyconfiguration-gen. DO NOT EDIT.
    18  
    19  package v1alpha1
    20  
    21  // ImageReviewSpecApplyConfiguration represents an declarative configuration of the ImageReviewSpec type for use
    22  // with apply.
    23  type 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.
    31  func 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.
    38  func (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.
    52  func (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.
    65  func (b *ImageReviewSpecApplyConfiguration) WithNamespace(value string) *ImageReviewSpecApplyConfiguration {
    66  	b.Namespace = &value
    67  	return b
    68  }
    69  

View as plain text