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

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

package v0alpha1

import (
	aggregationv0alpha1 "github.com/grafana/grafana/pkg/aggregator/apis/aggregation/v0alpha1"
)

// ServiceApplyConfiguration represents a declarative configuration of the Service type for use
// with apply.
//
// Service defines the type of service the proxied service provides.
type ServiceApplyConfiguration struct {
	// Type is the type of service to proxy.
	Type *aggregationv0alpha1.ServiceType `json:"type,omitempty"`
	// Method is the HTTP method to use when proxying the service.
	Method *string `json:"method,omitempty"`
	// Path is used by the CustomRouteServiceType and SubResourceServiceType to specify the path to the endpoint.
	Path *string `json:"path,omitempty"`
}

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

// WithType sets the Type 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 Type field is set to the value of the last call.
func (b *ServiceApplyConfiguration) WithType(value aggregationv0alpha1.ServiceType) *ServiceApplyConfiguration {
	b.Type = &value
	return b
}

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

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