// SPDX-License-Identifier: AGPL-3.0-only

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

package v0alpha1

// DeleteJobOptionsApplyConfiguration represents a declarative configuration of the DeleteJobOptions type for use
// with apply.
type DeleteJobOptionsApplyConfiguration struct {
	// Ref to the branch or commit hash to delete from
	Ref *string `json:"ref,omitempty"`
	// Paths to be deleted. Examples:
	// - dashboard.json (for a file)
	// - a/b/c/other-dashboard.json (for a file)
	// - nested/deep/ (for a directory)
	// FIXME: we should validate this in admission hooks
	Paths []string `json:"paths,omitempty"`
	// Resources to delete
	// This option has been created because currently the frontend does not use
	// standarized app platform APIs. For performance and API consistency reasons, the preferred option
	// is it to use the paths.
	Resources []ResourceRefApplyConfiguration `json:"resources,omitempty"`
}

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

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

// WithPaths adds the given value to the Paths field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Paths field.
func (b *DeleteJobOptionsApplyConfiguration) WithPaths(values ...string) *DeleteJobOptionsApplyConfiguration {
	for i := range values {
		b.Paths = append(b.Paths, values[i])
	}
	return b
}

// WithResources adds the given value to the Resources field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Resources field.
func (b *DeleteJobOptionsApplyConfiguration) WithResources(values ...*ResourceRefApplyConfiguration) *DeleteJobOptionsApplyConfiguration {
	for i := range values {
		if values[i] == nil {
			panic("nil value passed to WithResources")
		}
		b.Resources = append(b.Resources, *values[i])
	}
	return b
}
