| 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 |
corev1 "k8s.io/api/core/v1" |
| 23 |
intstr "k8s.io/apimachinery/pkg/util/intstr" |
| 24 |
) |
| 25 |
|
| 26 |
// HTTPGetActionApplyConfiguration represents a declarative configuration of the HTTPGetAction type for use |
| 27 |
// with apply. |
| 28 |
type HTTPGetActionApplyConfiguration struct { |
| 29 |
Path *string `json:"path,omitempty"` |
| 30 |
Port *intstr.IntOrString `json:"port,omitempty"` |
| 31 |
Host *string `json:"host,omitempty"` |
| 32 |
Scheme *corev1.URIScheme `json:"scheme,omitempty"` |
| 33 |
HTTPHeaders []HTTPHeaderApplyConfiguration `json:"httpHeaders,omitempty"` |
| 34 |
} |
| 35 |
|
| 36 |
// HTTPGetActionApplyConfiguration constructs a declarative configuration of the HTTPGetAction type for use with |
| 37 |
// apply. |
| 38 |
func HTTPGetAction() *HTTPGetActionApplyConfiguration { |
| 39 |
return &HTTPGetActionApplyConfiguration{} |
| 40 |
} |
| 41 |
|
| 42 |
// WithPath sets the Path 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 Path field is set to the value of the last call. |
| 45 |
func (b *HTTPGetActionApplyConfiguration) WithPath(value string) *HTTPGetActionApplyConfiguration { |
| 46 |
b.Path = &value |
| 47 |
return b |
| 48 |
} |
| 49 |
|
| 50 |
// WithPort sets the Port 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 Port field is set to the value of the last call. |
| 53 |
func (b *HTTPGetActionApplyConfiguration) WithPort(value intstr.IntOrString) *HTTPGetActionApplyConfiguration { |
| 54 |
b.Port = &value |
| 55 |
return b |
| 56 |
} |
| 57 |
|
| 58 |
// WithHost sets the Host 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 Host field is set to the value of the last call. |
| 61 |
func (b *HTTPGetActionApplyConfiguration) WithHost(value string) *HTTPGetActionApplyConfiguration { |
| 62 |
b.Host = &value |
| 63 |
return b |
| 64 |
} |
| 65 |
|
| 66 |
// WithScheme sets the Scheme field in the declarative configuration to the given value |
| 67 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 68 |
// If called multiple times, the Scheme field is set to the value of the last call. |
| 69 |
func (b *HTTPGetActionApplyConfiguration) WithScheme(value corev1.URIScheme) *HTTPGetActionApplyConfiguration { |
| 70 |
b.Scheme = &value |
| 71 |
return b |
| 72 |
} |
| 73 |
|
| 74 |
// WithHTTPHeaders adds the given value to the HTTPHeaders field in the declarative configuration |
| 75 |
// and returns the receiver, so that objects can be build by chaining "With" function invocations. |
| 76 |
// If called multiple times, values provided by each call will be appended to the HTTPHeaders field. |
| 77 |
func (b *HTTPGetActionApplyConfiguration) WithHTTPHeaders(values ...*HTTPHeaderApplyConfiguration) *HTTPGetActionApplyConfiguration { |
| 78 |
for i := range values { |
| 79 |
if values[i] == nil { |
| 80 |
panic("nil value passed to WithHTTPHeaders") |
| 81 |
} |
| 82 |
b.HTTPHeaders = append(b.HTTPHeaders, *values[i]) |
| 83 |
} |
| 84 |
return b |
| 85 |
} |