/*
Copyright The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

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

package v1alpha1

import (
	v1 "sigs.k8s.io/gateway-api/apis/v1"
)

// BudgetDetailsApplyConfiguration represents a declarative configuration of the BudgetDetails type for use
// with apply.
//
// BudgetDetails specifies the details of the budget configuration, like
// the percentage of requests in the budget, and the interval between
// checks.
type BudgetDetailsApplyConfiguration struct {
	// Percent defines the maximum percentage of active requests that may
	// be made up of retries.
	//
	// Support: Extended
	Percent *int `json:"percent,omitempty"`
	// Interval defines the duration in which requests will be considered
	// for calculating the budget for retries.
	//
	// Support: Extended
	Interval *v1.Duration `json:"interval,omitempty"`
}

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

// WithPercent sets the Percent 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 Percent field is set to the value of the last call.
func (b *BudgetDetailsApplyConfiguration) WithPercent(value int) *BudgetDetailsApplyConfiguration {
	b.Percent = &value
	return b
}

// WithInterval sets the Interval 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 Interval field is set to the value of the last call.
func (b *BudgetDetailsApplyConfiguration) WithInterval(value v1.Duration) *BudgetDetailsApplyConfiguration {
	b.Interval = &value
	return b
}
