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

package v1

// RouteTargetReferenceApplyConfiguration represents a declarative configuration of the RouteTargetReference type for use
// with apply.
//
// RouteTargetReference specifies the target that resolve into endpoints. Only the 'Service'
// kind is allowed. Use 'weight' field to emphasize one over others.
type RouteTargetReferenceApplyConfiguration struct {
	// The kind of target that the route is referring to. Currently, only 'Service' is allowed
	Kind *string `json:"kind,omitempty"`
	// name of the service/target that is being referred to. e.g. name of the service
	Name *string `json:"name,omitempty"`
	// weight as an integer between 0 and 256, default 100, that specifies the target's relative weight
	// against other target reference objects. 0 suppresses requests to this backend.
	Weight *int32 `json:"weight,omitempty"`
}

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

// WithKind sets the Kind 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 Kind field is set to the value of the last call.
func (b *RouteTargetReferenceApplyConfiguration) WithKind(value string) *RouteTargetReferenceApplyConfiguration {
	b.Kind = &value
	return b
}

// WithName sets the Name 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 Name field is set to the value of the last call.
func (b *RouteTargetReferenceApplyConfiguration) WithName(value string) *RouteTargetReferenceApplyConfiguration {
	b.Name = &value
	return b
}

// WithWeight sets the Weight 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 Weight field is set to the value of the last call.
func (b *RouteTargetReferenceApplyConfiguration) WithWeight(value int32) *RouteTargetReferenceApplyConfiguration {
	b.Weight = &value
	return b
}
