// Copyright 2025 Microsoft Corporation
//
// 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 (
	sessiongatev1alpha1 "github.com/Azure/ARO-HCP/sessiongate/pkg/apis/sessiongate/v1alpha1"
)

// PrincipalApplyConfiguration represents a declarative configuration of the Principal type for use
// with apply.
//
// Principal identifies the authenticated Azure identity that owns this session.
// based on the identity type and name.
type PrincipalApplyConfiguration struct {
	// type specifies the type of Azure identity that owns this session.
	// Valid values are:
	// - "azureUser": An Azure AD user identity (e.g., an SRE accessing the system)
	// - "azureServicePrincipal": An Azure service principal identity (e.g., automation accounts)
	Type *sessiongatev1alpha1.PrincipalType `json:"type,omitempty"`
	// name is the identifier of the Azure identity that owns this session, e.g.
	// for azureUser: the user's email address or UPN (e.g., "alice@example.com")
	// for azureServicePrincipal: the service principal's client ID / application ID
	Name *string `json:"name,omitempty"`
}

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

// 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 *PrincipalApplyConfiguration) WithType(value sessiongatev1alpha1.PrincipalType) *PrincipalApplyConfiguration {
	b.Type = &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 *PrincipalApplyConfiguration) WithName(value string) *PrincipalApplyConfiguration {
	b.Name = &value
	return b
}
