...

Source file src/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinitionspec.go

Documentation: k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1

     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 v1
    20  
    21  import (
    22  	apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
    23  )
    24  
    25  // CustomResourceDefinitionSpecApplyConfiguration represents an declarative configuration of the CustomResourceDefinitionSpec type for use
    26  // with apply.
    27  type CustomResourceDefinitionSpecApplyConfiguration struct {
    28  	Group                 *string                                             `json:"group,omitempty"`
    29  	Names                 *CustomResourceDefinitionNamesApplyConfiguration    `json:"names,omitempty"`
    30  	Scope                 *apiextensionsv1.ResourceScope                      `json:"scope,omitempty"`
    31  	Versions              []CustomResourceDefinitionVersionApplyConfiguration `json:"versions,omitempty"`
    32  	Conversion            *CustomResourceConversionApplyConfiguration         `json:"conversion,omitempty"`
    33  	PreserveUnknownFields *bool                                               `json:"preserveUnknownFields,omitempty"`
    34  }
    35  
    36  // CustomResourceDefinitionSpecApplyConfiguration constructs an declarative configuration of the CustomResourceDefinitionSpec type for use with
    37  // apply.
    38  func CustomResourceDefinitionSpec() *CustomResourceDefinitionSpecApplyConfiguration {
    39  	return &CustomResourceDefinitionSpecApplyConfiguration{}
    40  }
    41  
    42  // WithGroup sets the Group field in the declarative configuration to the given value
    43  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    44  // If called multiple times, the Group field is set to the value of the last call.
    45  func (b *CustomResourceDefinitionSpecApplyConfiguration) WithGroup(value string) *CustomResourceDefinitionSpecApplyConfiguration {
    46  	b.Group = &value
    47  	return b
    48  }
    49  
    50  // WithNames sets the Names field in the declarative configuration to the given value
    51  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    52  // If called multiple times, the Names field is set to the value of the last call.
    53  func (b *CustomResourceDefinitionSpecApplyConfiguration) WithNames(value *CustomResourceDefinitionNamesApplyConfiguration) *CustomResourceDefinitionSpecApplyConfiguration {
    54  	b.Names = value
    55  	return b
    56  }
    57  
    58  // WithScope sets the Scope field in the declarative configuration to the given value
    59  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    60  // If called multiple times, the Scope field is set to the value of the last call.
    61  func (b *CustomResourceDefinitionSpecApplyConfiguration) WithScope(value apiextensionsv1.ResourceScope) *CustomResourceDefinitionSpecApplyConfiguration {
    62  	b.Scope = &value
    63  	return b
    64  }
    65  
    66  // WithVersions adds the given value to the Versions field in the declarative configuration
    67  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
    68  // If called multiple times, values provided by each call will be appended to the Versions field.
    69  func (b *CustomResourceDefinitionSpecApplyConfiguration) WithVersions(values ...*CustomResourceDefinitionVersionApplyConfiguration) *CustomResourceDefinitionSpecApplyConfiguration {
    70  	for i := range values {
    71  		if values[i] == nil {
    72  			panic("nil value passed to WithVersions")
    73  		}
    74  		b.Versions = append(b.Versions, *values[i])
    75  	}
    76  	return b
    77  }
    78  
    79  // WithConversion sets the Conversion field in the declarative configuration to the given value
    80  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    81  // If called multiple times, the Conversion field is set to the value of the last call.
    82  func (b *CustomResourceDefinitionSpecApplyConfiguration) WithConversion(value *CustomResourceConversionApplyConfiguration) *CustomResourceDefinitionSpecApplyConfiguration {
    83  	b.Conversion = value
    84  	return b
    85  }
    86  
    87  // WithPreserveUnknownFields sets the PreserveUnknownFields field in the declarative configuration to the given value
    88  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    89  // If called multiple times, the PreserveUnknownFields field is set to the value of the last call.
    90  func (b *CustomResourceDefinitionSpecApplyConfiguration) WithPreserveUnknownFields(value bool) *CustomResourceDefinitionSpecApplyConfiguration {
    91  	b.PreserveUnknownFields = &value
    92  	return b
    93  }
    94  

View as plain text