// Copyright (c) 2026 Tigera, Inc. All rights reserved.

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

package v3

// ServiceMatchApplyConfiguration represents a declarative configuration of the ServiceMatch type for use
// with apply.
type ServiceMatchApplyConfiguration struct {
	// Name specifies the name of a Kubernetes Service to match.
	Name *string `json:"name,omitempty"`
	// Namespace specifies the namespace of the given Service. If left empty, the rule
	// will match within this policy's namespace.
	Namespace *string `json:"namespace,omitempty"`
}

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

// 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 *ServiceMatchApplyConfiguration) WithName(value string) *ServiceMatchApplyConfiguration {
	b.Name = &value
	return b
}

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